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
Fix user resource usage metrics #876
Conversation
The previous implementation was making incorrect use of gauges, leading to inconsistent metric values.
More correctly model the underlying database by always having a value in the memory_used column.
Codecov Report
@@ Coverage Diff @@
## master #876 +/- ##
=========================================
Coverage ? 88.58%
Complexity ? 3191
=========================================
Files ? 394
Lines ? 12813
Branches ? 877
=========================================
Hits ? 11350
Misses ? 1074
Partials ? 389
Continue to review full report at Codecov.
|
- Remove low-level state machine transition messages - Add human readable messages for major changes of state during execution
@@ -93,7 +92,7 @@ public void eventNotAccepted(final Message<Events> event) { | |||
*/ | |||
@Override | |||
public void transition(final Transition<States, Events> transition) { | |||
UserConsole.getLogger().info( | |||
log.info( |
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.
Is it intentional to not use UserConsole.getLogger()?
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.
Yes, this was printing the agent state machine transition changes in the user terminal.
That's a bit too low level, so I'm just sending it to the log file instead.
this.activeUsersCount.set(summaries.size()); | ||
|
||
// Track users who previously had jobs but no longer do | ||
final Set<String> usersToReset = Sets.newHashSet(this.userResourcesRecordMap.keySet()); |
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.
Can use Sets.difference(this.userResourcesRecordMap.keySet(),summaries.keySet())
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.
There are a couple of ways, such as Sets.difference
that do look better in terms of readability. However they produce views of the sets and then throw ConcurrentModificationException
when I'm iterating this difference and removing from the map.
No description provided.