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

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: 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
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 38e8a3cae995175df0a71e7c34d4ce6190fc8cab..7b4d1a9dd83ec64b0891d49cef61018441b64f78 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 third_stream_file_index = GetFileIndexFromStreamIndex(2);
DCHECK(CanOmitEmptyFile(third_stream_file_index));
if (!empty_file_omitted_[third_stream_file_index] &&
@@ -762,8 +773,12 @@ int SimpleSynchronousEntry::InitializeForOpen(
CloseFile(third_stream_file_index);
DeleteFileForEntryHash(path_, entry_hash_, third_stream_file_index);
empty_file_omitted_[third_stream_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;

Powered by Google App Engine
This is Rietveld 408576698