Skip to main content

opensearch_client/common/
flush_stats.rs

1/*
2 * opensearch-client
3 *
4 * Rust Client for OpenSearch
5 *
6 * The version of the OpenAPI document: 3.1.0
7 * Contact: alberto.paro@gmail.com
8 * Generated by Paro OpenAPI Generator
9 */
10
11use 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    /// A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and
18    /// `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.
19    #[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}