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}
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 BmcECCMetric {
65  int32 correctable_error_count = 1;
66  int32 uncorrectable_error_count = 2;
67}
68
69message BmcMetricSnapshot {
70  BmcStringTable string_table = 1;
71  BmcMemoryMetric memory_metric = 2;
72  BmcUptimeMetric uptime_metric = 3;
73  BmcDiskSpaceMetric storage_space_metric = 4;
74  BmcProcStatMetric procstat_metric = 5;
75  BmcFdStatMetric fdstat_metric = 6;
76  reserved 7;
77  reserved 8;
78  BmcECCMetric ecc_metric = 9;
79}
80