1/* 2 * Copyright (C) 2022 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 carwatchdog; 20 21// Represents a whole or partial calendar date, such as a birthday. The time of 22// day and time zone are either specified elsewhere or are insignificant. The 23// date is relative to the Gregorian Calendar. This can represent one of the 24// following: 25// 26// * A full date, with non-zero year, month, and day values 27// * A month and day value, with a zero year, such as an anniversary 28// * A year on its own, with zero month and day values 29// * A year and month value, with a zero day, such as a credit card expiration 30// date 31// 32// Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and 33// `google.protobuf.Timestamp`. 34// 35// Copied from: 36// https://github.com/googleapis/googleapis/blob/master/google/type/date.proto 37message Date { 38 // Year of the date. Must be from 1 to 9999, or 0 to specify a date without 39 // a year. 40 optional int32 year = 1; 41 42 // Month of a year. Must be from 1 to 12, or 0 to specify a year without a 43 // month and day. 44 optional int32 month = 2; 45 46 // Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 47 // to specify a year by itself or a year and month where the day isn't 48 // significant. 49 optional int32 day = 3; 50} 51 52// Represents a time of day. The date and time zone are either not significant 53// or are specified elsewhere. An API may choose to allow leap seconds. Related 54// types are [google.type.Date][google.type.Date] and 55// `google.protobuf.Timestamp`. 56// 57// Copied from: 58// https://github.com/googleapis/googleapis/blob/master/google/type/timeofday.proto 59message TimeOfDay { 60 // Hours of day in 24 hour format. Should be from 0 to 23. An API may choose 61 // to allow the value "24:00:00" for scenarios like business closing time. 62 optional int32 hours = 1; 63 64 // Minutes of hour of day. Must be from 0 to 59. 65 optional int32 minutes = 2; 66 67 // Seconds of minutes of the time. Must normally be from 0 to 59. An API may 68 // allow the value 60 if it allows leap-seconds. 69 optional int32 seconds = 3; 70 71 // Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. 72 optional int32 nanos = 4; 73} 74 75message ProcessCpuStats { 76 optional string command = 1; 77 optional int32 cpu_time_ms = 2; 78 optional float package_cpu_time_percent = 3; 79 optional int64 cpu_cycles = 4; 80} 81 82message PackageCpuStats { 83 optional int32 user_id = 1; 84 optional string package_name = 2; 85 optional int32 cpu_time_ms = 3; 86 optional float total_cpu_time_percent = 4; 87 optional int64 cpu_cycles = 5; 88 repeated ProcessCpuStats process_cpu_stats = 6; 89} 90 91message StatsCollection { 92 optional int32 id = 1; 93 optional Date date = 2; 94 optional TimeOfDay time = 3; 95 optional int32 total_cpu_time_ms = 4; 96 optional int32 idle_cpu_time_ms = 5; 97 optional int32 io_wait_time_ms = 6; 98 optional int64 context_switches = 7; 99 optional int32 io_blocked_processes = 8; 100 repeated PackageCpuStats package_cpu_stats = 9; 101} 102 103message SystemEventStats { 104 repeated StatsCollection collections = 1; 105} 106 107message PerformanceStats { 108 optional SystemEventStats boot_time_stats = 1; 109 repeated SystemEventStats user_switch_stats = 2; 110 optional SystemEventStats custom_collection_stats = 3; 111} 112