blob: 272e90be662da6eb9395f7e34e546f16d5ce593c [file] [log] [blame]
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
syntax = "proto2";
package android.os.statsd;
option java_package = "com.android.os";
option java_outer_classname = "StatsLog";
import "frameworks/base/cmds/statsd/src/atoms.proto";
import "frameworks/base/cmds/statsd/src/stats_log_common.proto";
message DimensionsValue {
optional int32 field = 1;
oneof value {
string value_str = 2;
int32 value_int = 3;
int64 value_long = 4;
bool value_bool = 5;
float value_float = 6;
DimensionsValueTuple value_tuple = 7;
}
}
message DimensionsValueTuple {
repeated DimensionsValue dimensions_value = 1;
}
message EventMetricData {
optional int64 elapsed_timestamp_nanos = 1;
optional Atom atom = 2;
optional int64 wall_clock_timestamp_sec = 3;
}
message CountBucketInfo {
optional int64 start_bucket_elapsed_nanos = 1;
optional int64 end_bucket_elapsed_nanos = 2;
optional int64 count = 3;
}
message CountMetricData {
optional DimensionsValue dimensions_in_what = 1;
optional DimensionsValue dimensions_in_condition = 2;
repeated CountBucketInfo bucket_info = 3;
}
message DurationBucketInfo {
optional int64 start_bucket_elapsed_nanos = 1;
optional int64 end_bucket_elapsed_nanos = 2;
optional int64 duration_nanos = 3;
}
message DurationMetricData {
optional DimensionsValue dimensions_in_what = 1;
optional DimensionsValue dimensions_in_condition = 2;
repeated DurationBucketInfo bucket_info = 3;
}
message ValueBucketInfo {
optional int64 start_bucket_elapsed_nanos = 1;
optional int64 end_bucket_elapsed_nanos = 2;
optional int64 value = 3;
}
message ValueMetricData {
optional DimensionsValue dimensions_in_what = 1;
optional DimensionsValue dimensions_in_condition = 2;
repeated ValueBucketInfo bucket_info = 3;
}
message GaugeBucketInfo {
optional int64 start_bucket_nanos = 1;
optional int64 end_bucket_nanos = 2;
repeated Atom atom = 3;
repeated int64 elapsed_timestamp_nanos = 4;
}
message GaugeMetricData {
optional DimensionsValue dimensions_in_what = 1;
optional DimensionsValue dimensions_in_condition = 2;
repeated GaugeBucketInfo bucket_info = 3;
}
message StatsLogReport {
optional int64 metric_id = 1;
// Fields 2 and 3 are reserved.
message EventMetricDataWrapper {
repeated EventMetricData data = 1;
}
message CountMetricDataWrapper {
repeated CountMetricData data = 1;
}
message DurationMetricDataWrapper {
repeated DurationMetricData data = 1;
}
message ValueMetricDataWrapper {
repeated ValueMetricData data = 1;
}
message GaugeMetricDataWrapper {
repeated GaugeMetricData data = 1;
}
oneof data {
EventMetricDataWrapper event_metrics = 4;
CountMetricDataWrapper count_metrics = 5;
DurationMetricDataWrapper duration_metrics = 6;
ValueMetricDataWrapper value_metrics = 7;
GaugeMetricDataWrapper gauge_metrics = 8;
}
}
message ConfigMetricsReport {
repeated StatsLogReport metrics = 1;
optional UidMapping uid_map = 2;
optional int64 last_report_elapsed_nanos = 3;
optional int64 current_report_elapsed_nanos = 4;
}
message ConfigMetricsReportList {
message ConfigKey {
optional int32 uid = 1;
optional int64 id = 2;
}
optional ConfigKey config_key = 1;
repeated ConfigMetricsReport reports = 2;
}