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 15syntax = "proto3"; 16 17package bmcmetrics.metricproto; 18 19message BmcMemoryMetric { 20 int32 mem_available = 1; 21 int32 slab = 2; 22 int32 kernel_stack = 3; 23} 24 25message BmcUptimeMetric { 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 33} 34 35message BmcDiskSpaceMetric { 36 int32 rwfs_kib_available = 1; // Free space in RWFS in KiB 37 int32 tmpfs_kib_available = 2; // Free space in TMPFS in KiB 38} 39 40// The following messages use string tables to save space 41message 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 50message 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 58message BmcStringTable { 59 message StringEntry { 60 string value = 1; 61 } 62 repeated StringEntry entries = 10; 63} 64 65message BmcECCMetric { 66 int32 correctable_error_count = 1; 67 int32 uncorrectable_error_count = 2; 68} 69 70message 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; 77 reserved 7; 78 reserved 8; 79 BmcECCMetric ecc_metric = 9; 80} 81