OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | |
3 * | |
4 * Use of this source code is governed by a BSD-style license | |
5 * that can be found in the LICENSE file in the root of the source | |
6 * tree. An additional intellectual property rights grant can be found | |
7 * in the file PATENTS. All contributing project authors may | |
8 * be found in the AUTHORS file in the root of the source tree. | |
9 */ | |
10 | |
11 #include "webrtc/modules/audio_coding/main/acm2/delayed_logger.h" | |
12 #include "webrtc/system_wrappers/interface/metrics.h" | |
13 | |
14 namespace webrtc { | |
15 namespace acm2 { | |
16 | |
17 DelayedLogger::DelayedLogger(const std::string& histogram_name) | |
18 : value_(0), log_on_next_call_(false), histogram_name_(histogram_name) { | |
kwiberg-webrtc
2015/06/25 09:42:44
You don't have to initialize value_. (The only sig
| |
19 } | |
20 | |
21 DelayedLogger::~DelayedLogger() = default; | |
22 | |
23 void DelayedLogger::SetValue(int value) { | |
24 value_ = value; | |
25 log_on_next_call_ = true; | |
26 } | |
27 | |
28 void DelayedLogger::MaybeLogValue() { | |
29 if (!log_on_next_call_) | |
30 return; | |
31 | |
32 RTC_HISTOGRAM_COUNTS_100(histogram_name_, value_); | |
33 log_on_next_call_ = false; | |
34 } | |
35 | |
36 } // namespace acm2 | |
37 } // namespace webrtc | |
OLD | NEW |