/*
 * Copyright (C) 2024 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 perfetto.protos;

message AndroidOomAdjusterMetric {
  message OomAdjusterTransitionCounts {
    // name of the item aggregated by. example: process_name,
    // oom_adjuster_reason.
    optional string name = 1;
    // name of previous oom bucket.
    optional string src_bucket = 2;
    // name of oom bucket.
    optional string dest_bucket = 3;
    // count of transitions
    optional int64 count = 4;
  }
  message OomAdjBucketDurationAggregation {
    // name of the item aggregated by. example: process_name,
    // oom_adjuster_reason
    optional string name = 1;
    // name of oom bucket.
    optional string bucket = 2;
    // Duration of the time in the bucket
    optional int64 total_dur = 3;
  }
  message OomAdjDurationAggregation {
    optional int64 min_oom_adj_dur = 1;
    optional int64 max_oom_adj_dur = 2;
    optional double avg_oom_adj_dur = 3;
    optional int64 oom_adj_event_count = 4;
    optional string oom_adj_reason = 5;
  }
  repeated OomAdjusterTransitionCounts oom_adjuster_transition_counts_global =
      1;
  repeated OomAdjusterTransitionCounts
      oom_adjuster_transition_counts_by_process = 2;
  repeated OomAdjusterTransitionCounts
      oom_adjuster_transition_counts_by_oom_adj_reason = 3;
  repeated OomAdjBucketDurationAggregation oom_adj_bucket_duration_agg_global =
      4;
  repeated OomAdjBucketDurationAggregation
      oom_adj_bucket_duration_agg_by_process = 5;
  repeated OomAdjDurationAggregation oom_adj_duration_agg = 6;
}