1/*
2 * Copyright (C) 2023 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
18
19package android.os.statsd.expresslog;
20
21import "frameworks/proto_logging/stats/atoms.proto";
22import "frameworks/proto_logging/stats/atom_field_options.proto";
23
24option java_package = "com.android.os.expresslog";
25option java_multiple_files = true;
26
27extend Atom {
28    optional ExpressEventReported express_event_reported =
29            528 [(module) = "framework", (module) = "expresslog"];
30    optional ExpressHistogramSampleReported express_histogram_sample_reported =
31            593 [(module) = "framework", (module) = "expresslog"];
32    optional ExpressUidEventReported express_uid_event_reported =
33            644 [(module) = "framework", (module) = "expresslog"];
34    optional ExpressUidHistogramSampleReported express_uid_histogram_sample_reported =
35            658 [(module) = "framework", (module) = "expresslog"];
36}
37
38/*
39 * Logs by Express library.
40 */
41message ExpressEventReported {
42    optional int64 metric_id = 1;
43
44    // for counter metric it is an incremental amount
45    optional int64 value = 2;
46}
47
48/*
49 * Logs by Express library.
50 */
51message ExpressUidEventReported {
52    optional int64 metric_id = 1;
53
54    // for counter metric it is an incremental amount
55    optional int64 value = 2;
56
57    // will be used as uid dimension.
58    optional int32 uid = 3 [(is_uid) = true];
59}
60
61/*
62 * Logs by Express library.
63 */
64message ExpressHistogramSampleReported {
65    optional int64 metric_id = 1;
66
67    // will be used as a samples count increment value per bin
68    optional int64 count = 2;
69
70    // will be used as a dimension to represent the bin index
71    // dim[0] .. dim[bins_count - 1] - valid samples count bins
72    // 2 extra bins reserved to represent underflow/overflow
73    // dim[bins_count] - could be considered as an underflow bin
74    // dim[bins_count + 1] - could be considered as an overflow bin
75    optional int32 bin_index = 3;
76}
77
78/*
79 * Logs by Express library.
80 */
81 message ExpressUidHistogramSampleReported {
82    optional int64 metric_id = 1;
83
84    // will be used as a samples count increment value per bin
85    optional int64 count = 2;
86
87    // will be used as a dimension to represent the bin index
88    // dim[0] .. dim[bins_count - 1] - valid samples count bins
89    // 2 extra bins reserved to represent underflow/overflow
90    // dim[bins_count] - could be considered as an underflow bin
91    // dim[bins_count + 1] - could be considered as an overflow bin
92    optional int32 bin_index = 3;
93
94    // will be used as uid dimension.
95    optional int32 uid = 4 [(is_uid) = true];
96}
97