mssf_util/monitoring/
entities.rs

1// ------------------------------------------------------------
2// Copyright (c) Microsoft Corporation.  All rights reserved.
3// Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
4// ------------------------------------------------------------
5
6/// Health entities produced by HealthDataProducer.
7#[derive(Debug, Clone)]
8pub enum HealthEntity {
9    Node(NodeHealthEntity),
10    Cluster(ClusterHealthEntity),
11    Application(ApplicationHealthEntity),
12    Partition(PartitionHealthEntity),
13    Service(ServiceHealthEntity),
14    Replica(ReplicaHealthEntity),
15}
16
17/// There is no info for cluster name in FabricClient.
18/// User is supposed to inject the cluster name in consumer side.
19#[derive(Debug, Clone)]
20pub struct ClusterHealthEntity {
21    pub health: mssf_core::types::ClusterHealth,
22}
23
24#[derive(Debug, Clone)]
25pub struct NodeHealthEntity {
26    pub node: mssf_core::types::NodeQueryResultItem,
27    pub health: mssf_core::types::NodeHealthResult,
28}
29
30#[derive(Debug, Clone)]
31pub struct ApplicationHealthEntity {
32    pub application: mssf_core::types::ApplicationQueryResultItem,
33    pub health: mssf_core::types::ApplicationHealth,
34}
35
36#[derive(Debug, Clone)]
37pub struct ServiceHealthEntity {
38    pub service: mssf_core::types::ServiceQueryResultItem,
39    pub health: mssf_core::types::ServiceHealthResult,
40}
41
42#[derive(Debug, Clone)]
43pub struct PartitionHealthEntity {
44    pub partition: mssf_core::types::ServicePartitionQueryResultItem,
45    pub health: mssf_core::types::PartitionHealthResult,
46}
47
48#[derive(Debug, Clone)]
49pub struct ReplicaHealthEntity {
50    pub replica: mssf_core::types::ServiceReplicaQueryResultItem,
51    pub health: mssf_core::types::ReplicaHealthResult,
52}