Skip to content

Commit

Permalink
small change
Browse files Browse the repository at this point in the history
  • Loading branch information
freemanzMrojo committed Nov 28, 2024
1 parent 7529f14 commit 989c842
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions chain/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion chain/persist.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
10 changes: 5 additions & 5 deletions chain/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand All @@ -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 {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 989c842

Please sign in to comment.