#include "video/stats_counter.h"
#include <algorithm>
#include <limits>
#include <map>
#include "rtc_base/checks.h"
#include "rtc_base/strings/string_builder.h"
#include "system_wrappers/include/clock.h"
namespace webrtc {
namespace {
const int64_t kDefaultProcessIntervalMs = …;
const uint32_t kStreamId0 = …;
}
std::string AggregatedStats::ToString() const { … }
std::string AggregatedStats::ToStringWithMultiplier(int multiplier) const { … }
class AggregatedCounter { … };
class Samples { … };
StatsCounter::StatsCounter(Clock* clock,
int64_t process_intervals_ms,
bool include_empty_intervals,
StatsCounterObserver* observer)
: … { … }
StatsCounter::~StatsCounter() { … }
AggregatedStats StatsCounter::GetStats() { … }
AggregatedStats StatsCounter::ProcessAndGetStats() { … }
void StatsCounter::ProcessAndPauseForDuration(int64_t min_pause_time_ms) { … }
void StatsCounter::ProcessAndPause() { … }
void StatsCounter::ProcessAndStopPause() { … }
bool StatsCounter::HasSample() const { … }
bool StatsCounter::TimeToProcess(int* elapsed_intervals) { … }
void StatsCounter::Add(int sample) { … }
void StatsCounter::Set(int64_t sample, uint32_t stream_id) { … }
void StatsCounter::SetLast(int64_t sample, uint32_t stream_id) { … }
void StatsCounter::ReportMetricToAggregatedCounter(
int value,
int num_values_to_add) const { … }
void StatsCounter::TryProcess() { … }
bool StatsCounter::IncludeEmptyIntervals() const { … }
void StatsCounter::ResumeIfMinTimePassed() { … }
void StatsCounter::Resume() { … }
AvgCounter::AvgCounter(Clock* clock,
StatsCounterObserver* observer,
bool include_empty_intervals)
: … { … }
void AvgCounter::Add(int sample) { … }
bool AvgCounter::GetMetric(int* metric) const { … }
int AvgCounter::GetValueForEmptyInterval() const { … }
MaxCounter::MaxCounter(Clock* clock,
StatsCounterObserver* observer,
int64_t process_intervals_ms)
: … { … }
void MaxCounter::Add(int sample) { … }
bool MaxCounter::GetMetric(int* metric) const { … }
int MaxCounter::GetValueForEmptyInterval() const { … }
PercentCounter::PercentCounter(Clock* clock, StatsCounterObserver* observer)
: … { … }
void PercentCounter::Add(bool sample) { … }
bool PercentCounter::GetMetric(int* metric) const { … }
int PercentCounter::GetValueForEmptyInterval() const { … }
PermilleCounter::PermilleCounter(Clock* clock, StatsCounterObserver* observer)
: … { … }
void PermilleCounter::Add(bool sample) { … }
bool PermilleCounter::GetMetric(int* metric) const { … }
int PermilleCounter::GetValueForEmptyInterval() const { … }
RateCounter::RateCounter(Clock* clock,
StatsCounterObserver* observer,
bool include_empty_intervals)
: … { … }
void RateCounter::Add(int sample) { … }
bool RateCounter::GetMetric(int* metric) const { … }
int RateCounter::GetValueForEmptyInterval() const { … }
RateAccCounter::RateAccCounter(Clock* clock,
StatsCounterObserver* observer,
bool include_empty_intervals)
: … { … }
void RateAccCounter::Set(int64_t sample, uint32_t stream_id) { … }
void RateAccCounter::SetLast(int64_t sample, uint32_t stream_id) { … }
bool RateAccCounter::GetMetric(int* metric) const { … }
int RateAccCounter::GetValueForEmptyInterval() const { … }
}