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

Side by Side Diff: chrome/common/metrics/metrics_log_manager.h

Issue 10541085: When persisting UMA logs to disk, cap log size based on both the XML and protocol buffer logs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: max rather than sum Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_COMMON_METRICS_METRICS_LOG_MANAGER_H_ 5 #ifndef CHROME_COMMON_METRICS_METRICS_LOG_MANAGER_H_
6 #define CHROME_COMMON_METRICS_METRICS_LOG_MANAGER_H_ 6 #define CHROME_COMMON_METRICS_METRICS_LOG_MANAGER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 10 matching lines...) Expand all
21 public: 21 public:
22 MetricsLogManager(); 22 MetricsLogManager();
23 ~MetricsLogManager(); 23 ~MetricsLogManager();
24 24
25 // Stores both XML and protocol buffer serializations for a log. 25 // Stores both XML and protocol buffer serializations for a log.
26 struct SerializedLog { 26 struct SerializedLog {
27 public: 27 public:
28 // Exposed to reduce code churn as we transition from the XML pipeline to 28 // Exposed to reduce code churn as we transition from the XML pipeline to
29 // the protocol buffer pipeline. 29 // the protocol buffer pipeline.
30 bool empty() const; 30 bool empty() const;
31 size_t length() const;
31 void swap(SerializedLog& log); 32 void swap(SerializedLog& log);
32 33
33 std::string xml; 34 std::string xml;
34 std::string proto; 35 std::string proto;
35 }; 36 };
36 37
37 enum LogType { 38 enum LogType {
38 INITIAL_LOG, // The first log of a session. 39 INITIAL_LOG, // The first log of a session.
39 ONGOING_LOG, // Subsequent logs in a session. 40 ONGOING_LOG, // Subsequent logs in a session.
40 NO_LOG, // Placeholder value for when there is no log. 41 NO_LOG, // Placeholder value for when there is no log.
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 // This is necessary because during an upload there are two logs (staged 203 // This is necessary because during an upload there are two logs (staged
203 // and current) and a client might store them in either order, so it's 204 // and current) and a client might store them in either order, so it's
204 // not necessarily the case that the provisional store is the last store. 205 // not necessarily the case that the provisional store is the last store.
205 int last_provisional_store_index_; 206 int last_provisional_store_index_;
206 LogType last_provisional_store_type_; 207 LogType last_provisional_store_type_;
207 208
208 DISALLOW_COPY_AND_ASSIGN(MetricsLogManager); 209 DISALLOW_COPY_AND_ASSIGN(MetricsLogManager);
209 }; 210 };
210 211
211 #endif // CHROME_COMMON_METRICS_METRICS_LOG_MANAGER_H_ 212 #endif // CHROME_COMMON_METRICS_METRICS_LOG_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/browser/metrics/metrics_log_serializer.cc ('k') | chrome/common/metrics/metrics_log_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698