Skip to content

Commit

Permalink
r3
Browse files Browse the repository at this point in the history
  • Loading branch information
lukedirtwalker committed Oct 16, 2019
1 parent 63496f3 commit 21e9d58
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions go/path_srv/internal/metrics/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type SyncRegLabels struct {

// Labels returns the labels.
func (l SyncRegLabels) Labels() []string {
return []string{"result", "src"}
return []string{prom.LabelResult, prom.LabelSrc}
}

// Values returns the values.
Expand All @@ -51,7 +51,7 @@ type SyncPushLabels struct {

// Labels returns the labels.
func (l SyncPushLabels) Labels() []string {
return []string{"result", "dst"}
return []string{prom.LabelResult, "dst"}
}

// Values returns the values.
Expand All @@ -65,7 +65,6 @@ func (l SyncPushLabels) WithResult(result string) SyncPushLabels {
return l
}

// sync contains metrics for segment synchronization.
type sync struct {
registrations *prometheus.CounterVec
pushes *prometheus.CounterVec
Expand All @@ -88,8 +87,8 @@ func (s sync) Registrations(l SyncRegLabels) prometheus.Counter {
}

// RegistrationSuccess increments registrations with the given stats.
func (s sync) RegistrationSuccess(l SyncRegLabels, new, updated int) {
s.Registrations(l.WithResult(OkRegistrationNew)).Add(float64(new))
func (s sync) RegistrationSuccess(l SyncRegLabels, inserted, updated int) {
s.Registrations(l.WithResult(OkRegistrationNew)).Add(float64(inserted))
s.Registrations(l.WithResult(OkRegiststrationUpdated)).Add(float64(updated))
}

Expand Down
2 changes: 1 addition & 1 deletion go/sciond/internal/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const (
const (
OkSuccess = prom.Success
ErrInternal = prom.ErrInternal
ErrNetwork = prom.ErrReply
ErrNetwork = prom.ErrNetwork
)

var resultLabel = []string{prom.LabelResult}
Expand Down

0 comments on commit 21e9d58

Please sign in to comment.