Skip to content

Commit 92b6e5a

Browse files
authored
Add price update counter for price-feeder (#690)
1 parent 84f9a25 commit 92b6e5a

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

utils/metrics/metrics_util.go

+12
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,15 @@ func SetThroughputMetric(metricName string, value float32) {
149149
"sei", "throughput", metricName,
150150
)
151151
}
152+
153+
// Measures number of times a denom's price is updated
154+
// Metric Name:
155+
//
156+
// sei_oracle_price_update_count
157+
func IncrPriceUpdateDenom(denom string) {
158+
telemetry.IncrCounterWithLabels(
159+
[]string{"sei", "oracle", "price", "update"},
160+
1,
161+
[]metrics.Label{telemetry.NewLabel("denom", denom)},
162+
)
163+
}

x/oracle/abci.go

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"sort"
55
"time"
66

7+
"github.com/sei-protocol/sei-chain/utils/metrics"
78
"github.com/sei-protocol/sei-chain/x/oracle/keeper"
89
"github.com/sei-protocol/sei-chain/x/oracle/types"
910
"github.com/sei-protocol/sei-chain/x/oracle/utils"
@@ -90,6 +91,7 @@ func MidBlocker(ctx sdk.Context, k keeper.Keeper) {
9091
}
9192

9293
// Set the exchange rate, emit ABCI event
94+
metrics.IncrPriceUpdateDenom(denom)
9395
k.SetBaseExchangeRateWithEvent(ctx, denom, exchangeRate)
9496
}
9597
}

0 commit comments

Comments
 (0)