Bug 1395914 - Update histogram with two new values for IPv6 network-id changes r=michal
authorValentin Gosu <valentin.gosu@gmail.com>
Fri, 28 Jun 2019 11:42:14 +0000
changeset 543402 d3452fb68e5136514e81aaa299c2105593a54513
parent 543401 5ecb89d6b4b1dca065971e9790f61a34242c6bdd
child 543403 816fc698fef580a4f88aa47866dd1e24a81756e4
push id2131
push userffxbld-merge
push dateMon, 26 Aug 2019 18:30:20 +0000
treeherdermozilla-release@b19ffb3ca153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmichal
bugs1395914
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1395914 - Update histogram with two new values for IPv6 network-id changes r=michal Differential Revision: https://phabricator.services.mozilla.com/D34905
netwerk/system/linux/nsNotifyAddrListener_Linux.cpp
netwerk/system/mac/nsNetworkLinkService.mm
netwerk/system/win32/nsNotifyAddrListener.cpp
toolkit/components/telemetry/Histograms.json
--- a/netwerk/system/linux/nsNotifyAddrListener_Linux.cpp
+++ b/netwerk/system/linux/nsNotifyAddrListener_Linux.cpp
@@ -261,30 +261,30 @@ void nsNotifyAddrListener::calculateNetw
     nsAutoCString newString(reinterpret_cast<char*>(digest),
                             SHA1Sum::kHashSize);
     nsresult rv = Base64Encode(newString, output);
     MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));
     LOG(("networkid: id %s\n", output.get()));
     if (mNetworkId != output) {
       // new id
       if (found4 && !found6) {
-        Telemetry::Accumulate(Telemetry::NETWORK_ID, 1);  // IPv4 only
+        Telemetry::Accumulate(Telemetry::NETWORK_ID2, 1);  // IPv4 only
       } else if (!found4 && found6) {
-        Telemetry::Accumulate(Telemetry::NETWORK_ID, 3);  // IPv6 only
+        Telemetry::Accumulate(Telemetry::NETWORK_ID2, 3);  // IPv6 only
       } else {
-        Telemetry::Accumulate(Telemetry::NETWORK_ID, 4);  // Both!
+        Telemetry::Accumulate(Telemetry::NETWORK_ID2, 4);  // Both!
       }
       mNetworkId = output;
     } else {
       // same id
-      Telemetry::Accumulate(Telemetry::NETWORK_ID, 2);
+      Telemetry::Accumulate(Telemetry::NETWORK_ID2, 2);
     }
   } else {
     // no id
-    Telemetry::Accumulate(Telemetry::NETWORK_ID, 0);
+    Telemetry::Accumulate(Telemetry::NETWORK_ID2, 0);
   }
 }
 
 //
 // Check if there's a network interface available to do networking on.
 //
 void nsNotifyAddrListener::checkLink(void) {
   struct ifaddrs* list;
--- a/netwerk/system/mac/nsNetworkLinkService.mm
+++ b/netwerk/system/mac/nsNetworkLinkService.mm
@@ -329,30 +329,30 @@ void nsNetworkLinkService::calculateNetw
     sha1.finish(digest);
     nsAutoCString newString(reinterpret_cast<char*>(digest), SHA1Sum::kHashSize);
     nsresult rv = Base64Encode(newString, output);
     MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));
     LOG(("networkid: id %s\n", output.get()));
     if (mNetworkId != output) {
       // new id
       if (found4 && !found6) {
-        Telemetry::Accumulate(Telemetry::NETWORK_ID, 1);  // IPv4 only
+        Telemetry::Accumulate(Telemetry::NETWORK_ID2, 1);  // IPv4 only
       } else if (!found4 && found6) {
-        Telemetry::Accumulate(Telemetry::NETWORK_ID, 3);  // IPv6 only
+        Telemetry::Accumulate(Telemetry::NETWORK_ID2, 3);  // IPv6 only
       } else {
-        Telemetry::Accumulate(Telemetry::NETWORK_ID, 4);  // Both!
+        Telemetry::Accumulate(Telemetry::NETWORK_ID2, 4);  // Both!
       }
       mNetworkId = output;
     } else {
       // same id
-      Telemetry::Accumulate(Telemetry::NETWORK_ID, 2);
+      Telemetry::Accumulate(Telemetry::NETWORK_ID2, 2);
     }
   } else {
     // no id
-    Telemetry::Accumulate(Telemetry::NETWORK_ID, 0);
+    Telemetry::Accumulate(Telemetry::NETWORK_ID2, 0);
   }
 }
 
 NS_IMETHODIMP
 nsNetworkLinkService::Observe(nsISupports* subject, const char* topic, const char16_t* data) {
   if (!strcmp(topic, "xpcom-shutdown")) {
     Shutdown();
   }
--- a/netwerk/system/win32/nsNotifyAddrListener.cpp
+++ b/netwerk/system/win32/nsNotifyAddrListener.cpp
@@ -207,21 +207,21 @@ bool nsNotifyAddrListener::findMac(char*
           nsresult rv = Base64Encode(newString, output);
           if (NS_FAILED(rv)) {
             found = false;
             break;
           }
           LOG(("networkid: id %s\n", output.get()));
           if (mNetworkId != output) {
             // new id
-            Telemetry::Accumulate(Telemetry::NETWORK_ID, 1);
+            Telemetry::Accumulate(Telemetry::NETWORK_ID2, 1);
             mNetworkId = output;
           } else {
             // same id
-            Telemetry::Accumulate(Telemetry::NETWORK_ID, 2);
+            Telemetry::Accumulate(Telemetry::NETWORK_ID2, 2);
           }
           found = true;
           break;
         }
       }
     }
   }
   return found;
@@ -276,17 +276,17 @@ static bool defaultgw(char* aGateway, si
 void nsNotifyAddrListener::calculateNetworkId(void) {
   bool found = FALSE;
   char gateway[128];
   if (defaultgw(gateway, sizeof(gateway))) {
     found = findMac(gateway);
   }
   if (!found) {
     // no id
-    Telemetry::Accumulate(Telemetry::NETWORK_ID, 0);
+    Telemetry::Accumulate(Telemetry::NETWORK_ID2, 0);
   }
 }
 
 // Static Callback function for NotifyIpInterfaceChange API.
 static void WINAPI OnInterfaceChange(PVOID callerContext,
                                      PMIB_IPINTERFACE_ROW row,
                                      MIB_NOTIFICATION_TYPE notificationType) {
   nsNotifyAddrListener* notify =
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -4827,24 +4827,24 @@
   "NETWORK_DISK_CACHE2_SHUTDOWN_CLEAR_PRIVATE": {
     "record_in_processes": ["main", "content"],
     "expires_in_version": "never",
     "kind": "exponential",
     "high": 10000,
     "n_buckets": 10,
     "description": "Time spent (ms) during showdown deleting disk cache v2 for 'clear private data' option"
   },
-  "NETWORK_ID": {
-    "record_in_processes": ["main", "content"],
+  "NETWORK_ID2": {
+    "record_in_processes": ["main"],
     "alert_emails": ["necko@mozilla.com"],
-    "bug_numbers": [1240932],
+    "bug_numbers": [1240932, 1395914],
     "expires_in_version": "never",
     "kind": "enumerated",
     "n_values": 6,
-    "description": "Network identification (0=None, 1=New, 2=Same)"
+    "description": "Network identification (0=None, 1=New Ipv4, 2=Same, 3=New IPv6, 4=New dual)"
   },
   "IDLE_NOTIFY_IDLE_MS": {
     "record_in_processes": ["main", "content"],
     "alert_emails": ["froydnj@mozilla.com"],
     "bug_numbers": [731004],
     "expires_in_version": "default",
     "kind": "exponential",
     "high": 5000,