Skip to content
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

Tweak metric reporter so all errors are logged #820

Merged
merged 1 commit into from
Dec 18, 2024
Merged

Conversation

rowanseymour
Copy link
Member

No description provided.

Copy link

codecov bot commented Dec 18, 2024

Codecov Report

Attention: Patch coverage is 64.00000% with 9 lines in your changes missing coverage. Please review.

Project coverage is 74.56%. Comparing base (4699fa6) to head (59dac3c).

Files with missing lines Patch % Lines
backends/rapidpro/backend.go 57.14% 7 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #820      +/-   ##
==========================================
- Coverage   74.58%   74.56%   -0.02%     
==========================================
  Files         112      112              
  Lines       13271    13275       +4     
==========================================
+ Hits         9898     9899       +1     
- Misses       2653     2655       +2     
- Partials      720      721       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -63,16 +63,16 @@ func (s *Stats) ToMetrics() []types.MetricDatum {
metrics = append(metrics, s.IncomingIgnored.metrics("IncomingIgnored")...)

for typ, d := range s.IncomingDuration { // convert to averages
avgTime := float64(d) / float64(s.IncomingRequests[typ])
metrics = append(metrics, cwatch.Datum("IncomingDuration", avgTime/float64(time.Second), types.StandardUnitSeconds, cwatch.Dimension("ChannelType", string(typ))))
avgTime := d / time.Duration(s.IncomingRequests[typ])
Copy link
Member Author

@rowanseymour rowanseymour Dec 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

d is a sum of nanosecond durations so no loss of accuracy here

@rowanseymour rowanseymour merged commit 822609f into main Dec 18, 2024
5 of 7 checks passed
@rowanseymour rowanseymour deleted the metrics_tweaks branch December 18, 2024 16:07
@github-actions github-actions bot locked and limited conversation to collaborators Dec 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants