-
Notifications
You must be signed in to change notification settings - Fork 825
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
New metric - state duration #1468
New metric - state duration #1468
Conversation
This approach uses current subscription to
Need to perform more tests on this approach. |
Build Failed 😱 Build Id: 9b0b8dc4-0e0a-46e2-91c9-c514d9286d8c To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
5c65fd6
to
41608bd
Compare
Build Failed 😱 Build Id: f21ef69c-cbe7-41eb-83e9-5617e7987a7f To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
pkg/metrics/controller_metrics.go
Outdated
&view.View{ | ||
Name: "gameserver_state_duration", | ||
Measure: gsStateDuration, | ||
Description: "The time gameserver exist in the current state in seconds", |
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.
Gameserver state duration\lasting (seconds)
Build Failed 😱 Build Id: ed1b20fb-5d6c-41c2-86d5-145e8de25405 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
d016dc8
to
6753f40
Compare
Build Succeeded 👏 Build Id: e02053b3-be94-4a44-82c0-ec7b56d5712b The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
Does this need review of some kind? I generally don't look at PR's in Draft unless specifically asked to, but saw this one seemed to have been sitting here for some time. |
Will update this and my other PRs today. I switched to another task related to Terraform yesterday. |
6753f40
to
40b6527
Compare
Build Succeeded 👏 Build Id: fc8c0619-27b4-428e-a2de-e26b29c1f08c The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
@cyriltovena Cyril, I think I have applied all your comments. Can you please re-review? |
Build Succeeded 👏 Build Id: 407af734-0699-46b6-b79f-79f94f46288f The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
Just checking in on this. See how it's doing? |
This version was finalised. @cyriltovena one more bump on this. |
pkg/metrics/controller_metrics.go
Outdated
@@ -21,6 +21,7 @@ import ( | |||
) | |||
|
|||
var ( | |||
distributionSeconds = []float64{0, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384} |
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.
nit: I would use a different name or not use a variable.
I think this boundaries only fits your metrics.
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.
Thanks for the update I would rename it to stateDurationSeconds
.
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aLekSer, cyriltovena The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
ce06a2a
to
9d0507f
Compare
New changes are detected. LGTM label has been removed. |
It needs to switch from map to LRU cache to limit the memory usage.
State in Key could be used to test that we are not skipping some particular State changes.
Rewrited the test.
Refactored test for calcDuration - table tests are used.
Fix linter issues. Now we have namespace/fleet/gameserver/state as a key.
Added description on cache size.
9d0507f
to
b262023
Compare
State Duration Metric uses LRU cache to limit the memory usage. * Add LRU cache to calculate time for state changes State in Key could be used to test that we are not skipping some particular State changes. * Move LRU cache to a controller local field * Fixed return parameters for calcDuration Rewrote the test. * Add negative state duration check * Return 0 duration with error Refactored test for calcDuration - table tests are used. * Add documentation for the new metric * Added Fleet to LRU key Fix linter issues. Now we have namespace/fleet/gameserver/state as a key. Added description on cache size. * Add Namespace into metric labels * Rename of StateDuration boundaries
Add
GameServer
state duration metric reusing current functionrecordGameServerStatusChanges()
For #1013
Closes #831