blob: d7702cdd42ad936079794bfce3ed49538648a836 [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";
option optimize_for = LITE_RUNTIME;
package android.os.statsd;
option java_package = "com.android.internal.os";
option java_outer_classname = "StatsdConfigProto";
message KeyMatcher {
optional int32 key = 1;
optional bool as_package_name = 2 [ default = false ];
}
message KeyValueMatcher {
optional KeyMatcher key_matcher = 1;
oneof value_matcher {
bool eq_bool = 2;
string eq_string = 3;
int32 eq_int = 4;
int64 lt_int = 5;
int64 gt_int = 6;
float lt_float = 7;
float gt_float = 8;
int64 lte_int = 9;
int64 gte_int = 10;
}
}
enum LogicalOperation {
AND = 1;
OR = 2;
NOT = 3;
NAND = 4;
NOR = 5;
}
message SimpleLogEntryMatcher {
repeated int32 tag = 1;
repeated KeyValueMatcher key_value_matcher = 2;
}
message LogEntryMatcher {
optional string name = 1;
message Combination {
optional LogicalOperation operation = 1;
repeated string matcher = 2;
}
oneof contents {
SimpleLogEntryMatcher simple_log_entry_matcher = 2;
Combination combination = 3;
}
}
message SimpleCondition {
optional string start = 1;
optional string stop = 2;
optional bool count_nesting = 3 [default = true];
optional string stop_all = 4;
}
message Condition {
optional string name = 1;
message Combination {
optional LogicalOperation operation = 1;
repeated string condition = 2;
}
oneof contents {
SimpleCondition simple_condition = 2;
Combination combination = 3;
}
}
message Bucket {
optional int64 bucket_size_millis = 1;
}
message EventMetric {
optional int64 metric_id = 1;
optional string what = 2;
optional string condition = 3;
}
message CountMetric {
optional int64 metric_id = 1;
optional string what = 2;
optional string condition = 3;
repeated KeyMatcher dimension = 4;
optional Bucket bucket = 5;
}
message DurationMetric {
optional int64 metric_id = 1;
enum AggregationType {
DURATION_SUM = 1;
DURATION_MAX_SPARSE = 2;
DURATION_MIN_SPARSE = 3;
}
optional AggregationType type = 2;
optional string predicate = 3;
repeated KeyMatcher dimension = 4;
optional Bucket bucket = 5;
}
message StatsdConfig {
optional int64 config_id = 1;
repeated EventMetric event_metric = 2;
repeated CountMetric count_metric = 3;
repeated LogEntryMatcher log_entry_matcher = 4;
repeated Condition condition = 5;
}