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

Add Default trait to Statistics #410

Merged
merged 1 commit into from
Nov 27, 2021
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
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions src/statistics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use std::collections::HashMap;
use serde::Deserialize;

/// Overall statistics.
#[derive(Deserialize, Debug)]
#[derive(Deserialize, Debug, Default)]
pub struct Statistics {
/// The name of the librdkafka handle.
pub name: String,
Expand Down Expand Up @@ -73,7 +73,7 @@ pub struct Statistics {
}

/// Per-broker statistics.
#[derive(Deserialize, Debug)]
#[derive(Deserialize, Debug, Default)]
pub struct Broker {
/// The broker hostname, port, and ID, in the form `HOSTNAME:PORT/ID`.
pub name: String,
Expand Down Expand Up @@ -168,7 +168,7 @@ pub struct Broker {
///
/// These values are not exact; they are sampled estimates maintained by an
/// HDR histogram in librdkafka.
#[derive(Deserialize, Debug)]
#[derive(Deserialize, Debug, Default)]
pub struct Window {
/// The smallest value.
pub min: i64,
Expand Down Expand Up @@ -202,7 +202,7 @@ pub struct Window {
}

/// A topic and partition specifier.
#[derive(Deserialize, Debug)]
#[derive(Deserialize, Debug, Default)]
pub struct TopicPartition {
/// The name of the topic.
pub topic: String,
Expand All @@ -211,7 +211,7 @@ pub struct TopicPartition {
}

/// Per-topic statistics.
#[derive(Deserialize, Debug)]
#[derive(Deserialize, Debug, Default)]
pub struct Topic {
/// The name of the topic.
pub topic: String,
Expand All @@ -226,7 +226,7 @@ pub struct Topic {
}

/// Per-partition statistics.
#[derive(Deserialize, Debug)]
#[derive(Deserialize, Debug, Default)]
pub struct Partition {
/// The partition ID.
pub partition: i32,
Expand Down Expand Up @@ -299,7 +299,7 @@ pub struct Partition {
}

/// Consumer group manager statistics.
#[derive(Deserialize, Debug)]
#[derive(Deserialize, Debug, Default)]
pub struct ConsumerGroup {
/// The local consumer group handler's state.
pub state: String,
Expand All @@ -321,7 +321,7 @@ pub struct ConsumerGroup {
}

/// Exactly-once semantics statistics.
#[derive(Deserialize, Debug)]
#[derive(Deserialize, Debug, Default)]
pub struct ExactlyOnceSemantics {
/// The current idempotent producer state.
pub idemp_state: String,
Expand Down