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

Unified Diff: chrome/browser/metrics/metrics_log_serializer.h

Issue 9562007: Add a minimum byte count to metrics log serialization (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use the byte count as a minimum Created 8 years, 7 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: chrome/browser/metrics/metrics_log_serializer.h
diff --git a/chrome/browser/metrics/metrics_log_serializer.h b/chrome/browser/metrics/metrics_log_serializer.h
index 9a1e630415015ac855101cc519c9a675da161096..7e69582fac467917c18f42e73c5d25f90fd54b7f 100644
--- a/chrome/browser/metrics/metrics_log_serializer.h
+++ b/chrome/browser/metrics/metrics_log_serializer.h
@@ -49,10 +49,14 @@ class MetricsLogSerializer : public MetricsLogManager::LogSerializer {
// Encodes the textual log data from |local_list| and writes it to the given
// pref list, along with list size and checksum. If |is_xml| is true, writes
// the XML data from |local_list|; otherwise writes the protobuf data.
+ // At most |max_list_length| logs will be stored, unless that doesn't reach
+ // |min_bytes| bytes of logs, in which case at least |min_bytes| will be
+ // stored. At least one of those two arguments must be non-zero.
static void WriteLogsToPrefList(
const std::vector<MetricsLogManager::SerializedLog>& local_list,
bool is_xml,
- size_t max_list_size,
+ size_t max_list_length,
+ size_t min_bytes,
base::ListValue* list);
// Decodes and verifies the textual log data from |list|, populating
@@ -65,7 +69,10 @@ class MetricsLogSerializer : public MetricsLogManager::LogSerializer {
FRIEND_TEST_ALL_PREFIXES(MetricsLogSerializerTest, EmptyLogList);
FRIEND_TEST_ALL_PREFIXES(MetricsLogSerializerTest, SingleElementLogList);
- FRIEND_TEST_ALL_PREFIXES(MetricsLogSerializerTest, OverLimitLogList);
+ FRIEND_TEST_ALL_PREFIXES(MetricsLogSerializerTest, LongButTinyLogList);
+ FRIEND_TEST_ALL_PREFIXES(MetricsLogSerializerTest, LongButSmallLogList);
+ FRIEND_TEST_ALL_PREFIXES(MetricsLogSerializerTest, ShortButLargeLogList);
+ FRIEND_TEST_ALL_PREFIXES(MetricsLogSerializerTest, LongAndLargeLogList);
FRIEND_TEST_ALL_PREFIXES(MetricsLogSerializerTest, SmallRecoveredListSize);
FRIEND_TEST_ALL_PREFIXES(MetricsLogSerializerTest, RemoveSizeFromLogList);
FRIEND_TEST_ALL_PREFIXES(MetricsLogSerializerTest, CorruptSizeOfLogList);
« no previous file with comments | « no previous file | chrome/browser/metrics/metrics_log_serializer.cc » ('j') | chrome/browser/metrics/metrics_log_serializer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698