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