blob: 9842692780007e733a36fab91728de49c651961b [file] [log] [blame]
Brandon Kimdab96f12021-02-18 11:21:37 -08001// 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 Chen03eba282021-02-11 11:35:56 -080015syntax = "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 {
Michael Shenb63d6312021-04-26 13:30:57 +080026 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 Chen03eba282021-02-11 11:35:56 -080033}
34
35message BmcDiskSpaceMetric {
36 int32 rwfs_kib_available = 1; // Free space in RWFS in KiB
37}
38
39// The following messages use string tables to save space
40message BmcProcStatMetric {
41 message BmcProcStat {
42 int32 sidx_cmdline = 1; // complete command line
43 float utime = 2; // Time (seconds) in user mode
44 float stime = 3; // Time (seconds) in kernel mode
45 }
46 repeated BmcProcStat stats = 10;
47}
48
49message BmcFdStatMetric {
50 message BmcFdStat {
51 int32 sidx_cmdline = 1; // complete command line
52 int32 fd_count = 2; // count of open FD's
53 }
54 repeated BmcFdStat stats = 10;
55}
56
57message BmcStringTable {
58 message StringEntry {
59 string value = 1;
60 }
61 repeated StringEntry entries = 10;
62}
63
64message BmcMetricSnapshot {
65 BmcStringTable string_table = 1;
66 BmcMemoryMetric memory_metric = 2;
67 BmcUptimeMetric uptime_metric = 3;
68 BmcDiskSpaceMetric storage_space_metric = 4;
69 BmcProcStatMetric procstat_metric = 5;
70 BmcFdStatMetric fdstat_metric = 6;
71}