forked from argoproj/argo-cd
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(event-handler): more appropriate variable naming (#349)
* chore (event-reporter): replaced redundant variables with dedicated MetricTimer structure * chore (event-reporter): renamed variable from ts -> eventProcessingStartedAt * chore (event-reporter): renamed logCtx to more appropriately named variables * Revert "chore (event-reporter): renamed logCtx to more appropriately named variables" This reverts commit 35bdffa. * chore (event-reporter): fix lint issue
- Loading branch information
1 parent
8e77c57
commit 84c0317
Showing
4 changed files
with
41 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package metrics_utils | ||
|
||
import ( | ||
"time" | ||
) | ||
|
||
type MetricTimer struct { | ||
startAt time.Time | ||
} | ||
|
||
func NewMetricTimer() *MetricTimer { | ||
return &MetricTimer{ | ||
startAt: time.Now(), | ||
} | ||
} | ||
|
||
func (m *MetricTimer) Duration() time.Duration { | ||
return time.Since(m.startAt) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters