// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
syntax = "proto3";
package org.chromium.android_webview.proto;
option optimize_for = LITE_RUNTIME; // TODO(crbug.com/40557343): Remove this after proto 4.0
option java_package = "org.chromium.android_webview.proto";
// WebView uses HistogramRecord to serialize a histogram record that
// MetricsBridgeService receives to a file and retrieve it back. These
// histogram records are recorded in non-embedded WebView processes.
//
// Next tag: 9
message HistogramRecord {
// Next tag: 5
enum RecordType {
HISTOGRAM_BOOLEAN = 0;
HISTOGRAM_EXPONENTIAL = 1;
HISTOGRAM_LINEAR = 2;
HISTOGRAM_SPARSE = 3;
USER_ACTION = 4;
}
RecordType record_type = 1;
// The name of the histogram
string histogram_name = 2;
// The sample to be recorded, for HISTOGRAM_BOOLEAN it's either 0 for false
// and 1 for true.
int32 sample = 3;
// The following fields are only used by HISTOGRAM_EXPONENTIAL and
// HISTOGRAM_LINEAR See the docs for
// org.chromium.base.metrics.UmaRecorder#recordExponentialHistogram
// and recordLinearHistogram for more info on these fields.
// the smallest value recorded in the first bucket; should be greater than
// zero.
int32 min = 4;
// the smallest value recorded in the overflow bucket.
int32 max = 5;
// number of histogram buckets: Two buckets are used for underflow and
// overflow, and the remaining buckets cover the range [min, max);
// numBuckets should be 100 or less.
int32 num_buckets = 6;
// Metadata for the histogram record.
// Next tag: 2
message Metadata {
// The time in millis when the histogram is received by the
// AwNonEmbeddedUmaRecorder
int64 time_recorded = 1;
}
Metadata metadata = 7;
// Used for |record_type| == USER_ACTION only.
int64 elapsed_realtime_millis = 8;
}