opensearch_client/common/
flush_stats.rs1use serde::{Deserialize, Serialize};
12
13#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
14pub struct FlushStats {
15 #[serde(rename = "total_time_in_millis")]
16 pub total_time_in_millis: String,
17 #[serde(
20 rename = "total_time",
21 default,
22 skip_serializing_if = "Option::is_none"
23 )]
24 pub total_time: Option<String>,
25 #[serde(rename = "periodic")]
26 pub periodic: u32,
27 #[serde(rename = "total")]
28 pub total: u32,
29}
30
31impl FlushStats {
32 pub fn new(total_time_in_millis: String, periodic: u32, total: u32) -> FlushStats {
33 FlushStats {
34 total_time_in_millis,
35 total_time: None,
36 periodic,
37 total,
38 }
39 }
40}