/
process_info.sandesh
118 lines (105 loc) · 3.14 KB
/
process_info.sandesh
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/*
* Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
*/
/**
* Definitions of structures used to determine a process's status - whether the
* process is functional or non-functional based on it's internal state. This
* is sent by all process's in the corresponding Node UVE.
*/
namespace cpp process
enum ConnectionType {
TEST,
IFMAP,
XMPP,
COLLECTOR,
DATABASE,
REDIS_QUERY,
ZOOKEEPER,
DISCOVERY,
APISERVER,
TOR,
REDIS_UVE,
UVEPARTITIONS,
KAFKA_PUB,
}
const map<ConnectionType, string> ConnectionTypeNames = {
ConnectionType.TEST : "Test",
ConnectionType.IFMAP : "IFMap",
ConnectionType.XMPP : "XMPP",
ConnectionType.COLLECTOR : "Collector",
ConnectionType.DATABASE : "Database",
ConnectionType.REDIS_QUERY : "Redis-Query",
ConnectionType.ZOOKEEPER : "Zookeeper",
ConnectionType.DISCOVERY : "Discovery",
ConnectionType.APISERVER : "ApiServer",
ConnectionType.TOR : "ToR",
ConnectionType.REDIS_UVE: "Redis-UVE",
ConnectionType.UVEPARTITIONS : "UvePartitions",
ConnectionType.KAFKA_PUB : "KafkaPub"
}
enum ConnectionStatus {
INIT,
DOWN,
UP,
}
const map<ConnectionStatus, string> ConnectionStatusNames = {
ConnectionStatus.INIT : "Initializing",
ConnectionStatus.DOWN : "Down",
ConnectionStatus.UP : "Up",
}
struct ConnectionInfo {
1: string type
2: string name
3: optional list<string> server_addrs
4: string status
5: optional string description
}
enum ProcessState {
FUNCTIONAL,
NON_FUNCTIONAL,
}
const map<ProcessState, string> ProcessStateNames = {
ProcessState.FUNCTIONAL : "Functional",
ProcessState.NON_FUNCTIONAL : "Non-Functional",
}
// Sent by the process
/**
* This data is sent by each of the processes based on it's internal
* state.
*/
struct ProcessStatus {
1: string module_id
2: string instance_id
3: string state
4: optional list<ConnectionInfo> connection_infos
5: optional string description
}
// Sent by the node manager
/**
* This data is sent by each of the processes based on it's internal
* state.
*/
struct DiskPartitionUsageStats {
1: string partition_type
2: string partition_name // deprecated
3: u64 partition_space_used_1k
4: u64 partition_space_available_1k
5: u16 percentage_partition_space_used
}
// Sent by the node manager
/**
* This data is sent by each the Node's nodemgr,
* state.
*/
struct ProcessInfo {
1: string process_name
2: string process_state
3: u32 start_count
4: u32 stop_count
5: u32 exit_count
// time when the process last entered running stage
6: optional string last_start_time
7: optional string last_stop_time
8: optional string last_exit_time
9: optional list<string> core_file_list
}