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