-
Notifications
You must be signed in to change notification settings - Fork 69
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
feat: Add metrics for the number of triggers by source #904
Conversation
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the GitHub App Integration for your organization. Read more. @@ Coverage Diff @@
## master #904 +/- ##
==========================================
- Coverage 68.99% 68.69% -0.30%
==========================================
Files 195 196 +1
Lines 10858 10919 +61
==========================================
+ Hits 7491 7501 +10
- Misses 2928 2976 +48
- Partials 439 442 +3
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
metrics/triggers.go
Outdated
countByTriggerSource: map[moira.TriggerSource]Histogram{ | ||
moira.GraphiteLocal: registry.NewHistogram(triggersMetricsPrefix, string(moira.GraphiteLocal)), | ||
moira.GraphiteRemote: registry.NewHistogram(triggersMetricsPrefix, string(moira.GraphiteRemote)), | ||
moira.PrometheusRemote: registry.NewHistogram(triggersMetricsPrefix, string(moira.PrometheusRemote)), |
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.
triggers.count.source better i think?
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.
Fixed
metrics/triggers.go
Outdated
} | ||
} | ||
|
||
func (metrics *TriggersMetrics) Update(source moira.TriggerSource, count int64) { |
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.
godoc as always
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.
Added
@@ -52,6 +52,38 @@ func (connector *DbConnector) GetPrometheusTriggerIDs() ([]string, error) { | |||
return triggerIds, nil | |||
} | |||
|
|||
func (connector *DbConnector) GetTriggerCount() (map[moira.TriggerSource]int64, error) { |
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.
any test?
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.
Added a test
It may fail if the generated number has `.9999999` because of the float-precision problems
/build |
Build and push Docker images with tag: 2023-09-04.95f3170 |
1 similar comment
Build and push Docker images with tag: 2023-09-04.95f3170 |
No description provided.