chromium/third_party/metrics_proto/ukm/aggregate.proto

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

syntax = "proto2";

option optimize_for = LITE_RUNTIME;
option java_package = "org.chromium.components.metrics";

package ukm;

// Next tag: 10
message Aggregate {
  // The id of the Source this Event is associated with. If this is zero
  // then it's an aggregate across all sources.
  optional int64 source_id = 1;

  // Type of the Event. This is a hash of the name (as a string).
  optional fixed64 event_hash = 2;

  // The total number of times this source/event was observed.
  optional uint64 total_count = 3;

  // The total number of times this source/event was dropped due to limits.
  optional uint64 dropped_due_to_limits = 4;

  // The total number of times this source/event was dropped due to sampling.
  optional uint64 dropped_due_to_sampling = 5;

  // The total number of times this source/event was dropped due to filter.
  // Unlike the others, records dropped for this reason are not included
  // in the |total_count|.
  // https://source.chromium.org/chromium/chromium/src/+/main:components/ukm/ukm_entry_filter.h
  optional uint64 dropped_due_to_filter = 8;

  // The total number of times this source/event was dropped due to there
  // being no configuration of UKM via Finch. Until a full configuration is
  // delivered by Finch to the client, UKM is disabled but some basic
  // information is still collected and counted here.
  optional uint64 dropped_due_to_unconfigured = 9;

  // For each Event, we have a list of possible metrics included. Metric names
  // cannot be repeated. There is no guarantee that all metrics that are
  // possible for a given event will be included in a single Aggregate.
  message Metric {
    // The hash of the metric's name.
    optional fixed64 metric_hash = 1;

    // The sum of all the values seen for this metric.
    optional double value_sum = 2;

    // The sum of all the squared-values seen for this metric.
    optional double value_square_sum = 3;

    // Overrides of values given above if different for this specific metric.
    optional uint64 total_count = 4;
    optional uint64 dropped_due_to_limits = 5;
    optional uint64 dropped_due_to_sampling = 6;
    optional uint64 dropped_due_to_filter = 8;
    optional uint64 dropped_due_to_unconfigured = 9;
  }
  repeated Metric metrics = 6;
}