Skip to main content

opensearch_client/common/
request_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 RequestStats {
15    #[serde(rename = "current", default, skip_serializing_if = "Option::is_none")]
16    pub current: Option<u32>,
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(rename = "time", default, skip_serializing_if = "Option::is_none")]
20    pub time: Option<String>,
21    #[serde(rename = "total", default, skip_serializing_if = "Option::is_none")]
22    pub total: Option<u32>,
23    #[serde(
24        rename = "time_in_millis",
25        default,
26        skip_serializing_if = "Option::is_none"
27    )]
28    pub time_in_millis: Option<String>,
29}
30
31impl RequestStats {
32    pub fn new() -> RequestStats {
33        RequestStats {
34            current: None,
35            time: None,
36            total: None,
37            time_in_millis: None,
38        }
39    }
40}