-
Notifications
You must be signed in to change notification settings - Fork 102
Fix timer os metric build formula watch #601
Fix timer os metric build formula watch #601
Conversation
Signed-off-by: Bruna Tavares <silvatavares.bruna@gmail.com>
Signed-off-by: Bruna Tavares <silvatavares.bruna@gmail.com>
…added-metrics-specific-to-rit-build-watch Signed-off-by: Bruna Tavares <silvatavares.bruna@gmail.com>
prompt.Info(watchText) | ||
|
||
startTime := time.Now().Second() | ||
w.sendMetric(float64(startTime)) |
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.
just curious, where is the start time being collected now? And how does it differ a start from an end? sendMetric
interprets it on the 2nd call?
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.
Hi, I also had this question, I just changed the location, but I didn't check the difference.
In the main it uses a function to calculate the difference.
And checking now I saw that leaving the send metric here he sends twice.
In the case of the main send metric it uses save the start time and get the time again at the end of the execution.
Signed-off-by: Bruna Tavares <silvatavares.bruna@gmail.com>
pkg/formula/watcher/watcher.go
Outdated
@@ -54,8 +57,22 @@ func New( | |||
} | |||
} | |||
|
|||
func (w *WatchManager) closeWatch() { | |||
currentTime := time.Now().Second() | |||
w.sendMetric(float64(currentTime)) |
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 this asynchronous or should the stopping
text come before it?
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.
sendMetric is asynchronous (:
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.
Just one comment but lgtm
Codecov Report
@@ Coverage Diff @@
## master #601 +/- ##
==========================================
- Coverage 80.18% 79.97% -0.21%
==========================================
Files 98 98
Lines 3265 3246 -19
==========================================
- Hits 2618 2596 -22
- Misses 462 465 +3
Partials 185 185
Continue to review full report at Codecov.
|
/merge qa |
👌 Merged branch feature/added-metrics-specific-to-rit-build-watch into qa |
🚀 |
* Added channel to listen signals Signed-off-by: Bruna Tavares <silvatavares.bruna@gmail.com> * Added signal to test Signed-off-by: Bruna Tavares <silvatavares.bruna@gmail.com> * Improves text and corrects metric delivery Signed-off-by: Bruna Tavares <silvatavares.bruna@gmail.com> Signed-off-by: Bruno N. Melo <brunonobrega.melo@gmail.com>
* Added channel to listen signals Signed-off-by: Bruna Tavares <silvatavares.bruna@gmail.com> * Added signal to test Signed-off-by: Bruna Tavares <silvatavares.bruna@gmail.com> * Improves text and corrects metric delivery Signed-off-by: Bruna Tavares <silvatavares.bruna@gmail.com> Signed-off-by: Bruno N. Melo <brunonobrega.melo@gmail.com>
- What I did
Add stop condition to the hit build formula --watch command. Now the process can be completed correctly when the user presses 'Ctrl + c'.
This corrects the timing of sending metrics that is next to the process stop.
- How to verify it
- Description for the changelog
Fix timer os metric build formula watch