Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
revert rebase, metrics renaming
  • Loading branch information
shiqizng committed Feb 14, 2022
commit 3c3e0bf31c79b99fda64637142380ce3fffcfdc0
4 changes: 2 additions & 2 deletions fetcher/fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (bot *fetcherImpl) catchupLoop(ctx context.Context) error {
blockbytes, err = aclient.BlockRaw(bot.nextRound).Do(ctx)

dt := time.Since(start)
metrics.AlgodRawBlockTimeSeconds.Observe(dt.Seconds())
metrics.GetAlgodRawBlockTimeSeconds.Observe(dt.Seconds())

if err != nil {
// If context has expired.
Expand Down Expand Up @@ -162,7 +162,7 @@ func (bot *fetcherImpl) followLoop(ctx context.Context) error {
blockbytes, err = aclient.BlockRaw(bot.nextRound).Do(ctx)

dt := time.Since(start)
metrics.AlgodRawBlockTimeSeconds.Observe(dt.Seconds())
metrics.GetAlgodRawBlockTimeSeconds.Observe(dt.Seconds())

if err == nil {
break
Expand Down
6 changes: 3 additions & 3 deletions monitoring/dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -907,11 +907,11 @@
"uid": "${DS_INDEXERPROMETHEUS}"
},
"exemplar": true,
"expr": "rate(indexer_daemon_algod_raw_block_time_sec_sum{}[1m])",
"expr": "rate(indexer_daemon_get_algod_raw_block_time_sec_sum{}[1m])",
"format": "time_series",
"instant": false,
"interval": "",
"legendFormat": "Algod Raw Block Response time(sec)",
"legendFormat": "Get Algod Raw Block Response time(sec)",
"refId": "A"
},
{
Expand Down Expand Up @@ -946,7 +946,7 @@
"options": {
"alias": "Total import time (sec)",
"binary": {
"left": "Algod Raw Block Response time(sec)",
"left": "Get Algod Raw Block Response time(sec)",
"operator": "+",
"reducer": "sum",
"right": "block import time (sec)"
Expand Down
10 changes: 5 additions & 5 deletions util/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ func RegisterPrometheusMetrics() {
prometheus.Register(ImportedRoundGauge)
prometheus.Register(BlockUploadTimeSeconds)
prometheus.Register(PostgresEvalTimeSeconds)
prometheus.Register(AlgodRawBlockTimeSeconds)
prometheus.Register(GetAlgodRawBlockTimeSeconds)
}

// Prometheus metric names broken out for reuse.
Expand All @@ -20,7 +20,7 @@ const (
ImportedTxnsPerBlockName = "imported_tx_per_block"
ImportedRoundGaugeName = "imported_round"
PostgresEvalName = "postgres_eval_time_sec"
AlgodRawBlockTimeName = "algod_raw_block_time_sec"
GetAlgodRawBlockTimeName = "get_algod_raw_block_time_sec"
)

// AllMetricNames is a reference for all the custom metric names.
Expand All @@ -30,7 +30,7 @@ var AllMetricNames = []string{
ImportedTxnsPerBlockName,
ImportedRoundGaugeName,
PostgresEvalName,
AlgodRawBlockTimeName,
GetAlgodRawBlockTimeName,
}

// Initialize the prometheus objects.
Expand Down Expand Up @@ -72,10 +72,10 @@ var (
Help: "Time spent calling Eval function in seconds.",
})

AlgodRawBlockTimeSeconds = prometheus.NewSummary(
GetAlgodRawBlockTimeSeconds = prometheus.NewSummary(
prometheus.SummaryOpts{
Subsystem: "indexer_daemon",
Name: AlgodRawBlockTimeName,
Name: GetAlgodRawBlockTimeName,
Help: "Total response time from Algod's raw block endpoint in seconds.",
})
)