This source file includes following definitions.
- RecordCurrentHistograms
- RecordCurrentStabilityHistograms
- RecordDelta
- InconsistencyDetected
- UniqueInconsistencyDetected
- InconsistencyDetectedInLoggedCount
#include "chrome/common/metrics/metrics_service_base.h"
#include <cstdlib>
#include "chrome/common/metrics/metrics_log_base.h"
using base::Histogram;
MetricsServiceBase::MetricsServiceBase()
: histogram_snapshot_manager_(this) {
}
MetricsServiceBase::~MetricsServiceBase() {
}
const char MetricsServiceBase::kServerUrl[] =
"https://clients4.google.com/uma/v2";
const char MetricsServiceBase::kMimeType[] = "application/vnd.chrome.uma";
void MetricsServiceBase::RecordCurrentHistograms() {
DCHECK(log_manager_.current_log());
histogram_snapshot_manager_.PrepareDeltas(
base::Histogram::kNoFlags, base::Histogram::kUmaTargetedHistogramFlag);
}
void MetricsServiceBase::RecordCurrentStabilityHistograms() {
DCHECK(log_manager_.current_log());
histogram_snapshot_manager_.PrepareDeltas(
base::Histogram::kNoFlags, base::Histogram::kUmaStabilityHistogramFlag);
}
void MetricsServiceBase::RecordDelta(
const base::HistogramBase& histogram,
const base::HistogramSamples& snapshot) {
log_manager_.current_log()->RecordHistogramDelta(histogram.histogram_name(),
snapshot);
}
void MetricsServiceBase::InconsistencyDetected(
base::HistogramBase::Inconsistency problem) {
UMA_HISTOGRAM_ENUMERATION("Histogram.InconsistenciesBrowser",
problem, base::HistogramBase::NEVER_EXCEEDED_VALUE);
}
void MetricsServiceBase::UniqueInconsistencyDetected(
base::HistogramBase::Inconsistency problem) {
UMA_HISTOGRAM_ENUMERATION("Histogram.InconsistenciesBrowserUnique",
problem, base::HistogramBase::NEVER_EXCEEDED_VALUE);
}
void MetricsServiceBase::InconsistencyDetectedInLoggedCount(int amount) {
UMA_HISTOGRAM_COUNTS("Histogram.InconsistentSnapshotBrowser",
std::abs(amount));
}