mirror of
https://github.com/kopia/kopia.git
synced 2026-02-06 04:34:07 -05:00
chore(cli): minor metrics-related cleanups (#1995)
* stop ticker to release resources * nit: fix typo * nit: add new line at EOF
This commit is contained in:
2
.github/config.yml
vendored
2
.github/config.yml
vendored
@@ -1,2 +1,2 @@
|
||||
PR_TITLE_REGEX: /(feat|fix|breaking|build|chore|docs|style|refactor|test)\((app|cli|server|providers|deps|site|ci|infra|general)\): .*/
|
||||
COMMIT_MESSAGE_REGEX: /(feat|fix|breaking|build|chore|docs|style|refactor|test)\((app|cli|server|providers|deps|site|ci|infra|general)\): .*/
|
||||
COMMIT_MESSAGE_REGEX: /(feat|fix|breaking|build|chore|docs|style|refactor|test)\((app|cli|server|providers|deps|site|ci|infra|general)\): .*/
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
)
|
||||
|
||||
// nolint:gochecknoglobals
|
||||
var matricsPushFormats = map[string]expfmt.Format{
|
||||
var metricsPushFormats = map[string]expfmt.Format{
|
||||
"text": expfmt.FmtText,
|
||||
"proto-text": expfmt.FmtProtoText,
|
||||
"proto-delim": expfmt.FmtProtoDelim,
|
||||
@@ -68,7 +68,7 @@ func (c *observabilityFlags) setup(app *kingpin.Application) {
|
||||
|
||||
var formats []string
|
||||
|
||||
for k := range matricsPushFormats {
|
||||
for k := range metricsPushFormats {
|
||||
formats = append(formats, k)
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ func (c *observabilityFlags) startMetrics(ctx context.Context) error {
|
||||
}
|
||||
|
||||
if c.metricsPushFormat != "" {
|
||||
pusher.Format(matricsPushFormats[c.metricsPushFormat])
|
||||
pusher.Format(metricsPushFormats[c.metricsPushFormat])
|
||||
}
|
||||
|
||||
log(ctx).Infof("starting prometheus pusher on %v every %v", c.metricsPushAddr, c.metricsPushInterval)
|
||||
@@ -195,7 +195,9 @@ func (c *observabilityFlags) pushPeriodically(ctx context.Context, p *push.Pushe
|
||||
c.pushOnce(ctx, "periodic", p)
|
||||
|
||||
case <-c.stopPusher:
|
||||
ticker.Stop()
|
||||
c.pushOnce(ctx, "final", p)
|
||||
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user