-
Notifications
You must be signed in to change notification settings - Fork 584
WIP: Provide zones and endpoints (ex local) stats via /v1/status #6499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
379efe5
to
3f0f133
Compare
Windows builds are failing with
|
3d64536
to
30016a6
Compare
{
"results": [
{
"name": "ClusterStats",
"perfdata": [],
"status": {
"cluster": {
"node1": {
"endpoints": {
"node2": {
"connected": true,
"last_message_received": 1533213463.691841
}
},
"mtime": 1533213470.259481,
"uptime": 117.08613300323486,
"version": "v2.9.1-40-g30016a662"
},
"node2": {
"endpoints": {
"node1": {
"connected": true,
"last_message_received": 1533213453.690339
},
"node3": {
"connected": true,
"last_message_received": 1533213463.13135
}
},
"mtime": 1533213463.690132,
"uptime": 110.51873183250427,
"version": "v2.9.1-40-g30016a662"
},
"node3": {
"endpoints": {
"node2": {
"connected": true,
"last_message_received": 1533213453.69121
}
},
"mtime": 1533213463.129759,
"uptime": 110.31669497489929,
"version": "v2.9.1-40-g30016a662"
}
}
}
}
]
} |
lib/remote/statsreporter.cpp
Outdated
{ | ||
Dictionary::Ptr message; | ||
|
||
for (auto& zone : Zone::GetLocalZone()->GetAllParents()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That will lead into many messages. When we talked about the possible algorithm here, I thought of sending the status to the immediate parent zone (and all endpoints), they update their local cache with what they receive from child zone, and then generate a new cluster message with aggregated data. That way the data may not be "live" but is always bound to "next hop, next hop".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right and this was an #ElephantOversight.
lib/remote/statsreporter.cpp
Outdated
Dictionary::Ptr allStats (rawStats); | ||
|
||
if (allStats) { | ||
// For security reasons |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please explain that in this comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed it.
lib/remote/zone.cpp
Outdated
{"messages_sent_per_second", (Array::Ptr)new Array}, | ||
{"messages_received_per_second", (Array::Ptr)new Array}, | ||
{"bytes_sent_per_second", (Array::Ptr)new Array}, | ||
{"bytes_received_per_second", (Array::Ptr)new Array} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the Array::Ptr casts and just use new Array()
.
((Array::Ptr)endpointStats->Get("messages_sent_per_second"))->Add(endpoint->GetMessagesSentPerSecond()); | ||
((Array::Ptr)endpointStats->Get("messages_received_per_second"))->Add(endpoint->GetMessagesReceivedPerSecond()); | ||
((Array::Ptr)endpointStats->Get("bytes_sent_per_second"))->Add(endpoint->GetBytesSentPerSecond()); | ||
((Array::Ptr)endpointStats->Get("bytes_received_per_second"))->Add(endpoint->GetBytesReceivedPerSecond()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, the Array::Ptr casts are not necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid they are. If you don't believe me, try to build w/o them.
9f0735b
to
86fe578
Compare
@lippserd this was considered for IcingaDB a while ago, needs a decision on proceeding. |
@cla-bot check |
16def46
to
663916c
Compare
663916c
to
9f1541c
Compare
Just trivially rebasing some PRs allowing to do so (regardless of their status!) to run GHA at all for the green checkmark. Please don't wonder. It's weekend after all soon, so no one gets blocked... |
No description provided.