Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Side by Side Diff: webrtc/modules/audio_coding/main/acm2/delayed_logger.cc

Issue 1203803004: Adding a new ChangeLogger class to handle UMA logging of bitrates (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698