chromium/cc/metrics/latency_ukm_reporter.cc

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "cc/metrics/latency_ukm_reporter.h"

#include <climits>
#include <memory>
#include <utility>

#include "base/rand_util.h"
#include "cc/metrics/ukm_manager.h"
#include "services/metrics/public/cpp/ukm_recorder.h"

namespace cc {

// We use a Poisson process with an exponential decay multiplier. The goal is to
// get many randomly distributed samples early during page load and initial
// interaction, then samples at an exponentially decreasing rate to effectively
// cap the number of samples. The particular parameters chosen here give roughly
// 5-10 samples in the first 100 frames, decaying to several hours between
// samples by the 40th sample. The multiplier value should be tuned to achieve a
// total sample count that avoids throttling by the UKM system.
class LatencyUkmReporter::SamplingController {};

LatencyUkmReporter::LatencyUkmReporter()
    :{}

LatencyUkmReporter::~LatencyUkmReporter() = default;

void LatencyUkmReporter::ReportCompositorLatencyUkm(
    const CompositorFrameReporter::FrameReportTypes& report_types,
    const std::vector<CompositorFrameReporter::StageData>& stage_history,
    const ActiveTrackers& active_trackers,
    const CompositorFrameReporter::ProcessedBlinkBreakdown&
        processed_blink_breakdown,
    const CompositorFrameReporter::ProcessedVizBreakdown&
        processed_viz_breakdown) {}

void LatencyUkmReporter::ReportEventLatencyUkm(
    const EventMetrics::List& events_metrics,
    const std::vector<CompositorFrameReporter::StageData>& stage_history,
    const CompositorFrameReporter::ProcessedBlinkBreakdown&
        processed_blink_breakdown,
    const CompositorFrameReporter::ProcessedVizBreakdown&
        processed_viz_breakdown) {}

void LatencyUkmReporter::InitializeUkmManager(
    std::unique_ptr<ukm::UkmRecorder> recorder) {}

void LatencyUkmReporter::SetSourceId(ukm::SourceId source_id) {}

}  // namespace cc