storagenode: add new metric satellite.request (#3610)

* storagenode: add new metric satellite.request

* storagenode: metrics fixed

* switch from Counter to Meter
This commit is contained in:
Rafael Antonio Ribeiro Gomes 2019-11-19 18:11:31 -03:00 committed by GitHub
parent e9c3194c82
commit da39c71d35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 0 deletions

View File

@ -61,3 +61,5 @@ storj.io/storj/satellite/repair/checker."remote_segments_lost" IntVal
storj.io/storj/satellite/repair/checker."remote_segments_needing_repair" IntVal storj.io/storj/satellite/repair/checker."remote_segments_needing_repair" IntVal
storj.io/storj/satellite/satellitedb."audit_reputation_alpha" FloatVal storj.io/storj/satellite/satellitedb."audit_reputation_alpha" FloatVal
storj.io/storj/satellite/satellitedb."audit_reputation_beta" FloatVal storj.io/storj/satellite/satellitedb."audit_reputation_beta" FloatVal
storj.io/storj/storagenode/contact."satellite_contact_request" Meter
storj.io/storj/storagenode/gracefulexit."satellite_gracefulexit_request" Meter

View File

@ -77,6 +77,9 @@ func (chore *Chore) Run(ctx context.Context) (err error) {
interval := initialBackOff interval := initialBackOff
attempts := 0 attempts := 0
for { for {
mon.Meter("satellite_contact_request").Mark(1) //locked
err := chore.pingSatellite(ctx, satellite) err := chore.pingSatellite(ctx, satellite)
attempts++ attempts++
if err == nil { if err == nil {

View File

@ -53,6 +53,7 @@ func (chore *Chore) Run(ctx context.Context) (err error) {
err = chore.Loop.Run(ctx, func(ctx context.Context) (err error) { err = chore.Loop.Run(ctx, func(ctx context.Context) (err error) {
defer mon.Task()(&ctx)(&err) defer mon.Task()(&ctx)(&err)
chore.log.Debug("checking pending exits") chore.log.Debug("checking pending exits")
satellites, err := chore.satelliteDB.ListGracefulExits(ctx) satellites, err := chore.satelliteDB.ListGracefulExits(ctx)
@ -67,6 +68,7 @@ func (chore *Chore) Run(ctx context.Context) (err error) {
} }
for _, satellite := range satellites { for _, satellite := range satellites {
mon.Meter("satellite_gracefulexit_request").Mark(1) //locked
if satellite.FinishedAt != nil { if satellite.FinishedAt != nil {
continue continue
} }