Changes to a much more efficient and more reusable protobuf format for metrics. Test: Widevine tests, Google Play and MediaDrm CTS test. Bug: 73724218 Change-Id: I3299051d7a16bcd7758c8f272415ca40e10c1313
26 lines
623 B
C++
26 lines
623 B
C++
// Copyright 2017 Google Inc. All Rights Reserved.
|
|
//
|
|
// This file contains implementations for the BaseCounterMetric, the base class
|
|
// for CounterMetric.
|
|
|
|
#include "counter_metric.h"
|
|
|
|
#include "metrics.pb.h"
|
|
|
|
namespace wvcdm {
|
|
namespace metrics {
|
|
|
|
void BaseCounterMetric::Increment(const std::string &counter_key,
|
|
int64_t value) {
|
|
AutoLock lock(internal_lock_);
|
|
|
|
if (value_map_.find(counter_key) == value_map_.end()) {
|
|
value_map_[counter_key] = value;
|
|
} else {
|
|
value_map_[counter_key] = value_map_[counter_key] + value;
|
|
}
|
|
}
|
|
|
|
} // namespace metrics
|
|
} // namespace wvcdm
|