-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move structures to a different module
- Loading branch information
Showing
4 changed files
with
84 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
use serde::{Deserialize, Serialize}; | ||
|
||
use histogram::CompactHistogram; | ||
|
||
#[derive(Serialize, Deserialize)] | ||
pub struct Connections { | ||
/// number of current connections (gauge) | ||
pub current: i64, | ||
/// number of total connect attempts | ||
pub total: u64, | ||
/// number of connections established | ||
pub opened: u64, | ||
/// number of connect attempts that failed | ||
pub error: u64, | ||
/// number of connect attempts that hit timeout | ||
pub timeout: u64, | ||
} | ||
|
||
#[derive(Copy, Clone, Serialize, Deserialize)] | ||
pub struct Requests { | ||
pub total: u64, | ||
pub ok: u64, | ||
pub reconnect: u64, | ||
pub unsupported: u64, | ||
} | ||
|
||
#[derive(Serialize, Deserialize)] | ||
pub struct Responses { | ||
/// total number of responses | ||
pub total: u64, | ||
/// number of responses that were successful | ||
pub ok: u64, | ||
/// number of responses that were unsuccessful | ||
pub error: u64, | ||
/// number of responses that were missed due to timeout | ||
pub timeout: u64, | ||
/// number of read requests with a hit response | ||
pub hit: u64, | ||
/// number of read requests with a miss response | ||
pub miss: u64, | ||
} | ||
|
||
#[derive(Serialize, Deserialize)] | ||
pub struct Client { | ||
pub connections: Connections, | ||
pub requests: Requests, | ||
pub responses: Responses, | ||
pub request_latency: CompactHistogram, | ||
} | ||
|
||
#[derive(Serialize, Deserialize)] | ||
pub struct Pubsub { | ||
pub publishers: Publishers, | ||
pub subscribers: Subscribers, | ||
} | ||
|
||
#[derive(Serialize, Deserialize)] | ||
pub struct Publishers { | ||
// current number of publishers | ||
pub current: i64, | ||
} | ||
|
||
#[derive(Serialize, Deserialize)] | ||
pub struct Subscribers { | ||
// current number of subscribers | ||
pub current: i64, | ||
} | ||
|
||
#[derive(Serialize, Deserialize)] | ||
pub struct RpcPerfSnapshot { | ||
pub window: u64, | ||
pub elapsed: f64, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub target_qps: Option<f64>, | ||
pub client: Client, | ||
pub pubsub: Pubsub, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
mod dataspec; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters