uma_metrics.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. /*
  2. * Copyright 2014 The WebRTC project authors. All Rights Reserved.
  3. *
  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
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. // This file contains enums related to IPv4/IPv6 metrics.
  11. #ifndef API_UMA_METRICS_H_
  12. #define API_UMA_METRICS_H_
  13. #include "rtc_base/ref_count.h"
  14. namespace webrtc {
  15. // Currently this contains information related to WebRTC network/transport
  16. // information.
  17. // The difference between PeerConnectionEnumCounter and
  18. // PeerConnectionMetricsName is that the "EnumCounter" is only counting the
  19. // occurrences of events, while "Name" has a value associated with it which is
  20. // used to form a histogram.
  21. // This enum is backed by Chromium's histograms.xml,
  22. // chromium/src/tools/metrics/histograms/histograms.xml
  23. // Existing values cannot be re-ordered and new enums must be added
  24. // before kBoundary.
  25. enum PeerConnectionAddressFamilyCounter {
  26. kPeerConnection_IPv4,
  27. kPeerConnection_IPv6,
  28. kBestConnections_IPv4,
  29. kBestConnections_IPv6,
  30. kPeerConnectionAddressFamilyCounter_Max,
  31. };
  32. // This enum defines types for UMA samples, which will have a range.
  33. enum PeerConnectionMetricsName {
  34. kNetworkInterfaces_IPv4, // Number of IPv4 interfaces.
  35. kNetworkInterfaces_IPv6, // Number of IPv6 interfaces.
  36. kTimeToConnect, // In milliseconds.
  37. kLocalCandidates_IPv4, // Number of IPv4 local candidates.
  38. kLocalCandidates_IPv6, // Number of IPv6 local candidates.
  39. kPeerConnectionMetricsName_Max
  40. };
  41. // The IceCandidatePairType has the format of
  42. // <local_candidate_type>_<remote_candidate_type>. It is recorded based on the
  43. // type of candidate pair used when the PeerConnection first goes to a completed
  44. // state. When BUNDLE is enabled, only the first transport gets recorded.
  45. enum IceCandidatePairType {
  46. // HostHost is deprecated. It was replaced with the set of types at the bottom
  47. // to report private or public host IP address.
  48. kIceCandidatePairHostHost,
  49. kIceCandidatePairHostSrflx,
  50. kIceCandidatePairHostRelay,
  51. kIceCandidatePairHostPrflx,
  52. kIceCandidatePairSrflxHost,
  53. kIceCandidatePairSrflxSrflx,
  54. kIceCandidatePairSrflxRelay,
  55. kIceCandidatePairSrflxPrflx,
  56. kIceCandidatePairRelayHost,
  57. kIceCandidatePairRelaySrflx,
  58. kIceCandidatePairRelayRelay,
  59. kIceCandidatePairRelayPrflx,
  60. kIceCandidatePairPrflxHost,
  61. kIceCandidatePairPrflxSrflx,
  62. kIceCandidatePairPrflxRelay,
  63. // The following 9 types tell whether local and remote hosts have hostname,
  64. // private or public IP addresses.
  65. kIceCandidatePairHostPrivateHostPrivate,
  66. kIceCandidatePairHostPrivateHostPublic,
  67. kIceCandidatePairHostPublicHostPrivate,
  68. kIceCandidatePairHostPublicHostPublic,
  69. kIceCandidatePairHostNameHostName,
  70. kIceCandidatePairHostNameHostPrivate,
  71. kIceCandidatePairHostNameHostPublic,
  72. kIceCandidatePairHostPrivateHostName,
  73. kIceCandidatePairHostPublicHostName,
  74. kIceCandidatePairMax
  75. };
  76. enum KeyExchangeProtocolType {
  77. kEnumCounterKeyProtocolDtls,
  78. kEnumCounterKeyProtocolSdes,
  79. kEnumCounterKeyProtocolMax
  80. };
  81. enum KeyExchangeProtocolMedia {
  82. kEnumCounterKeyProtocolMediaTypeDtlsAudio,
  83. kEnumCounterKeyProtocolMediaTypeDtlsVideo,
  84. kEnumCounterKeyProtocolMediaTypeDtlsData,
  85. kEnumCounterKeyProtocolMediaTypeSdesAudio,
  86. kEnumCounterKeyProtocolMediaTypeSdesVideo,
  87. kEnumCounterKeyProtocolMediaTypeSdesData,
  88. kEnumCounterKeyProtocolMediaTypeMax
  89. };
  90. enum SdpSemanticRequested {
  91. kSdpSemanticRequestDefault,
  92. kSdpSemanticRequestPlanB,
  93. kSdpSemanticRequestUnifiedPlan,
  94. kSdpSemanticRequestMax
  95. };
  96. enum SdpSemanticNegotiated {
  97. kSdpSemanticNegotiatedNone,
  98. kSdpSemanticNegotiatedPlanB,
  99. kSdpSemanticNegotiatedUnifiedPlan,
  100. kSdpSemanticNegotiatedMixed,
  101. kSdpSemanticNegotiatedMax
  102. };
  103. // Metric which records the format of the received SDP for tracking how much the
  104. // difference between Plan B and Unified Plan affect users.
  105. enum SdpFormatReceived {
  106. // No audio or video tracks. This is worth special casing since it seems to be
  107. // the most common scenario (data-channel only).
  108. kSdpFormatReceivedNoTracks,
  109. // No more than one audio and one video track. Should be compatible with both
  110. // Plan B and Unified Plan endpoints.
  111. kSdpFormatReceivedSimple,
  112. // More than one audio track or more than one video track in the Plan B format
  113. // (e.g., one audio media section with multiple streams).
  114. kSdpFormatReceivedComplexPlanB,
  115. // More than one audio track or more than one video track in the Unified Plan
  116. // format (e.g., two audio media sections).
  117. kSdpFormatReceivedComplexUnifiedPlan,
  118. kSdpFormatReceivedMax
  119. };
  120. // Metric for counting the outcome of adding an ICE candidate
  121. enum AddIceCandidateResult {
  122. kAddIceCandidateSuccess,
  123. kAddIceCandidateFailClosed,
  124. kAddIceCandidateFailNoRemoteDescription,
  125. kAddIceCandidateFailNullCandidate,
  126. kAddIceCandidateFailNotValid,
  127. kAddIceCandidateFailNotReady,
  128. kAddIceCandidateFailInAddition,
  129. kAddIceCandidateFailNotUsable,
  130. kAddIceCandidateMax
  131. };
  132. // Metric for recording which api surface was used to enable simulcast.
  133. enum SimulcastApiVersion {
  134. kSimulcastApiVersionNone,
  135. kSimulcastApiVersionLegacy,
  136. kSimulcastApiVersionSpecCompliant,
  137. kSimulcastApiVersionMax,
  138. };
  139. } // namespace webrtc
  140. #endif // API_UMA_METRICS_H_