Skip to main content

opensearch_client/common/
remote_store_upload_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 crate::common;
12use serde::{Deserialize, Serialize};
13
14/// RemoteStoreUploadStats
15/// Statistics related to uploads to the remote segment store.
16
17#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
18pub struct RemoteStoreUploadStats {
19    /// A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and
20    /// `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.
21    #[serde(
22        rename = "total_time_spent",
23        default,
24        skip_serializing_if = "Option::is_none"
25    )]
26    pub total_time_spent: Option<String>,
27    /// A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and
28    /// `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.
29    #[serde(
30        rename = "max_refresh_time_lag",
31        default,
32        skip_serializing_if = "Option::is_none"
33    )]
34    pub max_refresh_time_lag: Option<String>,
35    #[serde(rename = "total_time_spent_in_millis")]
36    pub total_time_spent_in_millis: String,
37    /// The amount of data, in bytes, uploaded or downloaded to/from the remote segment store.
38    #[serde(rename = "total_upload_size")]
39    pub total_upload_size: common::RemoteStoreUploadDownloadStats,
40    /// Statistics related to segment store upload backpressure.
41    #[serde(rename = "pressure", default, skip_serializing_if = "Option::is_none")]
42    pub pressure: Option<common::RemoteStoreUploadPressureStats>,
43    /// The amount of lag during upload between the remote segment store and the local store.
44    #[serde(rename = "refresh_size_lag")]
45    pub refresh_size_lag: common::RemoteStoreUploadRefreshSizeLagStats,
46    #[serde(rename = "max_refresh_time_lag_in_millis")]
47    pub max_refresh_time_lag_in_millis: String,
48}
49
50impl RemoteStoreUploadStats {
51    /// Statistics related to uploads to the remote segment store.
52    pub fn new(
53        total_time_spent_in_millis: String,
54        total_upload_size: common::RemoteStoreUploadDownloadStats,
55        refresh_size_lag: common::RemoteStoreUploadRefreshSizeLagStats,
56        max_refresh_time_lag_in_millis: String,
57    ) -> RemoteStoreUploadStats {
58        RemoteStoreUploadStats {
59            total_time_spent: None,
60            max_refresh_time_lag: None,
61            total_time_spent_in_millis,
62            total_upload_size,
63            pressure: None,
64            refresh_size_lag,
65            max_refresh_time_lag_in_millis,
66        }
67    }
68}