open-nomad/plugins/shared/structs/proto/stats.proto
Mahmood Ali 713c9fe683 Move Stat{Object|Value} to plugins/shared/structs
Moving them as they may be useful for other packages/plugins besides
devices.
2018-11-14 09:01:26 -05:00

43 lines
1.4 KiB
Protocol Buffer

syntax = "proto3";
package hashicorp.nomad.plugins.shared.structs;
option go_package = "proto";
// StatObject is a collection of statistics either exposed at the top
// level or via nested StatObjects.
message StatObject {
// nested is a mapping of object name to a nested stats object.
map<string, StatObject> nested = 1;
// attributes is a mapping of statistic name to its value.
map<string, StatValue> attributes = 2;
}
// StatValue exposes the values of a particular statistic. The value may
// be of type double, integer, string or boolean. Numeric types can be
// exposed as a single value or as a fraction.
message StatValue {
// float_numerator_val exposes a floating point value. If denominator
// is set it is assumed to be a fractional value, otherwise it is a
// scalar.
double float_numerator_val = 1;
double float_denominator_val = 2;
// int_numerator_val exposes a int value. If denominator
// is set it is assumed to be a fractional value, otherwise it is a
// scalar.
int64 int_numerator_val = 3;
int64 int_denominator_val = 4;
// string_val exposes a string value. These are likely annotations.
string string_val = 5;
// bool_val exposes a boolean statistic.
bool bool_val = 6;
// unit gives the unit type: °F, %, MHz, MB, etc.
string unit = 7;
// desc provides a human readable description of the statistic.
string desc = 8;
}