Skip to main content

opensearch_client/common/
resource_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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ResourceStats {
16    #[serde(rename = "average")]
17    pub average: common::ResourceStat,
18    #[serde(rename = "thread_info")]
19    pub thread_info: common::ThreadInfo,
20    #[serde(rename = "min")]
21    pub min: common::ResourceStat,
22    #[serde(rename = "total")]
23    pub total: common::ResourceStat,
24    #[serde(rename = "max")]
25    pub max: common::ResourceStat,
26}
27
28impl ResourceStats {
29    pub fn new(
30        average: common::ResourceStat,
31        thread_info: common::ThreadInfo,
32        min: common::ResourceStat,
33        total: common::ResourceStat,
34        max: common::ResourceStat,
35    ) -> ResourceStats {
36        ResourceStats {
37            average,
38            thread_info,
39            min,
40            total,
41            max,
42        }
43    }
44}