Skip to main content

opensearch_client/common/
query_cache_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 serde::{Deserialize, Serialize};
12
13
14
15
16#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
17pub struct QueryCacheStats {  /// The total number of hits and misses stored in the query cache across all shards assigned to the selected nodes.
18    #[serde(rename = "total_count")]
19    pub total_count: u32,  /// The total number of entries currently stored in the query cache across all shards assigned to the selected nodes.
20    #[serde(rename = "cache_size")]
21    pub cache_size: u32,
22    #[serde(rename = "memory_size", default, skip_serializing_if = "Option::is_none")]
23    pub memory_size: Option<String>,  /// The total number of query cache hits across all shards assigned to the selected nodes.
24    #[serde(rename = "hit_count")]
25    pub hit_count: u32,  /// The total number of entries added to the query cache across all shards assigned to the selected nodes.
26  /// This number includes all current and evicted entries.
27    #[serde(rename = "cache_count")]
28    pub cache_count: u32,  /// The total number of query cache misses across all shards assigned to the selected nodes.
29    #[serde(rename = "miss_count")]
30    pub miss_count: u32,  /// The total number of query cache evictions across all shards assigned to the selected nodes.
31    #[serde(rename = "evictions")]
32    pub evictions: u32,
33    #[serde(rename = "memory_size_in_bytes")]
34    pub memory_size_in_bytes: u32,
35}
36
37impl QueryCacheStats {
38    
39    pub fn new(total_count: u32, cache_size: u32, hit_count: u32, cache_count: u32, miss_count: u32, evictions: u32, memory_size_in_bytes: u32) -> QueryCacheStats {
40        QueryCacheStats {
41            total_count,
42            cache_size,
43            memory_size: None,
44            hit_count,
45            cache_count,
46            miss_count,
47            evictions,
48            memory_size_in_bytes,
49        }
50    }
51}