Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Side by Side Diff: webrtc/p2p/base/port.h

Issue 1940493002: Add Stats to Stun ping. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Add three more counters for stun ping. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 468
469 // Estimate of the round-trip time over this connection. 469 // Estimate of the round-trip time over this connection.
470 int rtt() const { return rtt_; } 470 int rtt() const { return rtt_; }
471 471
472 size_t sent_total_bytes(); 472 size_t sent_total_bytes();
473 size_t sent_bytes_second(); 473 size_t sent_bytes_second();
474 // Used to track how many packets are discarded in the application socket due 474 // Used to track how many packets are discarded in the application socket due
475 // to errors. 475 // to errors.
476 size_t sent_discarded_packets(); 476 size_t sent_discarded_packets();
477 size_t sent_total_packets(); 477 size_t sent_total_packets();
478 size_t sent_ping_requests_total();
479 size_t sent_ping_requests_before_first_response();
480 size_t sent_ping_responses();
478 size_t recv_total_bytes(); 481 size_t recv_total_bytes();
479 size_t recv_bytes_second(); 482 size_t recv_bytes_second();
483 size_t recv_ping_responses();
484 size_t recv_ping_requests();
480 sigslot::signal1<Connection*> SignalStateChange; 485 sigslot::signal1<Connection*> SignalStateChange;
481 486
482 // Sent when the connection has decided that it is no longer of value. It 487 // Sent when the connection has decided that it is no longer of value. It
483 // will delete itself immediately after this call. 488 // will delete itself immediately after this call.
484 sigslot::signal1<Connection*> SignalDestroyed; 489 sigslot::signal1<Connection*> SignalDestroyed;
485 490
486 // The connection can send and receive packets asynchronously. This matches 491 // The connection can send and receive packets asynchronously. This matches
487 // the interface of AsyncPacketSocket, which may use UDP or TCP under the 492 // the interface of AsyncPacketSocket, which may use UDP or TCP under the
488 // covers. 493 // covers.
489 virtual int Send(const void* data, size_t size, 494 virtual int Send(const void* data, size_t size,
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 int64_t last_ping_received_; // last time we received a ping from the other 643 int64_t last_ping_received_; // last time we received a ping from the other
639 // side 644 // side
640 int64_t last_data_received_; 645 int64_t last_data_received_;
641 int64_t last_ping_response_received_; 646 int64_t last_ping_response_received_;
642 std::vector<SentPing> pings_since_last_response_; 647 std::vector<SentPing> pings_since_last_response_;
643 648
644 rtc::RateTracker recv_rate_tracker_; 649 rtc::RateTracker recv_rate_tracker_;
645 rtc::RateTracker send_rate_tracker_; 650 rtc::RateTracker send_rate_tracker_;
646 uint32_t sent_packets_discarded_; 651 uint32_t sent_packets_discarded_;
647 uint32_t sent_packets_total_; 652 uint32_t sent_packets_total_;
653 // Stun ping related stats.
654 uint32_t sent_ping_requests_total_;
655 uint32_t sent_ping_requests_before_first_response_;
656 uint32_t sent_ping_responses_;
657 uint32_t recv_ping_requests_;
658 uint32_t recv_ping_responses_;
pthatcher1 2016/05/27 21:27:15 Can we just store a ConnectionInfo value here inst
zhihuang1 2016/06/01 21:30:05 Do you mean renaming ConnectionInfo -> IceCandidat
pthatcher1 2016/06/01 21:39:48 In a separate CL is fine.
648 659
649 private: 660 private:
650 void MaybeAddPrflxCandidate(ConnectionRequest* request, 661 void MaybeAddPrflxCandidate(ConnectionRequest* request,
651 StunMessage* response); 662 StunMessage* response);
652 663
653 bool reported_; 664 bool reported_;
654 State state_; 665 State state_;
655 // Time duration to switch from receiving to not receiving. 666 // Time duration to switch from receiving to not receiving.
656 int receiving_timeout_; 667 int receiving_timeout_;
657 int64_t time_created_ms_; 668 int64_t time_created_ms_;
669 bool received_first_response_;
pthatcher1 2016/05/27 21:27:15 Can you tell by "recv_ping_reponses_ > 0"?
658 670
659 friend class Port; 671 friend class Port;
660 friend class ConnectionRequest; 672 friend class ConnectionRequest;
661 }; 673 };
662 674
663 // ProxyConnection defers all the interesting work to the port. 675 // ProxyConnection defers all the interesting work to the port.
664 class ProxyConnection : public Connection { 676 class ProxyConnection : public Connection {
665 public: 677 public:
666 ProxyConnection(Port* port, size_t index, const Candidate& remote_candidate); 678 ProxyConnection(Port* port, size_t index, const Candidate& remote_candidate);
667 679
668 int Send(const void* data, 680 int Send(const void* data,
669 size_t size, 681 size_t size,
670 const rtc::PacketOptions& options) override; 682 const rtc::PacketOptions& options) override;
671 int GetError() override { return error_; } 683 int GetError() override { return error_; }
672 684
673 private: 685 private:
674 int error_ = 0; 686 int error_ = 0;
675 }; 687 };
676 688
677 } // namespace cricket 689 } // namespace cricket
678 690
679 #endif // WEBRTC_P2P_BASE_PORT_H_ 691 #endif // WEBRTC_P2P_BASE_PORT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698