-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcollector_response.go
112 lines (103 loc) · 4.38 KB
/
collector_response.go
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
package main
type nodesResponse struct {
Result nodesResponseResult `json:"result"`
Code int `json:"code"`
}
type nodesResponseResult struct {
NodeName string `json:"name"`
Release string `json:"otp_release"`
Status string `json:"node_status"`
MemoryTotal string `json:"memory_total"`
MemoryUsed string `json:"memory_used"`
ProcessesAvailable int `json:"process_available"`
ProcessesUsed int `json:"process_used"`
MaxFds int `json:"max_fds"`
Clients int `json:"clients"`
Load1 string `json:"load1"`
Load5 string `json:"load5"`
Load15 string `json:"load15"`
}
type metricsResponse struct {
Result metricsResponseResult `json:"result"`
Code int `json:"code"`
}
type metricsResponseResult struct {
MessagesDropped int `json:"messages/dropped"`
PacketsReceived int `json:"packets/received"`
PacketsPubcompReceived int `json:"packets/pubcomp/received"`
PacketsUnsuback int `json:"packets/unsuback"`
PacketsPingresp int `json:"packets/pingresp"`
PacketsPingreq int `json:"packets/pingreq"`
MessagesQos0Sent int `json:"messages/qos0/sent"`
MessagesQos2Received int `json:"messages/qos2/received"`
PacketsPubcompMissed int `json:"packets/pubcomp/missed"`
MessagesRetained int `json:"messages/retained"`
PacketsSuback int `json:"packets/suback"`
BytesSent int `json:"bytes/sent"`
PacketsPubackReceived int `json:"packets/puback/received"`
PacketsPubrecReceived int `json:"packets/pubrec/received"`
MessagesQos2Sent int `json:"messages/qos2/sent"`
PacketsPubrecSent int `json:"packets/pubrec/sent"`
PacketsPubackSent int `json:"packets/puback/sent"`
PacketsPubrelMissed int `json:"packets/pubrel/missed"`
PacketsConnect int `json:"packets/connect"`
MessagesQos1Sent int `json:"messages/qos1/sent"`
PacketsConnack int `json:"packets/connack"`
PacketsPubrelReceived int `json:"packets/pubrel/received"`
PacketsPublishReceived int `json:"packets/publish/received"`
BytesReceived int `json:"bytes/received"`
PacketsPubrelSent int `json:"packets/pubrel/sent"`
PacketsPubrecMissed int `json:"packets/pubrec/missed"`
PacketsSent int `json:"packets/sent"`
MessagesQos0Received int `json:"messages/qos0/received"`
PacketsPubcompSent int `json:"packets/pubcomp/sent"`
MessagesReceived int `json:"messages/received"`
MessagesSent int `json:"messages/sent"`
PacketsSubscribe int `json:"packets/subscribe"`
MessagesQos2Dropped int `json:"messages/qos2/dropped"`
PacketsUnsubscribe int `json:"packets/unsubscribe"`
MessagesQos1Received int `json:"messages/qos1/received"`
PacketsDisconnect int `json:"packets/disconnect"`
PacketsPublishSent int `json:"packets/publish/sent"`
PacketsPubackMissed int `json:"packets/puback/missed"`
}
type statsResponse struct {
Result statsResponseResult `json:"result"`
Code int `json:"code"`
}
type statsResponseResult struct {
ClientsCount int `json:"clients/count"`
ClientsMax int `json:"clients/max"`
RetainedCount int `json:"retained/count"`
RetainedMax int `json:"retained/max"`
RoutesCount int `json:"routes/count"`
RoutesMax int `json:"routes/max"`
SessionsCount int `json:"sessions/count"`
SessionsMax int `json:"sessions/max"`
SubscribersCount int `json:"subscribers/count"`
SubscribersMax int `json:"subscribers/max"`
SubscriptionsCount int `json:"subscriptions/count"`
SubscriptionsMax int `json:"subscriptions/max"`
TopicsCount int `json:"topics/count"`
TopicsMax int `json:"topics/max"`
}
type managementResponse struct {
Result []ManagementResponseResult `json:"result"`
Code int `json:"code"`
}
// ManagementResponseResult contains the management data for a single node
type ManagementResponseResult struct {
Name string `json:"name"`
Version string `json:"version"`
Sysdescr string `json:"sysdescr"`
Uptime string `json:"uptime"`
Datetime string `json:"datetime"`
OtpRelease string `json:"otp_release"`
NodeStatus string `json:"node_status"`
}
type combinedResponse struct {
nodes nodesResponse
metrics metricsResponse
stats statsResponse
ClusterSize int
}