-
Notifications
You must be signed in to change notification settings - Fork 13
Added more robust conditions to handle missing metrics #56
Conversation
dtregonning
left a comment
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.
Clean up extra spaces and make sure that a metric missing time, cant have proceding metrics names and values
|
|
||
| def emit_uptime(tag:, start_time:, labels:) | ||
| uptime = @scraped_at - Time.iso8601(start_time) | ||
| uptime = @scraped_at - Time.iso8601(start_time) unless start_time.nil? |
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.
please remove extra space
| emit_cpu_metrics tag: tag, metrics: container['cpu'], labels: labels | ||
| emit_memory_metrics tag: tag, metrics: container['memory'], labels: labels | ||
| emit_uptime tag: tag, start_time: container['startTime'], labels: labels unless container['startTime'].nil? | ||
| emit_cpu_metrics tag: tag, metrics: container['cpu'], labels: labels unless container['cpu'].nil? |
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.
space
08db1ce to
3f90dac
Compare
dtregonning
left a comment
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 updates CP.
Can you add unit tests for metrics not containing time to show behavior of connector handling missing time fields
acf758d to
679466c
Compare
679466c to
174b4fa
Compare
dtregonning
left a comment
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.
Thank You for adding tests - merge when ready
No description provided.