Bug 1495336 - High limit of NETWORK_CACHE_METADATA_SIZE and NETWORK_CACHE_METADATA_FIRST_READ_SIZE probes is too low. r=chutten
authorMichal Novotny <michal.novotny>
Wed, 09 Jan 2019 10:27:00 +0200
changeset 513847 cd696bc79dffd9b8f76e1fd924c441ad3d86cbdb
parent 513846 ceabe45003322ae0bf3e7c9286b94d858780bfbc
child 513848 a559b84032a8d570a64f0bb67ce917c9d696d4fc
child 513890 654c9274673479fc772eef2f8a3002982e931a62
child 513902 32aab5bf983a6245b581819421f76770ddd666e7
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschutten
bugs1495336
milestone66.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 1495336 - High limit of NETWORK_CACHE_METADATA_SIZE and NETWORK_CACHE_METADATA_FIRST_READ_SIZE probes is too low. r=chutten Maximum size of elements in metadata is 64kB, the rest (URL, hashes and few uint32_t members) should normally fit into 1kB, so I set new high value of NETWORK_CACHE_METADATA_SIZE_2 to 65kB. With 66 buckets each bucket should be exactly 1kB wide. NETWORK_CACHE_METADATA_FIRST_READ_SIZE doesn't provide any useful information and this patch removes the probe.
netwerk/cache2/CacheFileMetadata.cpp
toolkit/components/telemetry/Histograms.json
toolkit/components/telemetry/histogram-whitelists.json
--- a/netwerk/cache2/CacheFileMetadata.cpp
+++ b/netwerk/cache2/CacheFileMetadata.cpp
@@ -678,18 +678,16 @@ nsresult CacheFileMetadata::OnDataRead(C
     mListener.swap(listener);
     listener->OnMetadataRead(NS_OK);
     return NS_OK;
   }
 
   if (mFirstRead) {
     Telemetry::AccumulateTimeDelta(
         Telemetry::NETWORK_CACHE_METADATA_FIRST_READ_TIME_MS, mReadStart);
-    Telemetry::Accumulate(Telemetry::NETWORK_CACHE_METADATA_FIRST_READ_SIZE,
-                          mBufSize);
   } else {
     Telemetry::AccumulateTimeDelta(
         Telemetry::NETWORK_CACHE_METADATA_SECOND_READ_TIME_MS, mReadStart);
   }
 
   // check whether we have read all necessary data
   uint32_t realOffset =
       NetworkEndian::readUint32(mBuf + mBufSize - sizeof(uint32_t));
@@ -772,17 +770,17 @@ nsresult CacheFileMetadata::OnDataRead(C
       mListener.swap(listener);
       listener->OnMetadataRead(NS_OK);
       return NS_OK;
     }
 
     return NS_OK;
   }
 
-  Telemetry::Accumulate(Telemetry::NETWORK_CACHE_METADATA_SIZE,
+  Telemetry::Accumulate(Telemetry::NETWORK_CACHE_METADATA_SIZE_2,
                         size - realOffset);
 
   // We have all data according to offset information at the end of the entry.
   // Try to parse it.
   rv = ParseMetadata(realOffset, realOffset - usedOffset, true);
   if (NS_FAILED(rv)) {
     LOG(
         ("CacheFileMetadata::OnDataRead() - Error parsing metadata, creating "
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -10825,31 +10825,26 @@
   "NETWORK_CACHE_METADATA_SECOND_READ_TIME_MS": {
     "record_in_processes": ["main", "content"],
     "expires_in_version": "never",
     "kind": "exponential",
     "high": 10000,
     "n_buckets": 50,
     "description": "Time spent to read the missing part of the metadata from the cache entry file."
   },
-  "NETWORK_CACHE_METADATA_FIRST_READ_SIZE": {
-    "record_in_processes": ["main", "content"],
-    "expires_in_version": "never",
-    "kind": "linear",
-    "high": 5119,
-    "n_buckets": 256,
-    "description": "Guessed size of the metadata that we read from the cache file as the first part."
-  },
-  "NETWORK_CACHE_METADATA_SIZE": {
-    "record_in_processes": ["main", "content"],
-    "expires_in_version": "never",
-    "kind": "linear",
-    "high": 5119,
-    "n_buckets": 256,
-    "description": "Actual size of the metadata parsed from the disk."
+  "NETWORK_CACHE_METADATA_SIZE_2": {
+    "record_in_processes": ["main"],
+    "alert_emails": ["necko@mozilla.com", "mnovotny@mozilla.com"],
+    "bug_numbers": [1133739, 1495336],
+    "expires_in_version": "never",
+    "kind": "linear",
+    "low": 1024,
+    "high": 66560,
+    "n_buckets": 66,
+    "description": "Size of the metadata in bytes parsed from the disk."
   },
   "NETWORK_CACHE_HASH_STATS": {
     "record_in_processes": ["main", "content"],
     "expires_in_version": "46",
     "kind": "enumerated",
     "n_values": 160,
     "description": "The longest hash match between a newly added entry and all the existing entries."
   },
--- a/toolkit/components/telemetry/histogram-whitelists.json
+++ b/toolkit/components/telemetry/histogram-whitelists.json
@@ -284,20 +284,18 @@
     "MOZ_SQLITE_WEBAPPS_SYNC_MS",
     "MOZ_SQLITE_WEBAPPS_WRITE_B",
     "MOZ_SQLITE_WEBAPPS_WRITE_MAIN_THREAD_MS",
     "MOZ_SQLITE_WEBAPPS_WRITE_MS",
     "NETWORK_CACHE_FS_TYPE",
     "NETWORK_CACHE_HASH_STATS",
     "NETWORK_CACHE_HIT_MISS_STAT_PER_CACHE_SIZE",
     "NETWORK_CACHE_HIT_RATE_PER_CACHE_SIZE",
-    "NETWORK_CACHE_METADATA_FIRST_READ_SIZE",
     "NETWORK_CACHE_METADATA_FIRST_READ_TIME_MS",
     "NETWORK_CACHE_METADATA_SECOND_READ_TIME_MS",
-    "NETWORK_CACHE_METADATA_SIZE",
     "NETWORK_CACHE_SIZE_FULL_FAT",
     "NETWORK_CACHE_V1_HIT_TIME_MS",
     "NETWORK_CACHE_V1_MISS_TIME_MS",
     "NETWORK_CACHE_V1_TRUNCATE_TIME_MS",
     "NETWORK_CACHE_V2_INPUT_STREAM_STATUS",
     "NETWORK_CACHE_V2_OUTPUT_STREAM_STATUS",
     "NETWORK_DISK_CACHE2_SHUTDOWN_CLEAR_PRIVATE",
     "NETWORK_DISK_CACHE_DELETEDIR",
@@ -853,20 +851,18 @@
     "MOZ_SQLITE_WEBAPPS_WRITE_MAIN_THREAD_MS",
     "MOZ_SQLITE_WEBAPPS_WRITE_MS",
     "MOZ_STORAGE_ASYNC_REQUESTS_MS",
     "MOZ_STORAGE_ASYNC_REQUESTS_SUCCESS",
     "NETWORK_CACHE_FS_TYPE",
     "NETWORK_CACHE_HASH_STATS",
     "NETWORK_CACHE_HIT_MISS_STAT_PER_CACHE_SIZE",
     "NETWORK_CACHE_HIT_RATE_PER_CACHE_SIZE",
-    "NETWORK_CACHE_METADATA_FIRST_READ_SIZE",
     "NETWORK_CACHE_METADATA_FIRST_READ_TIME_MS",
     "NETWORK_CACHE_METADATA_SECOND_READ_TIME_MS",
-    "NETWORK_CACHE_METADATA_SIZE",
     "NETWORK_CACHE_SIZE_FULL_FAT",
     "NETWORK_CACHE_V1_HIT_TIME_MS",
     "NETWORK_CACHE_V1_MISS_TIME_MS",
     "NETWORK_CACHE_V1_TRUNCATE_TIME_MS",
     "NETWORK_CACHE_V2_INPUT_STREAM_STATUS",
     "NETWORK_CACHE_V2_OUTPUT_STREAM_STATUS",
     "NETWORK_DISK_CACHE2_SHUTDOWN_CLEAR_PRIVATE",
     "NETWORK_DISK_CACHE_DELETEDIR",
@@ -1276,18 +1272,16 @@
     "WEBRTC_CALL_DURATION",
     "DEVTOOLS_DEBUGGER_DISPLAY_SOURCE_LOCAL_MS",
     "DEVTOOLS_DEBUGGER_DISPLAY_SOURCE_REMOTE_MS",
     "DEVTOOLS_SAVE_HEAP_SNAPSHOT_MS",
     "DEVTOOLS_READ_HEAP_SNAPSHOT_MS",
     "DEVTOOLS_HEAP_SNAPSHOT_NODE_COUNT",
     "DEVTOOLS_HEAP_SNAPSHOT_EDGE_COUNT",
     "NETWORK_CACHE_HIT_RATE_PER_CACHE_SIZE",
-    "NETWORK_CACHE_METADATA_FIRST_READ_SIZE",
-    "NETWORK_CACHE_METADATA_SIZE",
     "NETWORK_CACHE_HASH_STATS",
     "SSL_CIPHER_SUITE_FULL",
     "SSL_CIPHER_SUITE_RESUMED",
     "SSL_HANDSHAKE_RESULT",
     "SSL_REASONS_FOR_NOT_FALSE_STARTING",
     "SSL_CERT_VERIFICATION_ERRORS",
     "CERT_VALIDATION_SUCCESS_BY_CA",
     "CERT_PINNING_FAILURES_BY_CA",