Skip to main content

opensearch_client/cluster/stats/
cluster_operating_system.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::cluster;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ClusterOperatingSystem {
16    /// Contains statistics about processor architectures (for example, x86_64 or aarch64) used by selected nodes.
17    #[serde(
18        rename = "architectures",
19        default,
20        skip_serializing_if = "Option::is_none"
21    )]
22    pub architectures: Option<Vec<cluster::stats::ClusterOperatingSystemArchitecture>>,
23    /// Contains statistics about operating systems used by selected nodes.
24    #[serde(rename = "pretty_names")]
25    pub pretty_names: Vec<cluster::stats::ClusterOperatingSystemPrettyName>,
26    /// Number of processors used to calculate thread pool size across all selected nodes.
27    /// This number can be set with the processors setting of a node and defaults to the number of processors reported by the operating system.
28    /// In both cases, this number will never be larger than 32.
29    #[serde(rename = "allocated_processors")]
30    pub allocated_processors: u32,
31    /// Contains statistics about operating systems used by selected nodes.
32    #[serde(rename = "names")]
33    pub names: Vec<cluster::stats::ClusterOperatingSystemName>,
34    /// Number of processors available to JVM across all selected nodes.
35    #[serde(rename = "available_processors")]
36    pub available_processors: u32,
37    #[serde(rename = "mem")]
38    pub mem: cluster::stats::OperatingSystemMemoryInfo,
39}
40
41impl ClusterOperatingSystem {
42    pub fn new(
43        pretty_names: Vec<cluster::stats::ClusterOperatingSystemPrettyName>,
44        allocated_processors: u32,
45        names: Vec<cluster::stats::ClusterOperatingSystemName>,
46        available_processors: u32,
47        mem: cluster::stats::OperatingSystemMemoryInfo,
48    ) -> ClusterOperatingSystem {
49        ClusterOperatingSystem {
50            architectures: None,
51            pretty_names,
52            allocated_processors,
53            names,
54            available_processors,
55            mem,
56        }
57    }
58}