Remove num_events_ member from MetricsLogBase.

BUG=375177

Review URL: https://codereview.chromium.org/292113003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271667 0039d316-1c4b-4281-b951-d872f2087c98
parent 7317ac96
...@@ -930,8 +930,6 @@ void MetricsLog::RecordOmniboxOpenedURL(const OmniboxLog& log) { ...@@ -930,8 +930,6 @@ void MetricsLog::RecordOmniboxOpenedURL(const OmniboxLog& log) {
omnibox_event->add_provider_info(); omnibox_event->add_provider_info();
provider_info->CopyFrom(*i); provider_info->CopyFrom(*i);
} }
++num_events_;
} }
void MetricsLog::WriteGoogleUpdateProto( void MetricsLog::WriteGoogleUpdateProto(
......
...@@ -35,8 +35,7 @@ MetricsLogBase::MetricsLogBase(const std::string& client_id, ...@@ -35,8 +35,7 @@ MetricsLogBase::MetricsLogBase(const std::string& client_id,
int session_id, int session_id,
LogType log_type, LogType log_type,
const std::string& version_string) const std::string& version_string)
: num_events_(0), : locked_(false),
locked_(false),
log_type_(log_type) { log_type_(log_type) {
DCHECK_NE(NO_LOG, log_type); DCHECK_NE(NO_LOG, log_type);
if (IsTestingID(client_id)) if (IsTestingID(client_id))
...@@ -100,8 +99,6 @@ void MetricsLogBase::RecordUserAction(const std::string& key) { ...@@ -100,8 +99,6 @@ void MetricsLogBase::RecordUserAction(const std::string& key) {
UserActionEventProto* user_action = uma_proto_.add_user_action_event(); UserActionEventProto* user_action = uma_proto_.add_user_action_event();
user_action->set_name_hash(Hash(key)); user_action->set_name_hash(Hash(key));
user_action->set_time(GetCurrentTime()); user_action->set_time(GetCurrentTime());
++num_events_;
} }
void MetricsLogBase::RecordHistogramDelta(const std::string& histogram_name, void MetricsLogBase::RecordHistogramDelta(const std::string& histogram_name,
......
...@@ -70,7 +70,10 @@ class MetricsLogBase { ...@@ -70,7 +70,10 @@ class MetricsLogBase {
// record. Must only be called after CloseLog() has been called. // record. Must only be called after CloseLog() has been called.
void GetEncodedLog(std::string* encoded_log); void GetEncodedLog(std::string* encoded_log);
int num_events() { return num_events_; } int num_events() const {
return uma_proto_.omnibox_event_size() +
uma_proto_.user_action_event_size();
}
void set_hardware_class(const std::string& hardware_class) { void set_hardware_class(const std::string& hardware_class) {
uma_proto_.mutable_system_profile()->mutable_hardware()->set_hardware_class( uma_proto_.mutable_system_profile()->mutable_hardware()->set_hardware_class(
...@@ -87,9 +90,6 @@ class MetricsLogBase { ...@@ -87,9 +90,6 @@ class MetricsLogBase {
return &uma_proto_; return &uma_proto_;
} }
// TODO(isherman): Remove this once the XML pipeline is outta here.
int num_events_; // the number of events recorded in this log
private: private:
// locked_ is true when record has been packed up for sending, and should // locked_ is true when record has been packed up for sending, and should
// no longer be written to. It is only used for sanity checking and is // no longer be written to. It is only used for sanity checking and is
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment