Move Stat{Object|Value} to plugins/shared/structs

Moving them as they may be useful for other packages/plugins besides
devices.
This commit is contained in:
Mahmood Ali
2018-11-11 19:36:20 -05:00
parent df694eb3be
commit 2f4c510cb7
16 changed files with 3845 additions and 966 deletions

View File

@@ -13,6 +13,7 @@ import (
"github.com/hashicorp/nomad/plugins/base"
"github.com/hashicorp/nomad/plugins/device"
"github.com/hashicorp/nomad/plugins/shared/hclspec"
"github.com/hashicorp/nomad/plugins/shared/structs"
"github.com/kr/pretty"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
@@ -335,13 +336,13 @@ func (d *FsDevice) collectStats() (*device.DeviceGroupStats, error) {
}
s := &device.DeviceStats{
Summary: &device.StatValue{
Summary: &structs.StatValue{
IntNumeratorVal: f.Size(),
Unit: "bytes",
Desc: "Filesize in bytes",
},
Stats: &device.StatObject{
Attributes: map[string]*device.StatValue{
Stats: &structs.StatObject{
Attributes: map[string]*structs.StatValue{
"size": {
IntNumeratorVal: f.Size(),
Unit: "bytes",