From 9706e1b7596203edee3e1f0aaff56e8493ff9f20 Mon Sep 17 00:00:00 2001 From: "asvitkine@chromium.org" Date: Wed, 11 Jun 2014 16:31:24 +0000 Subject: Make MetricsService save compressed logs to local state. Previously, it would persist logs in uncompressed form. This CL changes the code to compress logs before they're saved. A new pair of prefs is introduced for storing these logs, while reading from the old pref is still maintained to not lose old logs. Additionally, this makes the metrics log discard limit (currently 50k) be checked against the compressed size rather than the uncompressed size. Simplifies the format used to store logs, now simply storing the compressed log bytes and corresponding hash for each log. The size and checksum fields are removed. (Size was redundant while the checksum is not no longer necessary now that we store the log hash.) Deletes some tests that inspected the actual pref values are removed, in favor of tests that check that serializing and de-serializing works as expected. Finally, also introduces GzipUncompress() that is needed for tests that inspect log manager logs. BUG=382076 TBR=agl@chromium.org Review URL: https://codereview.chromium.org/318203004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276429 0039d316-1c4b-4281-b951-d872f2087c98 --- components/metrics.gypi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'components/metrics.gypi') diff --git a/components/metrics.gypi b/components/metrics.gypi index 24fd27c..decc23f8 100644 --- a/components/metrics.gypi +++ b/components/metrics.gypi @@ -12,11 +12,13 @@ ], 'dependencies': [ '../base/base.gyp:base', + '../third_party/zlib/zlib.gyp:zlib', 'component_metrics_proto', 'variations', ], 'sources': [ - 'metrics/metrics_provider.h', + 'metrics/compression_utils.cc', + 'metrics/compression_utils.h', 'metrics/cloned_install_detector.cc', 'metrics/cloned_install_detector.h', 'metrics/machine_id_provider.h', @@ -32,6 +34,7 @@ 'metrics/metrics_log_manager.h', 'metrics/metrics_pref_names.cc', 'metrics/metrics_pref_names.h', + 'metrics/metrics_provider.h', 'metrics/metrics_reporting_scheduler.cc', 'metrics/metrics_reporting_scheduler.h', 'metrics/metrics_service.cc', @@ -67,12 +70,9 @@ ], 'dependencies': [ '../net/net.gyp:net', - '../third_party/zlib/zlib.gyp:zlib', 'metrics', ], 'sources': [ - 'metrics/net/compression_utils.cc', - 'metrics/net/compression_utils.h', 'metrics/net/net_metrics_log_uploader.cc', 'metrics/net/net_metrics_log_uploader.h', ], -- cgit v1.1