Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pool_iostat): adding protobuf for pool #52

Merged
merged 1 commit into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apis/io-engine/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ fn main() {
"protobuf/v1/nexus.proto",
"protobuf/v1/registration.proto",
"protobuf/v1/snapshot.proto",
"protobuf/v1/stats.proto",
"protobuf/v1/test.proto",
],
&["protobuf/v1"],
Expand Down
42 changes: 42 additions & 0 deletions apis/io-engine/protobuf/v1/stats.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// gRPC protobuf for IOStats
syntax = "proto3";
import "google/protobuf/empty.proto";

package mayastor.v1;

// Interface for IO stats APIs.
service StatsRpc {
// RPC to get Pool IO stats.
rpc GetPoolIoStats (ListStatsOption) returns (PoolIoStatsResponse);
// RPC to reset Io Stats for all Pool, Replica and Nexus hosted on the node.
rpc ResetIoStats (google.protobuf.Empty) returns (google.protobuf.Empty);
}

message ListStatsOption {
optional string name = 1; // If specified, returns IO stats of only specified resource.
}

message PoolIoStatsResponse {
repeated IoStats stats = 1;
}

// Common IO stats struct for all resource types.
message IoStats {
string name = 1; // Name of the device/resource.
uint64 num_read_ops = 2; // Number of read operations on the device.
uint64 bytes_read = 3; // Total bytes read on the device.
uint64 num_write_ops = 4; // Number of write operations on the device.
uint64 bytes_written = 5; // Total bytes written on the device.
uint64 num_unmap_ops = 6; // Number of unmap operations on the device.
uint64 bytes_unmapped = 7; // Total bytes unmapped on the device.
uint64 read_latency_ticks = 8; // Total read latency on the device in ticks.
uint64 write_latency_ticks = 9; // Total write latency on the device in ticks.
uint64 unmap_latency_ticks = 10; // Total unmap latency on the device in ticks.
uint64 max_read_latency_ticks = 11; // Max read latency in ticks occurred over num_read_ops.
uint64 min_read_latency_ticks = 12; // Min read latency in ticks occurred over num_read_ops.
uint64 max_write_latency_ticks = 13; // Max write latency in ticks occurred over num_write_ops.
uint64 min_write_latency_ticks = 14; // Min write latency in ticks occurred over num_write_ops.
uint64 max_unmap_latency_ticks = 15; // Max unmap latency in ticks occurred over num_unmap_ops.
uint64 min_unmap_latency_ticks = 16; // Min unmap latency in ticks occurred over num_unmap_ops.
uint64 tick_rate = 17; // Tick rate specific to node hosting the device.
}
8 changes: 8 additions & 0 deletions apis/io-engine/src/v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ pub mod nexus {
};
}

pub mod stats {
pub use super::pb::{
stats_rpc_client::StatsRpcClient,
stats_rpc_server::{StatsRpc, StatsRpcServer},
IoStats, ListStatsOption, PoolIoStatsResponse,
};
}

pub mod test {
pub use super::pb::{
test_rpc_client::TestRpcClient,
Expand Down