xref: /aosp_15_r20/external/autotest/utils/frozen_chromite/third_party/infra_libs/ts_mon/protos/metrics.proto (revision 9c5db1993ded3edbeafc8092d69fe5de2ee02df7)
1// Copyright 2016 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4syntax = "proto2";
5
6package ts_mon.proto;
7
8import "any.proto";
9import "timestamp.proto";
10import "acquisition_network_device.proto";
11import "acquisition_task.proto";
12
13message MetricsPayload {
14  repeated MetricsCollection metrics_collection = 1;
15}
16
17message MetricsCollection {
18  repeated MetricsDataSet metrics_data_set = 1;
19  oneof target_schema {
20    NetworkDevice network_device = 11;
21    Task task = 12;
22  }
23}
24
25message MetricsDataSet {
26  optional string metric_name = 1;
27  repeated MetricFieldDescriptor field_descriptor = 2;
28  optional StreamKind stream_kind = 3;
29  optional ValueType value_type = 4;
30  optional string description = 5;
31  optional Annotations annotations = 6;
32  repeated MetricsData data = 7;
33  message MetricFieldDescriptor {
34    optional string name = 1;
35
36    optional FieldType field_type = 2;
37    enum FieldType {
38      STRING = 0;
39      INT64 = 1;
40      BOOL = 2;
41    }
42  }
43}
44
45message MetricsData {
46  oneof value {
47    bool bool_value = 1;
48    string string_value = 2;
49    int64 int64_value = 3;
50    double double_value = 4;
51    Distribution distribution_value = 5;
52  }
53
54  repeated MetricField field = 6;
55  message MetricField {
56    optional string name = 1;
57
58    oneof value {
59      string string_value = 2;
60      int64 int64_value = 3;
61      bool bool_value = 4;
62    }
63  }
64
65  optional Timestamp start_timestamp = 7;
66  optional Timestamp end_timestamp = 8;
67
68  message Distribution {
69    optional int64 count = 1;
70    optional double mean = 2;
71    optional double sum_of_squared_deviation = 3;
72    optional double minimum = 4;
73    optional double maximum = 5;
74
75    oneof bucket_options {
76      LinearOptions linear_buckets = 6;
77      ExponentialOptions exponential_buckets = 7;
78      ExplicitOptions explicit_buckets = 8;
79    }
80
81    message LinearOptions {
82      optional int32 num_finite_buckets = 1;
83      optional double width = 2;
84      optional double offset = 3;
85    }
86
87    message ExponentialOptions {
88      optional int32 num_finite_buckets = 1;
89      optional double growth_factor = 2;
90      optional double scale = 3;
91    }
92
93    message ExplicitOptions {
94      repeated double bound = 1 [packed = true];
95    }
96
97    repeated int64 bucket_count = 9 [packed = true];
98
99    repeated Exemplar exemplar = 10;
100
101    message Exemplar {
102      optional double value = 1;
103      optional Timestamp timestamp = 2;
104      repeated Any attachment = 3;
105    }
106  }
107}
108
109message Annotations {
110  optional string unit = 1;
111  optional bool timestamp = 2;
112  optional string deprecation = 3;
113  repeated Any annotation = 4;
114}
115
116enum StreamKind {
117  GAUGE = 0;
118  CUMULATIVE = 1;
119  DELTA = 2;
120}
121
122enum ValueType {
123  BOOL = 0;
124  STRING = 1;
125  INT64 = 2;
126  DOUBLE = 3;
127  DISTRIBUTION = 4;
128}
129