diff --git a/Cargo.lock b/Cargo.lock index af9c2f5..ed2de26 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -190,7 +190,7 @@ dependencies = [ [[package]] name = "dragonfly-api" -version = "2.0.170" +version = "2.0.171" dependencies = [ "prost", "prost-types", diff --git a/Cargo.toml b/Cargo.toml index 28fedac..bd1ff93 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dragonfly-api" -version = "2.0.170" +version = "2.0.171" authors = ["Gaius "] edition = "2021" license = "Apache-2.0" diff --git a/pkg/apis/common/v2/common.pb.go b/pkg/apis/common/v2/common.pb.go index 53664f2..ff47bd3 100644 --- a/pkg/apis/common/v2/common.pb.go +++ b/pkg/apis/common/v2/common.pb.go @@ -1564,6 +1564,10 @@ type Disk struct { InodesFree uint64 `protobuf:"varint,7,opt,name=inodes_free,json=inodesFree,proto3" json:"inodes_free,omitempty"` // Used percent of indoes on the data path of dragonfly directory. InodesUsedPercent float64 `protobuf:"fixed64,8,opt,name=inodes_used_percent,json=inodesUsedPercent,proto3" json:"inodes_used_percent,omitempty"` + // Disk read bandwidth, in bytes per second. + ReadBandwidth uint64 `protobuf:"varint,9,opt,name=read_bandwidth,json=readBandwidth,proto3" json:"read_bandwidth,omitempty"` + // Disk write bandwidth, in bytes per second. + WriteBandwidth uint64 `protobuf:"varint,10,opt,name=write_bandwidth,json=writeBandwidth,proto3" json:"write_bandwidth,omitempty"` } func (x *Disk) Reset() { @@ -1654,6 +1658,20 @@ func (x *Disk) GetInodesUsedPercent() float64 { return 0 } +func (x *Disk) GetReadBandwidth() uint64 { + if x != nil { + return x.ReadBandwidth + } + return 0 +} + +func (x *Disk) GetWriteBandwidth() uint64 { + if x != nil { + return x.WriteBandwidth + } + return 0 +} + // Build information. type Build struct { state protoimpl.MessageState @@ -2589,7 +2607,7 @@ var file_pkg_apis_common_v2_common_proto_rawDesc = []byte{ 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x6c, 0x6f, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x69, 0x64, 0x63, 0x22, 0xae, 0x02, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x69, 0x64, 0x63, 0x22, 0xfe, 0x02, 0x0a, 0x04, 0x44, 0x69, 0x73, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x66, 0x72, 0x65, 0x65, @@ -2608,7 +2626,12 @@ var file_pkg_apis_common_v2_common_proto_rawDesc = []byte{ 0x75, 0x73, 0x65, 0x64, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x01, 0x42, 0x17, 0xfa, 0x42, 0x14, 0x12, 0x12, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x59, 0x40, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x11, 0x69, 0x6e, 0x6f, - 0x64, 0x65, 0x73, 0x55, 0x73, 0x65, 0x64, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x22, 0xf5, + 0x64, 0x65, 0x73, 0x55, 0x73, 0x65, 0x64, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x25, + 0x0a, 0x0e, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x62, 0x61, 0x6e, 0x64, 0x77, 0x69, 0x64, 0x74, 0x68, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x72, 0x65, 0x61, 0x64, 0x42, 0x61, 0x6e, 0x64, + 0x77, 0x69, 0x64, 0x74, 0x68, 0x12, 0x27, 0x0a, 0x0f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x62, + 0x61, 0x6e, 0x64, 0x77, 0x69, 0x64, 0x74, 0x68, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, + 0x77, 0x72, 0x69, 0x74, 0x65, 0x42, 0x61, 0x6e, 0x64, 0x77, 0x69, 0x64, 0x74, 0x68, 0x22, 0xf5, 0x01, 0x0a, 0x05, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x67, 0x69, 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x67, 0x69, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x0a, 0x0a, 0x67, 0x69, 0x74, diff --git a/pkg/apis/common/v2/common.pb.validate.go b/pkg/apis/common/v2/common.pb.validate.go index 23b5d78..00dfbcc 100644 --- a/pkg/apis/common/v2/common.pb.validate.go +++ b/pkg/apis/common/v2/common.pb.validate.go @@ -2084,6 +2084,10 @@ func (m *Disk) validate(all bool) error { errors = append(errors, err) } + // no validation rules for ReadBandwidth + + // no validation rules for WriteBandwidth + if len(errors) > 0 { return DiskMultiError(errors) } diff --git a/pkg/apis/common/v2/common.proto b/pkg/apis/common/v2/common.proto index 850de4e..2d1c68b 100644 --- a/pkg/apis/common/v2/common.proto +++ b/pkg/apis/common/v2/common.proto @@ -373,6 +373,10 @@ message Disk { uint64 inodes_free = 7; // Used percent of indoes on the data path of dragonfly directory. double inodes_used_percent = 8 [(validate.rules).double = {gte: 0, lte: 100}]; + // Disk read bandwidth, in bytes per second. + uint64 read_bandwidth = 9; + // Disk write bandwidth, in bytes per second. + uint64 write_bandwidth = 10; } // Build information. diff --git a/proto/common.proto b/proto/common.proto index 2d4fda0..cbc801d 100644 --- a/proto/common.proto +++ b/proto/common.proto @@ -369,6 +369,10 @@ message Disk { uint64 inodes_free = 7; // Used percent of indoes on the data path of dragonfly directory. double inodes_used_percent = 8; + // Disk read bandwidth, in bytes per second. + uint64 read_bandwidth = 9; + // Disk write bandwidth, in bytes per second. + uint64 write_bandwidth = 10; } // Build information. diff --git a/src/common.v2.rs b/src/common.v2.rs index 9f41d4b..bc91ad1 100644 --- a/src/common.v2.rs +++ b/src/common.v2.rs @@ -392,6 +392,12 @@ pub struct Disk { /// Used percent of indoes on the data path of dragonfly directory. #[prost(double, tag = "8")] pub inodes_used_percent: f64, + /// Disk read bandwidth, in bytes per second. + #[prost(uint64, tag = "9")] + pub read_bandwidth: u64, + /// Disk write bandwidth, in bytes per second. + #[prost(uint64, tag = "10")] + pub write_bandwidth: u64, } /// Build information. #[derive(serde::Serialize, serde::Deserialize)] diff --git a/src/descriptor.bin b/src/descriptor.bin index 4eedcfd..1d28514 100644 Binary files a/src/descriptor.bin and b/src/descriptor.bin differ