Refactored metrics to support pull model.
MetricsGroup split into 3 groups, session, engine, and crypto. MetricsFrontEnd and Report removed. This is a merge from wvgerrit/28420 Bug: 36217927 Test: Added unit tests to cover modified code. Change-Id: I2f39f99ce88cc2229d6d1aa9459c67c5b86ccef4
This commit is contained in:
@@ -32,24 +32,24 @@ void BaseEventMetric::Record(const std::string& field_names_values,
|
||||
distribution->Record(value);
|
||||
}
|
||||
|
||||
void BaseEventMetric::Publish(MetricNotification* notification) {
|
||||
void BaseEventMetric::Serialize(MetricSerializer* serializer) {
|
||||
AutoLock lock(internal_lock_);
|
||||
|
||||
for (std::map<std::string, Distribution*>::iterator it
|
||||
= value_map_.begin(); it != value_map_.end(); it++) {
|
||||
notification->UpdateInt64(
|
||||
serializer->SetInt64(
|
||||
metric_name_ + "/count" + it->first,
|
||||
it->second->Count());
|
||||
notification->UpdateDouble(
|
||||
serializer->SetDouble(
|
||||
metric_name_ + "/mean" + it->first,
|
||||
it->second->Mean());
|
||||
notification->UpdateDouble(
|
||||
serializer->SetDouble(
|
||||
metric_name_ + "/variance" + it->first,
|
||||
it->second->Variance());
|
||||
notification->UpdateDouble(
|
||||
serializer->SetDouble(
|
||||
metric_name_ + "/min" + it->first,
|
||||
it->second->Min());
|
||||
notification->UpdateDouble(
|
||||
serializer->SetDouble(
|
||||
metric_name_ + "/max" + it->first,
|
||||
it->second->Max());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user