| Brandon Kim | dab96f1 | 2021-02-18 11:21:37 -0800 | [diff] [blame] | 1 | // Copyright 2021 Google LLC | 
|  | 2 | // | 
|  | 3 | // Licensed under the Apache License, Version 2.0 (the "License"); | 
|  | 4 | // you may not use this file except in compliance with the License. | 
|  | 5 | // You may obtain a copy of the License at | 
|  | 6 | // | 
|  | 7 | //      http://www.apache.org/licenses/LICENSE-2.0 | 
|  | 8 | // | 
|  | 9 | // Unless required by applicable law or agreed to in writing, software | 
|  | 10 | // distributed under the License is distributed on an "AS IS" BASIS, | 
|  | 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
|  | 12 | // See the License for the specific language governing permissions and | 
|  | 13 | // limitations under the License. | 
|  | 14 |  | 
| Sui Chen | 03eba28 | 2021-02-11 11:35:56 -0800 | [diff] [blame] | 15 | syntax = "proto3"; | 
|  | 16 |  | 
|  | 17 | package bmcmetrics.metricproto; | 
|  | 18 |  | 
|  | 19 | message BmcMemoryMetric { | 
|  | 20 | int32 mem_available = 1; | 
|  | 21 | int32 slab = 2; | 
|  | 22 | int32 kernel_stack = 3; | 
|  | 23 | } | 
|  | 24 |  | 
|  | 25 | message BmcUptimeMetric { | 
| Michael Shen | b63d631 | 2021-04-26 13:30:57 +0800 | [diff] [blame] | 26 | float uptime = 1;                   // Uptime (wall clock time) | 
|  | 27 | float idle_process_time = 2;        // Idle process time across all cores | 
|  | 28 | float firmware_boot_time_sec = 3;   // Time (seconds) elapsed in firmware process | 
|  | 29 | float loader_boot_time_sec = 4;     // Time (seconds) elapsed in loader process | 
|  | 30 | float kernel_boot_time_sec = 5;     // Time (seconds) elapsed in kernel process | 
|  | 31 | float initrd_boot_time_sec = 6;     // Time (seconds) elapsed in initrd process | 
|  | 32 | float userspace_boot_time_sec = 7;  // Time (seconds) elapsed in userspace process | 
| Sui Chen | 03eba28 | 2021-02-11 11:35:56 -0800 | [diff] [blame] | 33 | } | 
|  | 34 |  | 
|  | 35 | message BmcDiskSpaceMetric { | 
|  | 36 | int32 rwfs_kib_available = 1;  // Free space in RWFS in KiB | 
| Abby | 119e792 | 2024-10-18 21:28:36 +0000 | [diff] [blame^] | 37 | int32 tmpfs_kib_available = 2;  // Free space in TMPFS in KiB | 
| Sui Chen | 03eba28 | 2021-02-11 11:35:56 -0800 | [diff] [blame] | 38 | } | 
|  | 39 |  | 
|  | 40 | // The following messages use string tables to save space | 
|  | 41 | message BmcProcStatMetric { | 
|  | 42 | message BmcProcStat { | 
|  | 43 | int32 sidx_cmdline = 1;  // complete command line | 
|  | 44 | float utime = 2;         // Time (seconds) in user mode | 
|  | 45 | float stime = 3;         // Time (seconds) in kernel mode | 
|  | 46 | } | 
|  | 47 | repeated BmcProcStat stats = 10; | 
|  | 48 | } | 
|  | 49 |  | 
|  | 50 | message BmcFdStatMetric { | 
|  | 51 | message BmcFdStat { | 
|  | 52 | int32 sidx_cmdline = 1;  // complete command line | 
|  | 53 | int32 fd_count = 2;      // count of open FD's | 
|  | 54 | } | 
|  | 55 | repeated BmcFdStat stats = 10; | 
|  | 56 | } | 
|  | 57 |  | 
|  | 58 | message BmcStringTable { | 
|  | 59 | message StringEntry { | 
|  | 60 | string value = 1; | 
|  | 61 | } | 
|  | 62 | repeated StringEntry entries = 10; | 
|  | 63 | } | 
|  | 64 |  | 
| Willy Tu | 4dba220 | 2024-04-08 21:27:20 +0000 | [diff] [blame] | 65 | message BmcECCMetric { | 
|  | 66 | int32 correctable_error_count = 1; | 
|  | 67 | int32 uncorrectable_error_count = 2; | 
|  | 68 | } | 
|  | 69 |  | 
| Sui Chen | 03eba28 | 2021-02-11 11:35:56 -0800 | [diff] [blame] | 70 | message BmcMetricSnapshot { | 
|  | 71 | BmcStringTable string_table = 1; | 
|  | 72 | BmcMemoryMetric memory_metric = 2; | 
|  | 73 | BmcUptimeMetric uptime_metric = 3; | 
|  | 74 | BmcDiskSpaceMetric storage_space_metric = 4; | 
|  | 75 | BmcProcStatMetric procstat_metric = 5; | 
|  | 76 | BmcFdStatMetric fdstat_metric = 6; | 
| Willy Tu | 4dba220 | 2024-04-08 21:27:20 +0000 | [diff] [blame] | 77 | reserved 7; | 
|  | 78 | reserved 8; | 
|  | 79 | BmcECCMetric ecc_metric = 9; | 
| Sui Chen | 03eba28 | 2021-02-11 11:35:56 -0800 | [diff] [blame] | 80 | } |