statistics protos

This commit is contained in:
Alex Dadgar 2018-08-23 11:18:35 -07:00
parent 6f1b5e2921
commit 1eb043a46c
2 changed files with 582 additions and 56 deletions

View File

@ -6,6 +6,7 @@ package proto
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import timestamp "github.com/golang/protobuf/ptypes/timestamp"
import (
context "golang.org/x/net/context"
@ -34,7 +35,7 @@ func (m *FingerprintRequest) Reset() { *m = FingerprintRequest{} }
func (m *FingerprintRequest) String() string { return proto.CompactTextString(m) }
func (*FingerprintRequest) ProtoMessage() {}
func (*FingerprintRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_device_7496b084f8b5ea81, []int{0}
return fileDescriptor_device_ebefe60214c28313, []int{0}
}
func (m *FingerprintRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_FingerprintRequest.Unmarshal(m, b)
@ -69,7 +70,7 @@ func (m *FingerprintResponse) Reset() { *m = FingerprintResponse{} }
func (m *FingerprintResponse) String() string { return proto.CompactTextString(m) }
func (*FingerprintResponse) ProtoMessage() {}
func (*FingerprintResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_device_7496b084f8b5ea81, []int{1}
return fileDescriptor_device_ebefe60214c28313, []int{1}
}
func (m *FingerprintResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_FingerprintResponse.Unmarshal(m, b)
@ -118,7 +119,7 @@ func (m *DeviceGroup) Reset() { *m = DeviceGroup{} }
func (m *DeviceGroup) String() string { return proto.CompactTextString(m) }
func (*DeviceGroup) ProtoMessage() {}
func (*DeviceGroup) Descriptor() ([]byte, []int) {
return fileDescriptor_device_7496b084f8b5ea81, []int{2}
return fileDescriptor_device_ebefe60214c28313, []int{2}
}
func (m *DeviceGroup) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DeviceGroup.Unmarshal(m, b)
@ -195,7 +196,7 @@ func (m *DetectedDevice) Reset() { *m = DetectedDevice{} }
func (m *DetectedDevice) String() string { return proto.CompactTextString(m) }
func (*DetectedDevice) ProtoMessage() {}
func (*DetectedDevice) Descriptor() ([]byte, []int) {
return fileDescriptor_device_7496b084f8b5ea81, []int{3}
return fileDescriptor_device_ebefe60214c28313, []int{3}
}
func (m *DetectedDevice) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DetectedDevice.Unmarshal(m, b)
@ -257,7 +258,7 @@ func (m *DeviceLocality) Reset() { *m = DeviceLocality{} }
func (m *DeviceLocality) String() string { return proto.CompactTextString(m) }
func (*DeviceLocality) ProtoMessage() {}
func (*DeviceLocality) Descriptor() ([]byte, []int) {
return fileDescriptor_device_7496b084f8b5ea81, []int{4}
return fileDescriptor_device_ebefe60214c28313, []int{4}
}
func (m *DeviceLocality) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DeviceLocality.Unmarshal(m, b)
@ -298,7 +299,7 @@ func (m *ReserveRequest) Reset() { *m = ReserveRequest{} }
func (m *ReserveRequest) String() string { return proto.CompactTextString(m) }
func (*ReserveRequest) ProtoMessage() {}
func (*ReserveRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_device_7496b084f8b5ea81, []int{5}
return fileDescriptor_device_ebefe60214c28313, []int{5}
}
func (m *ReserveRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ReserveRequest.Unmarshal(m, b)
@ -341,7 +342,7 @@ func (m *ReserveResponse) Reset() { *m = ReserveResponse{} }
func (m *ReserveResponse) String() string { return proto.CompactTextString(m) }
func (*ReserveResponse) ProtoMessage() {}
func (*ReserveResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_device_7496b084f8b5ea81, []int{6}
return fileDescriptor_device_ebefe60214c28313, []int{6}
}
func (m *ReserveResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ReserveResponse.Unmarshal(m, b)
@ -386,7 +387,7 @@ func (m *ContainerReservation) Reset() { *m = ContainerReservation{} }
func (m *ContainerReservation) String() string { return proto.CompactTextString(m) }
func (*ContainerReservation) ProtoMessage() {}
func (*ContainerReservation) Descriptor() ([]byte, []int) {
return fileDescriptor_device_7496b084f8b5ea81, []int{7}
return fileDescriptor_device_ebefe60214c28313, []int{7}
}
func (m *ContainerReservation) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ContainerReservation.Unmarshal(m, b)
@ -445,7 +446,7 @@ func (m *Mount) Reset() { *m = Mount{} }
func (m *Mount) String() string { return proto.CompactTextString(m) }
func (*Mount) ProtoMessage() {}
func (*Mount) Descriptor() ([]byte, []int) {
return fileDescriptor_device_7496b084f8b5ea81, []int{8}
return fileDescriptor_device_ebefe60214c28313, []int{8}
}
func (m *Mount) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Mount.Unmarshal(m, b)
@ -506,7 +507,7 @@ func (m *DeviceSpec) Reset() { *m = DeviceSpec{} }
func (m *DeviceSpec) String() string { return proto.CompactTextString(m) }
func (*DeviceSpec) ProtoMessage() {}
func (*DeviceSpec) Descriptor() ([]byte, []int) {
return fileDescriptor_device_7496b084f8b5ea81, []int{9}
return fileDescriptor_device_ebefe60214c28313, []int{9}
}
func (m *DeviceSpec) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DeviceSpec.Unmarshal(m, b)
@ -547,6 +548,358 @@ func (m *DeviceSpec) GetPermissions() string {
return ""
}
// StatsRequest is used to parameterize the retrieval of statistics.
type StatsRequest struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *StatsRequest) Reset() { *m = StatsRequest{} }
func (m *StatsRequest) String() string { return proto.CompactTextString(m) }
func (*StatsRequest) ProtoMessage() {}
func (*StatsRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_device_ebefe60214c28313, []int{10}
}
func (m *StatsRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_StatsRequest.Unmarshal(m, b)
}
func (m *StatsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_StatsRequest.Marshal(b, m, deterministic)
}
func (dst *StatsRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_StatsRequest.Merge(dst, src)
}
func (m *StatsRequest) XXX_Size() int {
return xxx_messageInfo_StatsRequest.Size(m)
}
func (m *StatsRequest) XXX_DiscardUnknown() {
xxx_messageInfo_StatsRequest.DiscardUnknown(m)
}
var xxx_messageInfo_StatsRequest proto.InternalMessageInfo
// StatsResponse returns the statistics for each device group.
type StatsResponse struct {
// groups contains statistics for each device group.
Groups []*DeviceGroupStats `protobuf:"bytes,1,rep,name=groups,proto3" json:"groups,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *StatsResponse) Reset() { *m = StatsResponse{} }
func (m *StatsResponse) String() string { return proto.CompactTextString(m) }
func (*StatsResponse) ProtoMessage() {}
func (*StatsResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_device_ebefe60214c28313, []int{11}
}
func (m *StatsResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_StatsResponse.Unmarshal(m, b)
}
func (m *StatsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_StatsResponse.Marshal(b, m, deterministic)
}
func (dst *StatsResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_StatsResponse.Merge(dst, src)
}
func (m *StatsResponse) XXX_Size() int {
return xxx_messageInfo_StatsResponse.Size(m)
}
func (m *StatsResponse) XXX_DiscardUnknown() {
xxx_messageInfo_StatsResponse.DiscardUnknown(m)
}
var xxx_messageInfo_StatsResponse proto.InternalMessageInfo
func (m *StatsResponse) GetGroups() []*DeviceGroupStats {
if m != nil {
return m.Groups
}
return nil
}
// DeviceGroupStats contains statistics for each device of a particular
// device group, identified by the vendor, type and name of the device.
type DeviceGroupStats struct {
Vendor string `protobuf:"bytes,1,opt,name=vendor,proto3" json:"vendor,omitempty"`
Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
// instance_stats is a mapping of each device ID to its statistics.
InstanceStats map[string]*DeviceStats `protobuf:"bytes,4,rep,name=instance_stats,json=instanceStats,proto3" json:"instance_stats,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *DeviceGroupStats) Reset() { *m = DeviceGroupStats{} }
func (m *DeviceGroupStats) String() string { return proto.CompactTextString(m) }
func (*DeviceGroupStats) ProtoMessage() {}
func (*DeviceGroupStats) Descriptor() ([]byte, []int) {
return fileDescriptor_device_ebefe60214c28313, []int{12}
}
func (m *DeviceGroupStats) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DeviceGroupStats.Unmarshal(m, b)
}
func (m *DeviceGroupStats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_DeviceGroupStats.Marshal(b, m, deterministic)
}
func (dst *DeviceGroupStats) XXX_Merge(src proto.Message) {
xxx_messageInfo_DeviceGroupStats.Merge(dst, src)
}
func (m *DeviceGroupStats) XXX_Size() int {
return xxx_messageInfo_DeviceGroupStats.Size(m)
}
func (m *DeviceGroupStats) XXX_DiscardUnknown() {
xxx_messageInfo_DeviceGroupStats.DiscardUnknown(m)
}
var xxx_messageInfo_DeviceGroupStats proto.InternalMessageInfo
func (m *DeviceGroupStats) GetVendor() string {
if m != nil {
return m.Vendor
}
return ""
}
func (m *DeviceGroupStats) GetType() string {
if m != nil {
return m.Type
}
return ""
}
func (m *DeviceGroupStats) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *DeviceGroupStats) GetInstanceStats() map[string]*DeviceStats {
if m != nil {
return m.InstanceStats
}
return nil
}
// DeviceStats is the statistics for an individual device
type DeviceStats struct {
// summary exposes a single summary metric that should be the most
// informative to users.
Summary *StatValue `protobuf:"bytes,1,opt,name=summary,proto3" json:"summary,omitempty"`
// stats contains the verbose statistics for the device.
Stats *StatObject `protobuf:"bytes,2,opt,name=stats,proto3" json:"stats,omitempty"`
// timestamp is the time the statistics were collected.
Timestamp *timestamp.Timestamp `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *DeviceStats) Reset() { *m = DeviceStats{} }
func (m *DeviceStats) String() string { return proto.CompactTextString(m) }
func (*DeviceStats) ProtoMessage() {}
func (*DeviceStats) Descriptor() ([]byte, []int) {
return fileDescriptor_device_ebefe60214c28313, []int{13}
}
func (m *DeviceStats) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DeviceStats.Unmarshal(m, b)
}
func (m *DeviceStats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_DeviceStats.Marshal(b, m, deterministic)
}
func (dst *DeviceStats) XXX_Merge(src proto.Message) {
xxx_messageInfo_DeviceStats.Merge(dst, src)
}
func (m *DeviceStats) XXX_Size() int {
return xxx_messageInfo_DeviceStats.Size(m)
}
func (m *DeviceStats) XXX_DiscardUnknown() {
xxx_messageInfo_DeviceStats.DiscardUnknown(m)
}
var xxx_messageInfo_DeviceStats proto.InternalMessageInfo
func (m *DeviceStats) GetSummary() *StatValue {
if m != nil {
return m.Summary
}
return nil
}
func (m *DeviceStats) GetStats() *StatObject {
if m != nil {
return m.Stats
}
return nil
}
func (m *DeviceStats) GetTimestamp() *timestamp.Timestamp {
if m != nil {
return m.Timestamp
}
return nil
}
// StatObject is a collection of statistics either exposed at the top
// level or via nested StatObjects.
type StatObject struct {
// nested is a mapping of object name to a nested stats object.
Nested map[string]*StatObject `protobuf:"bytes,1,rep,name=nested,proto3" json:"nested,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
// attributes is a mapping of statistic name to its value.
Attributes map[string]*StatValue `protobuf:"bytes,2,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *StatObject) Reset() { *m = StatObject{} }
func (m *StatObject) String() string { return proto.CompactTextString(m) }
func (*StatObject) ProtoMessage() {}
func (*StatObject) Descriptor() ([]byte, []int) {
return fileDescriptor_device_ebefe60214c28313, []int{14}
}
func (m *StatObject) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_StatObject.Unmarshal(m, b)
}
func (m *StatObject) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_StatObject.Marshal(b, m, deterministic)
}
func (dst *StatObject) XXX_Merge(src proto.Message) {
xxx_messageInfo_StatObject.Merge(dst, src)
}
func (m *StatObject) XXX_Size() int {
return xxx_messageInfo_StatObject.Size(m)
}
func (m *StatObject) XXX_DiscardUnknown() {
xxx_messageInfo_StatObject.DiscardUnknown(m)
}
var xxx_messageInfo_StatObject proto.InternalMessageInfo
func (m *StatObject) GetNested() map[string]*StatObject {
if m != nil {
return m.Nested
}
return nil
}
func (m *StatObject) GetAttributes() map[string]*StatValue {
if m != nil {
return m.Attributes
}
return nil
}
// 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.
type StatValue struct {
// 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.
FloatNumeratorVal float64 `protobuf:"fixed64,1,opt,name=float_numerator_val,json=floatNumeratorVal,proto3" json:"float_numerator_val,omitempty"`
FloatDenominatorVal float64 `protobuf:"fixed64,2,opt,name=float_denominator_val,json=floatDenominatorVal,proto3" json:"float_denominator_val,omitempty"`
// int_numerator_val exposes a int value. If denominator
// is set it is assumed to be a fractional value, otherwise it is a
// scalar.
IntNumeratorVal int64 `protobuf:"varint,3,opt,name=int_numerator_val,json=intNumeratorVal,proto3" json:"int_numerator_val,omitempty"`
IntDenominatorVal int64 `protobuf:"varint,4,opt,name=int_denominator_val,json=intDenominatorVal,proto3" json:"int_denominator_val,omitempty"`
// string_val exposes a string value. These are likely annotations.
StringVal string `protobuf:"bytes,5,opt,name=string_val,json=stringVal,proto3" json:"string_val,omitempty"`
// bool_val exposes a boolean statistic.
BoolVal bool `protobuf:"varint,6,opt,name=bool_val,json=boolVal,proto3" json:"bool_val,omitempty"`
// unit gives the unit type: °F, %, MHz, MB, etc.
Unit string `protobuf:"bytes,7,opt,name=unit,proto3" json:"unit,omitempty"`
// desc provides a human readable description of the statistic.
Desc string `protobuf:"bytes,8,opt,name=desc,proto3" json:"desc,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *StatValue) Reset() { *m = StatValue{} }
func (m *StatValue) String() string { return proto.CompactTextString(m) }
func (*StatValue) ProtoMessage() {}
func (*StatValue) Descriptor() ([]byte, []int) {
return fileDescriptor_device_ebefe60214c28313, []int{15}
}
func (m *StatValue) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_StatValue.Unmarshal(m, b)
}
func (m *StatValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_StatValue.Marshal(b, m, deterministic)
}
func (dst *StatValue) XXX_Merge(src proto.Message) {
xxx_messageInfo_StatValue.Merge(dst, src)
}
func (m *StatValue) XXX_Size() int {
return xxx_messageInfo_StatValue.Size(m)
}
func (m *StatValue) XXX_DiscardUnknown() {
xxx_messageInfo_StatValue.DiscardUnknown(m)
}
var xxx_messageInfo_StatValue proto.InternalMessageInfo
func (m *StatValue) GetFloatNumeratorVal() float64 {
if m != nil {
return m.FloatNumeratorVal
}
return 0
}
func (m *StatValue) GetFloatDenominatorVal() float64 {
if m != nil {
return m.FloatDenominatorVal
}
return 0
}
func (m *StatValue) GetIntNumeratorVal() int64 {
if m != nil {
return m.IntNumeratorVal
}
return 0
}
func (m *StatValue) GetIntDenominatorVal() int64 {
if m != nil {
return m.IntDenominatorVal
}
return 0
}
func (m *StatValue) GetStringVal() string {
if m != nil {
return m.StringVal
}
return ""
}
func (m *StatValue) GetBoolVal() bool {
if m != nil {
return m.BoolVal
}
return false
}
func (m *StatValue) GetUnit() string {
if m != nil {
return m.Unit
}
return ""
}
func (m *StatValue) GetDesc() string {
if m != nil {
return m.Desc
}
return ""
}
func init() {
proto.RegisterType((*FingerprintRequest)(nil), "hashicorp.nomad.plugins.device.FingerprintRequest")
proto.RegisterType((*FingerprintResponse)(nil), "hashicorp.nomad.plugins.device.FingerprintResponse")
@ -560,6 +913,15 @@ func init() {
proto.RegisterMapType((map[string]string)(nil), "hashicorp.nomad.plugins.device.ContainerReservation.EnvsEntry")
proto.RegisterType((*Mount)(nil), "hashicorp.nomad.plugins.device.Mount")
proto.RegisterType((*DeviceSpec)(nil), "hashicorp.nomad.plugins.device.DeviceSpec")
proto.RegisterType((*StatsRequest)(nil), "hashicorp.nomad.plugins.device.StatsRequest")
proto.RegisterType((*StatsResponse)(nil), "hashicorp.nomad.plugins.device.StatsResponse")
proto.RegisterType((*DeviceGroupStats)(nil), "hashicorp.nomad.plugins.device.DeviceGroupStats")
proto.RegisterMapType((map[string]*DeviceStats)(nil), "hashicorp.nomad.plugins.device.DeviceGroupStats.InstanceStatsEntry")
proto.RegisterType((*DeviceStats)(nil), "hashicorp.nomad.plugins.device.DeviceStats")
proto.RegisterType((*StatObject)(nil), "hashicorp.nomad.plugins.device.StatObject")
proto.RegisterMapType((map[string]*StatValue)(nil), "hashicorp.nomad.plugins.device.StatObject.AttributesEntry")
proto.RegisterMapType((map[string]*StatObject)(nil), "hashicorp.nomad.plugins.device.StatObject.NestedEntry")
proto.RegisterType((*StatValue)(nil), "hashicorp.nomad.plugins.device.StatValue")
}
// Reference imports to suppress errors if they are not otherwise used.
@ -583,6 +945,8 @@ type DevicePluginClient interface {
// this to run any setup steps and provides the mounting details to
// the Nomad client
Reserve(ctx context.Context, in *ReserveRequest, opts ...grpc.CallOption) (*ReserveResponse, error)
// Stats returns a stream of device statistics.
Stats(ctx context.Context, in *StatsRequest, opts ...grpc.CallOption) (DevicePlugin_StatsClient, error)
}
type devicePluginClient struct {
@ -634,6 +998,38 @@ func (c *devicePluginClient) Reserve(ctx context.Context, in *ReserveRequest, op
return out, nil
}
func (c *devicePluginClient) Stats(ctx context.Context, in *StatsRequest, opts ...grpc.CallOption) (DevicePlugin_StatsClient, error) {
stream, err := c.cc.NewStream(ctx, &_DevicePlugin_serviceDesc.Streams[1], "/hashicorp.nomad.plugins.device.DevicePlugin/Stats", opts...)
if err != nil {
return nil, err
}
x := &devicePluginStatsClient{stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
type DevicePlugin_StatsClient interface {
Recv() (*StatsResponse, error)
grpc.ClientStream
}
type devicePluginStatsClient struct {
grpc.ClientStream
}
func (x *devicePluginStatsClient) Recv() (*StatsResponse, error) {
m := new(StatsResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// DevicePluginServer is the server API for DevicePlugin service.
type DevicePluginServer interface {
// Fingerprint allows the device plugin to return a set of
@ -645,6 +1041,8 @@ type DevicePluginServer interface {
// this to run any setup steps and provides the mounting details to
// the Nomad client
Reserve(context.Context, *ReserveRequest) (*ReserveResponse, error)
// Stats returns a stream of device statistics.
Stats(*StatsRequest, DevicePlugin_StatsServer) error
}
func RegisterDevicePluginServer(s *grpc.Server, srv DevicePluginServer) {
@ -690,6 +1088,27 @@ func _DevicePlugin_Reserve_Handler(srv interface{}, ctx context.Context, dec fun
return interceptor(ctx, in, info, handler)
}
func _DevicePlugin_Stats_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(StatsRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(DevicePluginServer).Stats(m, &devicePluginStatsServer{stream})
}
type DevicePlugin_StatsServer interface {
Send(*StatsResponse) error
grpc.ServerStream
}
type devicePluginStatsServer struct {
grpc.ServerStream
}
func (x *devicePluginStatsServer) Send(m *StatsResponse) error {
return x.ServerStream.SendMsg(m)
}
var _DevicePlugin_serviceDesc = grpc.ServiceDesc{
ServiceName: "hashicorp.nomad.plugins.device.DevicePlugin",
HandlerType: (*DevicePluginServer)(nil),
@ -705,57 +1124,87 @@ var _DevicePlugin_serviceDesc = grpc.ServiceDesc{
Handler: _DevicePlugin_Fingerprint_Handler,
ServerStreams: true,
},
{
StreamName: "Stats",
Handler: _DevicePlugin_Stats_Handler,
ServerStreams: true,
},
},
Metadata: "github.com/hashicorp/nomad/plugins/device/proto/device.proto",
}
func init() {
proto.RegisterFile("github.com/hashicorp/nomad/plugins/device/proto/device.proto", fileDescriptor_device_7496b084f8b5ea81)
proto.RegisterFile("github.com/hashicorp/nomad/plugins/device/proto/device.proto", fileDescriptor_device_ebefe60214c28313)
}
var fileDescriptor_device_7496b084f8b5ea81 = []byte{
// 682 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xdd, 0x6e, 0xd3, 0x4a,
0x10, 0x3e, 0x4e, 0x9a, 0x26, 0x99, 0xf4, 0xb4, 0xe7, 0xec, 0xa9, 0x8e, 0xac, 0xf0, 0x17, 0x59,
0x42, 0xaa, 0x40, 0xd8, 0x28, 0x45, 0x02, 0x01, 0x45, 0xa2, 0xa4, 0x40, 0x24, 0x68, 0x2b, 0xc3,
0x0d, 0x20, 0x61, 0x39, 0xf6, 0x2a, 0x5e, 0xd5, 0xd9, 0x35, 0xbb, 0xeb, 0x54, 0xe6, 0x89, 0x78,
0x06, 0xde, 0x81, 0xf7, 0xe1, 0x12, 0x79, 0x77, 0x9d, 0xb8, 0x80, 0x48, 0x0b, 0x57, 0xb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xfd, 0xdd, 0x0b, 0x71, 0xb4, 0xb0, 0x9d, 0xbf, 0x6e,
0x5b, 0x28, 0x85, 0xb6, 0xd1, 0x3b, 0x5a, 0xb9, 0x97, 0x67, 0x37, 0xa9, 0xef, 0x9d, 0x3b, 0xbe,
0xaa, 0xb7, 0xdf, 0x7e, 0xdb, 0x52, 0xff, 0x38, 0x93, 0x75, 0x75, 0xec, 0x7e, 0x0b, 0x00, 0x00,
0xff, 0xff, 0x5f, 0xeb, 0xc2, 0x59, 0xb8, 0x06, 0x00, 0x00,
var fileDescriptor_device_ebefe60214c28313 = []byte{
// 1086 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xeb, 0x8e, 0xdb, 0x44,
0x14, 0x26, 0xf7, 0xe4, 0x64, 0x2f, 0xdd, 0xd9, 0x05, 0x85, 0x40, 0xe9, 0xca, 0x12, 0x52, 0x59,
0xa8, 0x53, 0xa5, 0x08, 0xaa, 0x42, 0xa1, 0xed, 0xa6, 0xd0, 0x95, 0x60, 0xb7, 0x72, 0xab, 0x4a,
0x2d, 0x12, 0xd6, 0xc4, 0x9e, 0xc6, 0xd3, 0xda, 0x33, 0xc6, 0x33, 0x4e, 0x15, 0xde, 0x80, 0x37,
0xe1, 0x4f, 0x5f, 0x80, 0x77, 0x80, 0x87, 0xe0, 0x49, 0xd0, 0x5c, 0x9c, 0x38, 0xdb, 0xa5, 0x49,
0xe0, 0x97, 0xe7, 0x5c, 0xbe, 0x6f, 0x8e, 0xcf, 0x39, 0x73, 0x66, 0xe0, 0xeb, 0x09, 0x95, 0x51,
0x3e, 0x76, 0x03, 0x9e, 0x0c, 0x22, 0x2c, 0x22, 0x1a, 0xf0, 0x2c, 0x1d, 0x30, 0x9e, 0xe0, 0x70,
0x90, 0xc6, 0xf9, 0x84, 0x32, 0x31, 0x08, 0xc9, 0x94, 0x06, 0x64, 0x90, 0x66, 0x5c, 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, 0x00, 0x7d, 0xb6, 0x4e, 0xa7, 0x15, 0x37, 0x49,
0xff, 0xda, 0x9a, 0xde, 0x8b, 0xff, 0xba, 0xd7, 0x7a, 0xd6, 0x30, 0x13, 0xa4, 0xa9, 0x3f, 0x37,
0xfe, 0x09, 0x00, 0x00, 0xff, 0xff, 0xe4, 0x5c, 0x8f, 0xd7, 0x6b, 0x0c, 0x00, 0x00,
}

View File

@ -2,6 +2,8 @@ syntax = "proto3";
package hashicorp.nomad.plugins.device;
option go_package = "proto";
import "google/protobuf/timestamp.proto";
// DevicePlugin is the API exposed by device plugins
service DevicePlugin {
// Fingerprint allows the device plugin to return a set of
@ -14,6 +16,9 @@ service DevicePlugin {
// this to run any setup steps and provides the mounting details to
// the Nomad client
rpc Reserve(ReserveRequest) returns (ReserveResponse) {}
// Stats returns a stream of device statistics.
rpc Stats(StatsRequest) returns (stream StatsResponse) {}
}
// FingerprintRequest is used to request for devices to be fingerprinted.
@ -129,3 +134,75 @@ message DeviceSpec {
string permissions = 3;
}
// StatsRequest is used to parameterize the retrieval of statistics.
message StatsRequest {}
// StatsResponse returns the statistics for each device group.
message StatsResponse {
// groups contains statistics for each device group.
repeated DeviceGroupStats groups = 1;
}
// DeviceGroupStats contains statistics for each device of a particular
// device group, identified by the vendor, type and name of the device.
message DeviceGroupStats {
string vendor = 1;
string type = 2;
string name = 3;
// instance_stats is a mapping of each device ID to its statistics.
map<string, DeviceStats> instance_stats = 4;
}
// DeviceStats is the statistics for an individual device
message DeviceStats {
// summary exposes a single summary metric that should be the most
// informative to users.
StatValue summary = 1;
// stats contains the verbose statistics for the device.
StatObject stats = 2;
// timestamp is the time the statistics were collected.
google.protobuf.Timestamp timestamp = 3;
}
// 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;
}