// Copyright 2017 Google LLC. All Rights Reserved. This file and proprietary // source code may only be used and distributed under the Widevine License // Agreement. // // This file contains implementations for the BaseCounterMetric, the base class // for CounterMetric. #include "counter_metric.h" namespace wvcdm { namespace metrics { void BaseCounterMetric::Increment(const std::string& counter_key, int64_t value) { std::unique_lock 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