/*
 * 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 android.os.statsd.performance;

import "frameworks/proto_logging/stats/atoms.proto";
import "frameworks/proto_logging/stats/atom_field_options.proto";
import "frameworks/proto_logging/stats/enums/performance/enums.proto";

option java_package = "com.android.os.performance";

extend Atom {
    optional PressureStallInformation pressure_stall_information = 10229 [(module) = "framework"];
}

// Pressure stall information for a given resource.
// See https://docs.kernel.org/accounting/psi.html
message PressureStallInformation {
    // The resource that is being monitored for pressure stall information.
    optional android.performance.PsiResource psi_resource = 1;

    // The average percent of time in the last N seconds that some tasks were
    // stalled on the particular resource. Expressed as x.xx%.
    optional float some_avg_10s_pct = 2;
    optional float some_avg_60s_pct = 3;
    optional float some_avg_300s_pct = 4;
    // The total number of microseconds that some tasks were
    // stalled on the particular resource.
    optional int64 some_total_usec = 5;

    // The average percent of time in the last N seconds that all tasks were
    // stalled on the particular resource. Expressed as x.xx%.
    optional float full_avg_10s_pct = 6;
    optional float full_avg_60s_pct = 7;
    optional float full_avg_300s_pct = 8;
    // The total number of microseconds that all tasks were
    // stalled on the particular resource.
    optional int64 full_total_usec = 9;
}
