Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
feat: add StoreTheIndex find providers response size metric
Browse files Browse the repository at this point in the history
  • Loading branch information
guseggert committed Aug 23, 2022
1 parent a5c5f00 commit d48d898
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions metrics/definitions.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ var (

STIFindProvs = stats.Int64("sti_find_provs_total", "Total store the index find provider attempts that were found locally, or not found locally and succeeded, failed or were discarded", stats.UnitDimensionless)
STIFindProvsDuration = stats.Float64("sti_find_provs_duration_nanoseconds", "The time it took storetheindex finds from the network to succeed or fail because of timeout or completion", stats.UnitSeconds)
STIFindProvsLength = stats.Int64("sti_find_provs_length", "Number of providers returned for successful responses", stats.UnitDimensionless)

AWSRequests = stats.Int64("aws_reqs", "Requests made to AWS", stats.UnitDimensionless)
AWSRequestDurationMillis = stats.Float64("aws_req_duration", "The time it took to make an AWS request and receive a response", stats.UnitMilliseconds)
Expand Down Expand Up @@ -202,6 +203,11 @@ var (
TagKeys: []tag.Key{KeyName, KeyStatus},
Aggregation: view.Sum(),
}
STIFindProvsLengthView = &view.View{
Measure: STIFindProvsLength,
TagKeys: []tag.Key{KeyName},
Aggregation: defaultProvidersDistribution,
}
// DHT views
ReceivedMessagesView = &view.View{
Measure: dhtmetrics.ReceivedMessages,
Expand Down
1 change: 1 addition & 0 deletions providers/reframe.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func (x *reframeProvider) GetProviders(ctx context.Context, key []byte) ([]peer.
recordReframeFindProvsComplete(ctx, metricsErrStr(err), time.Since(start))
} else {
recordReframeFindProvsComplete(ctx, "Success", time.Since(start))
stats.Record(ctx, metrics.STIFindProvsLength.M(int64(len(peers))))
}
return peers, err
}
Expand Down

0 comments on commit d48d898

Please sign in to comment.