11285115cSWilliam A. Kennington III// Copyright 2021 Google LLC
21285115cSWilliam A. Kennington III//
31285115cSWilliam A. Kennington III// Licensed under the Apache License, Version 2.0 (the "License");
41285115cSWilliam A. Kennington III// you may not use this file except in compliance with the License.
51285115cSWilliam A. Kennington III// You may obtain a copy of the License at
61285115cSWilliam A. Kennington III//
71285115cSWilliam A. Kennington III//      http://www.apache.org/licenses/LICENSE-2.0
81285115cSWilliam A. Kennington III//
91285115cSWilliam A. Kennington III// Unless required by applicable law or agreed to in writing, software
101285115cSWilliam A. Kennington III// distributed under the License is distributed on an "AS IS" BASIS,
111285115cSWilliam A. Kennington III// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
121285115cSWilliam A. Kennington III// See the License for the specific language governing permissions and
131285115cSWilliam A. Kennington III// limitations under the License.
141285115cSWilliam A. Kennington III
151285115cSWilliam A. Kennington IIIsyntax = "proto3";
161285115cSWilliam A. Kennington III
171285115cSWilliam A. Kennington IIIpackage bmcmetrics.metricproto;
181285115cSWilliam A. Kennington III
191285115cSWilliam A. Kennington IIImessage BmcMemoryMetric {
201285115cSWilliam A. Kennington III  int32 mem_available = 1;
211285115cSWilliam A. Kennington III  int32 slab = 2;
221285115cSWilliam A. Kennington III  int32 kernel_stack = 3;
231285115cSWilliam A. Kennington III}
241285115cSWilliam A. Kennington III
251285115cSWilliam A. Kennington IIImessage BmcUptimeMetric {
261285115cSWilliam A. Kennington III  float uptime = 1;                   // Uptime (wall clock time)
271285115cSWilliam A. Kennington III  float idle_process_time = 2;        // Idle process time across all cores
28b63d6314SMichael Shen  float firmware_boot_time_sec = 3;   // Time (seconds) elapsed in firmware process
29b63d6314SMichael Shen  float loader_boot_time_sec = 4;     // Time (seconds) elapsed in loader process
30b63d6314SMichael Shen  float kernel_boot_time_sec = 5;     // Time (seconds) elapsed in kernel process
31b63d6314SMichael Shen  float initrd_boot_time_sec = 6;     // Time (seconds) elapsed in initrd process
32b63d6314SMichael Shen  float userspace_boot_time_sec = 7;  // Time (seconds) elapsed in userspace process
331285115cSWilliam A. Kennington III}
341285115cSWilliam A. Kennington III
351285115cSWilliam A. Kennington IIImessage BmcDiskSpaceMetric {
361285115cSWilliam A. Kennington III  int32 rwfs_kib_available = 1;  // Free space in RWFS in KiB
371285115cSWilliam A. Kennington III}
381285115cSWilliam A. Kennington III
391285115cSWilliam A. Kennington III// The following messages use string tables to save space
401285115cSWilliam A. Kennington IIImessage BmcProcStatMetric {
411285115cSWilliam A. Kennington III  message BmcProcStat {
421285115cSWilliam A. Kennington III    int32 sidx_cmdline = 1;  // complete command line
431285115cSWilliam A. Kennington III    float utime = 2;         // Time (seconds) in user mode
441285115cSWilliam A. Kennington III    float stime = 3;         // Time (seconds) in kernel mode
451285115cSWilliam A. Kennington III  }
461285115cSWilliam A. Kennington III  repeated BmcProcStat stats = 10;
471285115cSWilliam A. Kennington III}
481285115cSWilliam A. Kennington III
491285115cSWilliam A. Kennington IIImessage BmcFdStatMetric {
501285115cSWilliam A. Kennington III  message BmcFdStat {
511285115cSWilliam A. Kennington III    int32 sidx_cmdline = 1;  // complete command line
521285115cSWilliam A. Kennington III    int32 fd_count = 2;      // count of open FD's
531285115cSWilliam A. Kennington III  }
541285115cSWilliam A. Kennington III  repeated BmcFdStat stats = 10;
551285115cSWilliam A. Kennington III}
561285115cSWilliam A. Kennington III
571285115cSWilliam A. Kennington IIImessage BmcStringTable {
581285115cSWilliam A. Kennington III  message StringEntry {
591285115cSWilliam A. Kennington III    string value = 1;
601285115cSWilliam A. Kennington III  }
611285115cSWilliam A. Kennington III  repeated StringEntry entries = 10;
621285115cSWilliam A. Kennington III}
631285115cSWilliam A. Kennington III
64*4dba220dSWilly Tumessage BmcECCMetric {
65*4dba220dSWilly Tu  int32 correctable_error_count = 1;
66*4dba220dSWilly Tu  int32 uncorrectable_error_count = 2;
67*4dba220dSWilly Tu}
68*4dba220dSWilly Tu
691285115cSWilliam A. Kennington IIImessage BmcMetricSnapshot {
701285115cSWilliam A. Kennington III  BmcStringTable string_table = 1;
711285115cSWilliam A. Kennington III  BmcMemoryMetric memory_metric = 2;
721285115cSWilliam A. Kennington III  BmcUptimeMetric uptime_metric = 3;
731285115cSWilliam A. Kennington III  BmcDiskSpaceMetric storage_space_metric = 4;
741285115cSWilliam A. Kennington III  BmcProcStatMetric procstat_metric = 5;
751285115cSWilliam A. Kennington III  BmcFdStatMetric fdstat_metric = 6;
76*4dba220dSWilly Tu  reserved 7;
77*4dba220dSWilly Tu  reserved 8;
78*4dba220dSWilly Tu  BmcECCMetric ecc_metric = 9;
791285115cSWilliam A. Kennington III}
80