-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Improve Akka.Cluster.Metrics collected values #6203
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
Improve Akka.Cluster.Metrics collected values #6203
Conversation
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.
LGTM but needs API approvals
// VirtualMemorySize64 is not best idea here... | ||
NodeMetrics.Types.Metric.Create(StandardMetrics.MemoryAvailable, process.VirtualMemorySize64).Value, | ||
NodeMetrics.Types.Metric.Create(StandardMetrics.MemoryUsed, GC.GetTotalMemory(false)).Value, | ||
NodeMetrics.Types.Metric.Create(StandardMetrics.MemoryAvailable, process.WorkingSet64).Value, |
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.
LGTM
We will also need to backport this to v1.5 @Arkatufus |
@Arkatufus looks like some of the MNTR specs for Akka.Cluster.Metrics are not passing. Could you investigate? |
Need a re-review. |
@Arkatufus DocFx warning check here |
// Forcing garbage collection to keep metrics more resilent to occasional allocations | ||
NodeMetrics.Types.Metric.Create(StandardMetrics.MemoryUsed, GC.GetTotalMemory(true)).Value, | ||
// VirtualMemorySize64 is not best idea here... | ||
NodeMetrics.Types.Metric.Create(StandardMetrics.MemoryUsed, process.WorkingSet64).Value, | ||
NodeMetrics.Types.Metric.Create(StandardMetrics.MemoryAvailable, process.VirtualMemorySize64).Value, |
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.
this should be working set
var metrics = new List<NodeMetrics.Types.Metric>() | ||
{ | ||
// Memory | ||
// Forcing garbage collection to keep metrics more resilent to occasional allocations | ||
NodeMetrics.Types.Metric.Create(StandardMetrics.MemoryUsed, GC.GetTotalMemory(true)).Value, |
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.
This should be GC
@@ -55,12 +55,11 @@ public NodeMetrics Sample() | |||
{ | |||
using (var process = Process.GetCurrentProcess()) |
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 wonder if this is wrong - shouldn't we just cache this value somewhere?
The right algorithm, which we can't implement on .NET Standard 2.0 without a lot of hacks: used memory = gc.totalsize OR process.workingset64 We should be measuring how close we're getting to hitting the total amount of available memory on the system as a percentage. In the meantime, we can do the following on .NET Standard 2.0: used memory = gc.totalsize This will tell us how much memory is being consumed by the .NET application itself - it won't be able to factor in issues like system memory and some unmanaged memory without the user manually calling |
Testing out the latter now - we'll go back to the drawing board if we keep running into problems getting the MNTR to pass. |
@Arkatufus needs a port to v1.5 |
* Improve collected values * Update API Verify list * Fix metrics collection * Fix documentation * Update API Verify list * Update DefaultCollector.cs * Update DefaultCollector.cs Co-authored-by: Aaron Stannard <[email protected]> (cherry picked from commit dca908b)
* Improve collected values * Update API Verify list * Fix metrics collection * Fix documentation * Update API Verify list * Update DefaultCollector.cs * Update DefaultCollector.cs Co-authored-by: Aaron Stannard <[email protected]> (cherry picked from commit dca908b)
close #4142
This improves the values collected by the metrics plugin, it does not fix the heap selector since it is still missing informations.
Heap metric based routing can only be implemented after we implement the new
EventCounters
API.