Reset BlockbookAppInfo metrics to avoid duplicate values

This commit is contained in:
Martin Boehm 2018-09-26 11:26:38 +02:00
parent 77d4e59f1b
commit 67e47adf04
2 changed files with 3 additions and 1 deletions

View File

@ -358,8 +358,9 @@ func blockbookAppInfoMetric(db *db.RocksDB, chain bchain.BlockChain, txCache *db
if err != nil { if err != nil {
return err return err
} }
metrics.BlockbookAppInfo.Reset()
metrics.BlockbookAppInfo.With(common.Labels{ metrics.BlockbookAppInfo.With(common.Labels{
"blockbook_version": si.Blockbook.Version, "blockbook_version": si.Blockbook.Version + time.Now().String(),
"blockbook_commit": si.Blockbook.GitCommit, "blockbook_commit": si.Blockbook.GitCommit,
"backend_version": si.Backend.Version, "backend_version": si.Backend.Version,
"backend_subversion": si.Backend.Subversion, "backend_subversion": si.Backend.Subversion,

View File

@ -67,6 +67,7 @@ func (w *SyncWorker) ResyncIndex(onNewBlock bchain.OnNewBlockFunc) error {
case errSynced: case errSynced:
// this is not actually error but flag that resync wasn't necessary // this is not actually error but flag that resync wasn't necessary
w.is.FinishedSyncNoChange() w.is.FinishedSyncNoChange()
w.metrics.IndexDBSize.Set(float64(w.db.DatabaseSizeOnDisk()))
return nil return nil
} }