Skip to content

Commit

Permalink
Merge pull request #410 from benesch/statistics-default
Browse files Browse the repository at this point in the history
Add Default trait to Statistics
  • Loading branch information
benesch committed Nov 27, 2021
2 parents 6299a22 + 2064e25 commit 6454372
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/statistics.rs
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

0 comments on commit 6454372

Please sign in to comment.