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

Unified Diff: net/disk_cache/simple/simple_synchronous_entry.cc

Issue 24400004: Simple Cache: Add two optional stream 2 histograms (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/disk_cache/simple/simple_synchronous_entry.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/simple/simple_synchronous_entry.cc
diff --git a/net/disk_cache/simple/simple_synchronous_entry.cc b/net/disk_cache/simple/simple_synchronous_entry.cc
index 13fd5310492abbb2a9d7eab55040de0d1e428d3d..659d1c187db6119c6d5ca4c3fbe9314ec49e357d 100644
--- a/net/disk_cache/simple/simple_synchronous_entry.cc
+++ b/net/disk_cache/simple/simple_synchronous_entry.cc
@@ -482,6 +482,12 @@ void SimpleSynchronousEntry::Close(
cluster_loss * 100 / (cluster_loss + file_size));
}
+ if (files_created_) {
+ const int stream2_file_index = GetFileIndexFromStreamIndex(2);
+ SIMPLE_CACHE_UMA(BOOLEAN, "EntryCreatedAndStream2Omitted", cache_type_,
+ empty_file_omitted_[stream2_file_index]);
+ }
+
RecordCloseResult(cache_type_, CLOSE_RESULT_SUCCESS);
have_open_files_ = false;
delete this;
@@ -622,6 +628,8 @@ bool SimpleSynchronousEntry::OpenFiles(
"SyncOpenEntryAge", cache_type_,
entry_age.InHours(), 1, 1000, 50);
+ files_created_ = false;
+
return true;
}
@@ -661,6 +669,8 @@ bool SimpleSynchronousEntry::CreateFiles(
for (int i = 0; i < kSimpleEntryStreamCount; ++i)
out_entry_stat->set_data_size(i, 0);
+ files_created_ = true;
+
return true;
}
@@ -754,6 +764,7 @@ int SimpleSynchronousEntry::InitializeForOpen(
}
}
+ bool removed_stream2 = false;
const int stream2_file_index = GetFileIndexFromStreamIndex(2);
DCHECK(CanOmitEmptyFile(stream2_file_index));
if (!empty_file_omitted_[stream2_file_index] &&
@@ -762,8 +773,12 @@ int SimpleSynchronousEntry::InitializeForOpen(
CloseFile(stream2_file_index);
DeleteFileForEntryHash(path_, entry_hash_, stream2_file_index);
empty_file_omitted_[stream2_file_index] = true;
+ removed_stream2 = true;
}
+ SIMPLE_CACHE_UMA(BOOLEAN, "EntryOpenedAndStream2Removed", cache_type_,
+ removed_stream2);
+
RecordSyncOpenResult(cache_type_, OPEN_ENTRY_SUCCESS, had_index);
initialized_ = true;
return net::OK;
« no previous file with comments | « net/disk_cache/simple/simple_synchronous_entry.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698