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

Issue 318203004: Make MetricsService save compressed logs to local state. (Closed)

Created:
6 years, 6 months ago by Alexei Svitkine (slow)
Modified:
6 years, 6 months ago
Reviewers:
Ilya Sherman, agl
CC:
chromium-reviews, cbentzel+watch_chromium.org, Ilya Sherman, asvitkine+watch_chromium.org, jar+watch_chromium.org
Visibility:
Public.

Description

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 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=276429

Patch Set 1 #

Patch Set 2 : #

Total comments: 24

Patch Set 3 : #

Total comments: 6

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+544 lines, -471 lines) Patch
M chrome/browser/metrics/metrics_service_unittest.cc View 1 2 3 4 2 chunks +6 lines, -1 line 0 comments Download
M components/components_tests.gyp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M components/metrics.gypi View 1 2 3 4 3 chunks +4 lines, -4 lines 0 comments Download
M components/metrics/DEPS View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
A components/metrics/compression_utils.h View 1 2 3 1 chunk +20 lines, -0 lines 0 comments Download
A components/metrics/compression_utils.cc View 1 2 3 1 chunk +156 lines, -0 lines 0 comments Download
A components/metrics/compression_utils_unittest.cc View 1 2 3 1 chunk +76 lines, -0 lines 0 comments Download
M components/metrics/metrics_log_manager.h View 1 2 3 4 3 chunks +5 lines, -7 lines 0 comments Download
M components/metrics/metrics_log_manager.cc View 1 2 3 4 3 chunks +10 lines, -8 lines 0 comments Download
M components/metrics/metrics_log_manager_unittest.cc View 1 2 3 4 5 9 chunks +14 lines, -15 lines 0 comments Download
M components/metrics/metrics_log_uploader.h View 1 2 3 4 1 chunk +4 lines, -3 lines 0 comments Download
M components/metrics/metrics_pref_names.h View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M components/metrics/metrics_pref_names.cc View 1 2 3 4 2 chunks +4 lines, -0 lines 0 comments Download
M components/metrics/metrics_service.cc View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M components/metrics/net/DEPS View 1 2 3 4 1 chunk +0 lines, -1 line 0 comments Download
D components/metrics/net/compression_utils.h View 1 2 3 4 1 chunk +0 lines, -17 lines 0 comments Download
D components/metrics/net/compression_utils.cc View 1 2 3 4 1 chunk +0 lines, -96 lines 0 comments Download
D components/metrics/net/compression_utils_unittest.cc View 1 2 3 4 1 chunk +0 lines, -52 lines 0 comments Download
M components/metrics/net/net_metrics_log_uploader.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M components/metrics/net/net_metrics_log_uploader.cc View 1 2 3 4 2 chunks +1 line, -16 lines 0 comments Download
M components/metrics/persisted_logs.h View 1 2 3 4 5 chunks +37 lines, -17 lines 0 comments Download
M components/metrics/persisted_logs.cc View 1 2 3 4 9 chunks +93 lines, -41 lines 0 comments Download
M components/metrics/persisted_logs_unittest.cc View 1 2 3 4 9 chunks +107 lines, -191 lines 0 comments Download

Messages

Total messages: 20 (0 generated)
Alexei Svitkine (slow)
6 years, 6 months ago (2014-06-07 07:38:02 UTC) #1
Alexei Svitkine (slow)
Oops, somehow sent this out with the wrong title. Fixed now.
6 years, 6 months ago (2014-06-07 08:54:20 UTC) #2
Alexei Svitkine (slow)
friendly ping
6 years, 6 months ago (2014-06-09 20:42:19 UTC) #3
Ilya Sherman
Thanks, Alexei! https://codereview.chromium.org/318203004/diff/20001/components/metrics/compression_utils.cc File components/metrics/compression_utils.cc (right): https://codereview.chromium.org/318203004/diff/20001/components/metrics/compression_utils.cc#newcode79 components/metrics/compression_utils.cc:79: const Bytef *source, nit: " *" -> ...
6 years, 6 months ago (2014-06-09 23:17:00 UTC) #4
Alexei Svitkine (slow)
Thanks, comments addressed. PTAL. https://codereview.chromium.org/318203004/diff/20001/components/metrics/compression_utils.cc File components/metrics/compression_utils.cc (right): https://codereview.chromium.org/318203004/diff/20001/components/metrics/compression_utils.cc#newcode79 components/metrics/compression_utils.cc:79: const Bytef *source, On 2014/06/09 ...
6 years, 6 months ago (2014-06-10 17:01:16 UTC) #5
Ilya Sherman
LGTM % nits and a question. Thanks, Alexei! https://codereview.chromium.org/318203004/diff/20001/components/metrics/persisted_logs_unittest.cc File components/metrics/persisted_logs_unittest.cc (left): https://codereview.chromium.org/318203004/diff/20001/components/metrics/persisted_logs_unittest.cc#oldcode288 components/metrics/persisted_logs_unittest.cc:288: // ...
6 years, 6 months ago (2014-06-10 23:38:39 UTC) #6
Alexei Svitkine (slow)
https://codereview.chromium.org/318203004/diff/20001/components/metrics/persisted_logs_unittest.cc File components/metrics/persisted_logs_unittest.cc (left): https://codereview.chromium.org/318203004/diff/20001/components/metrics/persisted_logs_unittest.cc#oldcode288 components/metrics/persisted_logs_unittest.cc:288: // Corrupt checksum of stored list_value. On 2014/06/10 23:38:39, ...
6 years, 6 months ago (2014-06-11 00:16:28 UTC) #7
Alexei Svitkine (slow)
The CQ bit was checked by asvitkine@chromium.org
6 years, 6 months ago (2014-06-11 00:16:33 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/asvitkine@chromium.org/318203004/60001
6 years, 6 months ago (2014-06-11 00:17:53 UTC) #9
Alexei Svitkine (slow)
+agl for components/metrics/DEPS review for the +third_party/zlib line (which requires approval from third_party/zlib/OWNERS)
6 years, 6 months ago (2014-06-11 01:16:06 UTC) #10
Alexei Svitkine (slow)
The CQ bit was checked by asvitkine@chromium.org
6 years, 6 months ago (2014-06-11 04:47:46 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/asvitkine@chromium.org/318203004/80001
6 years, 6 months ago (2014-06-11 04:49:27 UTC) #12
Alexei Svitkine (slow)
The CQ bit was checked by asvitkine@chromium.org
6 years, 6 months ago (2014-06-11 05:59:32 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/asvitkine@chromium.org/318203004/100001
6 years, 6 months ago (2014-06-11 06:00:20 UTC) #14
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: chromium_presubmit on tryserver.chromium ...
6 years, 6 months ago (2014-06-11 12:02:59 UTC) #15
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 6 months ago (2014-06-11 12:09:06 UTC) #16
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/chromium_presubmit/builds/72973)
6 years, 6 months ago (2014-06-11 12:09:07 UTC) #17
Alexei Svitkine (slow)
The CQ bit was checked by asvitkine@chromium.org
6 years, 6 months ago (2014-06-11 15:13:12 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/asvitkine@chromium.org/318203004/100001
6 years, 6 months ago (2014-06-11 15:17:08 UTC) #19
commit-bot: I haz the power
6 years, 6 months ago (2014-06-11 16:31:26 UTC) #20
Message was sent while issue was closed.
Change committed as 276429

Powered by Google App Engine
This is Rietveld 408576698