opensearch_client/common/
merges_stats.rs1use serde::{Deserialize, Serialize};
12
13#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
14pub struct MergesStats {
15 #[serde(
16 rename = "total_auto_throttle",
17 default,
18 skip_serializing_if = "Option::is_none"
19 )]
20 pub total_auto_throttle: Option<String>,
21 #[serde(rename = "total_docs")]
22 pub total_docs: u32,
23 #[serde(rename = "current_docs")]
24 pub current_docs: u32,
25 #[serde(rename = "total")]
26 pub total: u32,
27 #[serde(rename = "total_stopped_time_in_millis")]
28 pub total_stopped_time_in_millis: String,
29 #[serde(
32 rename = "total_throttled_time",
33 default,
34 skip_serializing_if = "Option::is_none"
35 )]
36 pub total_throttled_time: Option<String>,
37 #[serde(
38 rename = "total_size",
39 default,
40 skip_serializing_if = "Option::is_none"
41 )]
42 pub total_size: Option<String>,
43 #[serde(rename = "total_throttled_time_in_millis")]
44 pub total_throttled_time_in_millis: String,
45 #[serde(rename = "total_size_in_bytes")]
46 pub total_size_in_bytes: u32,
47 #[serde(
48 rename = "current_size",
49 default,
50 skip_serializing_if = "Option::is_none"
51 )]
52 pub current_size: Option<String>,
53 #[serde(
56 rename = "total_stopped_time",
57 default,
58 skip_serializing_if = "Option::is_none"
59 )]
60 pub total_stopped_time: Option<String>,
61 #[serde(rename = "total_time_in_millis")]
62 pub total_time_in_millis: String,
63 #[serde(
64 rename = "unreferenced_file_cleanups_performed",
65 default,
66 skip_serializing_if = "Option::is_none"
67 )]
68 pub unreferenced_file_cleanups_performed: Option<u32>,
69 #[serde(rename = "current")]
70 pub current: u32,
71 #[serde(rename = "current_size_in_bytes")]
72 pub current_size_in_bytes: u32,
73 #[serde(
76 rename = "total_time",
77 default,
78 skip_serializing_if = "Option::is_none"
79 )]
80 pub total_time: Option<String>,
81 #[serde(rename = "total_auto_throttle_in_bytes")]
82 pub total_auto_throttle_in_bytes: u32,
83}
84
85impl MergesStats {
86 pub fn new(
87 total_docs: u32,
88 current_docs: u32,
89 total: u32,
90 total_stopped_time_in_millis: String,
91 total_throttled_time_in_millis: String,
92 total_size_in_bytes: u32,
93 total_time_in_millis: String,
94 current: u32,
95 current_size_in_bytes: u32,
96 total_auto_throttle_in_bytes: u32,
97 ) -> MergesStats {
98 MergesStats {
99 total_auto_throttle: None,
100 total_docs,
101 current_docs,
102 total,
103 total_stopped_time_in_millis,
104 total_throttled_time: None,
105 total_size: None,
106 total_throttled_time_in_millis,
107 total_size_in_bytes,
108 current_size: None,
109 total_stopped_time: None,
110 total_time_in_millis,
111 unreferenced_file_cleanups_performed: None,
112 current,
113 current_size_in_bytes,
114 total_time: None,
115 total_auto_throttle_in_bytes,
116 }
117 }
118}