From 989c84203f07bcd349735abd22b379f47abe4687 Mon Sep 17 00:00:00 2001 From: Miguel Angel Rojo Fernandez Date: Thu, 28 Nov 2024 11:36:08 +0000 Subject: [PATCH] small change --- chain/chain.go | 4 ++-- chain/persist.go | 2 +- chain/repository.go | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/chain/chain.go b/chain/chain.go index e169550ac..52a8bc0cd 100644 --- a/chain/chain.go +++ b/chain/chain.go @@ -241,7 +241,7 @@ func (c *Chain) GetTransaction(id thor.Bytes32) (*tx.Transaction, *TxMeta, error if err != nil { return nil, nil, err } - metricTransactionRepositoryCounter().AddWithLabel(1, map[string]string{"type": "read", "target": "disk"}) + metricTransactionRepositoryCounter().AddWithLabel(1, map[string]string{"type": "read", "target": "db"}) return tx, txMeta, nil } @@ -257,7 +257,7 @@ func (c *Chain) GetTransactionReceipt(txID thor.Bytes32) (*tx.Receipt, error) { if err != nil { return nil, err } - metricReceiptRepositoryCounter().AddWithLabel(1, map[string]string{"type": "read", "target": "disk"}) + metricReceiptRepositoryCounter().AddWithLabel(1, map[string]string{"type": "read", "target": "db"}) return receipt, nil } diff --git a/chain/persist.go b/chain/persist.go index dd21e01f0..7b9e8e75c 100644 --- a/chain/persist.go +++ b/chain/persist.go @@ -90,6 +90,6 @@ func loadBlockSummary(r kv.Getter, id thor.Bytes32) (*BlockSummary, error) { if err := loadRLP(r, id[:], &summary); err != nil { return nil, err } - metricBlockRepositoryCounter().AddWithLabel(1, map[string]string{"type": "read", "target": "disk"}) + metricBlockRepositoryCounter().AddWithLabel(1, map[string]string{"type": "read", "target": "db"}) return &summary, nil } diff --git a/chain/repository.go b/chain/repository.go index 1772b5457..929a9bf80 100644 --- a/chain/repository.go +++ b/chain/repository.go @@ -171,7 +171,7 @@ func (r *Repository) saveBlock(block *block.Block, receipts tx.Receipts, conflic return nil, err } } - metricTransactionRepositoryCounter().AddWithLabel(int64(len(txs)), map[string]string{"type": "write", "target": "disk"}) + metricTransactionRepositoryCounter().AddWithLabel(int64(len(txs)), map[string]string{"type": "write", "target": "db"}) // save receipts for i, receipt := range receipts { @@ -180,7 +180,7 @@ func (r *Repository) saveBlock(block *block.Block, receipts tx.Receipts, conflic return nil, err } } - metricReceiptRepositoryCounter().AddWithLabel(int64(len(receipts)), map[string]string{"type": "write", "target": "disk"}) + metricReceiptRepositoryCounter().AddWithLabel(int64(len(receipts)), map[string]string{"type": "write", "target": "db"}) } if err := indexChainHead(headPutter, header); err != nil { return nil, err @@ -190,7 +190,7 @@ func (r *Repository) saveBlock(block *block.Block, receipts tx.Receipts, conflic if err := saveBlockSummary(hdrPutter, &summary); err != nil { return nil, err } - metricBlockRepositoryCounter().AddWithLabel(1, map[string]string{"type": "write", "target": "disk"}) + metricBlockRepositoryCounter().AddWithLabel(1, map[string]string{"type": "write", "target": "db"}) if asBest { if err := propPutter.Put(bestBlockIDKey, id[:]); err != nil { @@ -314,7 +314,7 @@ func (r *Repository) GetBlockTransactions(id thor.Bytes32) (tx.Transactions, err return nil, err } } - metricTransactionRepositoryCounter().AddWithLabel(int64(len(txs)), map[string]string{"type": "read", "target": "disk"}) + metricTransactionRepositoryCounter().AddWithLabel(int64(len(txs)), map[string]string{"type": "read", "target": "db"}) return txs, nil } return nil, nil @@ -358,7 +358,7 @@ func (r *Repository) GetBlockReceipts(id thor.Bytes32) (tx.Receipts, error) { return nil, err } } - metricReceiptRepositoryCounter().AddWithLabel(int64(len(receipts)), map[string]string{"type": "read", "target": "disk"}) + metricReceiptRepositoryCounter().AddWithLabel(int64(len(receipts)), map[string]string{"type": "read", "target": "db"}) return receipts, nil } return nil, nil