mirror of
https://github.com/trezor/blockbook.git
synced 2026-02-20 00:51:39 +01:00
Improve xpub cache
This commit is contained in:
@@ -32,6 +32,7 @@ type Metrics struct {
|
||||
ExplorerPendingRequests *prometheus.GaugeVec
|
||||
WebsocketPendingRequests *prometheus.GaugeVec
|
||||
SocketIOPendingRequests *prometheus.GaugeVec
|
||||
XPubCacheSize prometheus.Gauge
|
||||
}
|
||||
|
||||
// Labels represents a collection of label name -> value mappings.
|
||||
@@ -230,6 +231,13 @@ func GetMetrics(coin string) (*Metrics, error) {
|
||||
},
|
||||
[]string{"method"},
|
||||
)
|
||||
metrics.XPubCacheSize = prometheus.NewGauge(
|
||||
prometheus.GaugeOpts{
|
||||
Name: "blockbook_xpub_cache_size",
|
||||
Help: "Number of cached xpubs",
|
||||
ConstLabels: Labels{"coin": coin},
|
||||
},
|
||||
)
|
||||
|
||||
v := reflect.ValueOf(metrics)
|
||||
for i := 0; i < v.NumField(); i++ {
|
||||
|
||||
Reference in New Issue
Block a user