Skip to content
This repository has been archived by the owner on Feb 18, 2021. It is now read-only.

Commit

Permalink
add a metrics to indicate store replication job run (#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
datoug authored Sep 1, 2017
1 parent 08d5bef commit 9790e57
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions common/metrics/defs.go
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,8 @@ const (
StorageReplicationJobCurrentFailures
// StorageReplicationJobCurrentSuccess is the number of success job in current run
StorageReplicationJobCurrentSuccess
// StorageReplicationJobRun indicates the replication job runs
StorageReplicationJobRun

// -- Controller metrics -- //

Expand Down Expand Up @@ -1236,6 +1238,7 @@ var metricDefs = map[ServiceIdx]map[int]metricDefinition{
StorageReplicationJobMaxConsecutiveFailures: {Gauge, "storage.replication-job.max-consecutive-failures"},
StorageReplicationJobCurrentFailures: {Gauge, "storage.replication-job.current-failures"},
StorageReplicationJobCurrentSuccess: {Gauge, "storage.replication-job.current-success"},
StorageReplicationJobRun: {Gauge, "storage.replication-job.run"},
},

// definitions for Controller metrics
Expand Down
1 change: 1 addition & 0 deletions services/storehost/replicationJobRunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ func (runner *replicationJobRunner) run() {
runner.m3Client.UpdateGauge(metrics.ReplicateExtentScope, metrics.StorageReplicationJobCurrentFailures, int64(len(currentFailedJobs)))
runner.m3Client.UpdateGauge(metrics.ReplicateExtentScope, metrics.StorageReplicationJobMaxConsecutiveFailures, int64(maxConsecutiveFailures))
runner.m3Client.UpdateGauge(metrics.ReplicateExtentScope, metrics.StorageReplicationJobCurrentSuccess, int64(jobsStarted))
runner.m3Client.UpdateGauge(metrics.ReplicateExtentScope, metrics.StorageReplicationJobRun, 1)

runner.logger.WithFields(bark.Fields{
`stats`: fmt.Sprintf(`total extents: %v, remote extents:%v, opened for replication: %v, primary: %v, secondary: %v, failed: %v, success: %v`,
Expand Down

0 comments on commit 9790e57

Please sign in to comment.