1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
* opensearch-client
*
* Rust Client for OpenSearch
*
* The version of the OpenAPI document: 3.1.0
* Contact: alberto.paro@gmail.com
* Generated by Paro OpenAPI Generator
*/
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct QueryCacheStats {
/// The total number of hits and misses stored in the query cache across all shards assigned to the selected nodes.
#[serde(rename = "total_count")]
pub total_count: u32,
/// The total number of entries currently stored in the query cache across all shards assigned to the selected nodes.
#[serde(rename = "cache_size")]
pub cache_size: u32,
#[serde(
rename = "memory_size",
default,
skip_serializing_if = "Option::is_none"
)]
pub memory_size: Option<String>,
/// The total number of query cache hits across all shards assigned to the selected nodes.
#[serde(rename = "hit_count")]
pub hit_count: u32,
/// The total number of entries added to the query cache across all shards assigned to the selected nodes.
/// This number includes all current and evicted entries.
#[serde(rename = "cache_count")]
pub cache_count: u32,
/// The total number of query cache misses across all shards assigned to the selected nodes.
#[serde(rename = "miss_count")]
pub miss_count: u32,
/// The total number of query cache evictions across all shards assigned to the selected nodes.
#[serde(rename = "evictions")]
pub evictions: u32,
#[serde(rename = "memory_size_in_bytes")]
pub memory_size_in_bytes: u32,
}
impl QueryCacheStats {
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 {
QueryCacheStats {
total_count,
cache_size,
memory_size: None,
hit_count,
cache_count,
miss_count,
evictions,
memory_size_in_bytes,
}
}
}