Skip to content

Commit cf7ec28

Browse files
committed
Rename soroban config metrics to be regex friendly
1 parent 08d44f2 commit cf7ec28

File tree

2 files changed

+40
-42
lines changed

2 files changed

+40
-42
lines changed

docs/metrics.md

+16-16
Original file line numberDiff line numberDiff line change
@@ -196,19 +196,19 @@ soroban.ledger.read-entry | histogram | number of entries rea
196196
soroban.ledger.read-byte | histogram | number of entry bytes in read entries per ledger
197197
soroban.ledger.write-entry | histogram | number of entries written per ledger
198198
soroban.ledger.write-byte | histogram | number of entry bytes in written entries per ledger
199-
soroban.config.contract-max-size-bytes | counter | soroban config setting `contract_max_size_bytes`
200-
soroban.config.ledger-max-instructions | counter | soroban config setting `ledger_max_instructions`
201-
soroban.config.tx-max-instructions | counter | soroban config setting `tx_max_instructions`
202-
soroban.config.tx-memory-limit | counter | soroban config setting `tx_memory_limit`
203-
soroban.config.ledger-max-read-ledger-entries | counter | soroban config setting `ledger_max_read_ledger_entries`
204-
soroban.config.ledger-max-read-bytes | counter | soroban config setting `ledger_max_read_bytes`
205-
soroban.config.ledger-max-write-ledger-entries | counter | soroban config setting `ledger_max_write_ledger_entries`
206-
soroban.config.ledger-max-write-bytes | counter | soroban config setting `ledger_max_write_bytes`
207-
soroban.config.tx-max-read-ledger-entries | counter | soroban config setting `tx_max_read_ledger_entries`
208-
soroban.config.tx-max-read-bytes | counter | soroban config setting `tx_max_read_bytes`
209-
soroban.config.tx-max-write-ledger-entries | counter | soroban config setting `tx_max_write_ledger_entries`
210-
soroban.config.tx-max-write-bytes | counter | soroban config setting `tx_max_write_bytes`
211-
soroban.config.bucket-list-target-size-bytes | counter | soroban config setting `bucket_list_target_size_bytes`
212-
soroban.config.tx-max-contract-events-size-bytes | counter | soroban config setting `tx_max_contract_events_size_bytes`
213-
soroban.config.contract-data-key-size-bytes | counter | soroban config setting `contract_data_key_size_bytes`
214-
soroban.config.contract-data-entry-size-bytes | counter | soroban config setting `contract_data_entry_size_bytes`
199+
soroban.config.contract-max-rw-key-byte | counter | soroban config setting `contract_data_key_size_bytes`
200+
soroban.config.contract-max-rw-data-byte | counter | soroban config setting `contract_data_entry_size_bytes`
201+
soroban.config.contract-max-rw-code-byte | counter | soroban config setting `contract_max_size_bytes`
202+
soroban.config.tx-max-cpu-insn | counter | soroban config setting `tx_max_instructions`
203+
soroban.config.tx-max-mem-byte | counter | soroban config setting `tx_memory_limit`
204+
soroban.config.tx-max-read-entry | counter | soroban config setting `tx_max_read_ledger_entries`
205+
soroban.config.tx-max-read-ledger-byte | counter | soroban config setting `tx_max_read_bytes`
206+
soroban.config.tx-max-write-entry | counter | soroban config setting `tx_max_write_ledger_entries`
207+
soroban.config.tx-max-write-ledger-byte | counter | soroban config setting `tx_max_write_bytes`
208+
soroban.config.tx-max-emit-event-byte | counter | soroban config setting `tx_max_contract_events_size_bytes`
209+
soroban.config.ledger-max-cpu-insn | counter | soroban config setting `ledger_max_instructions`
210+
soroban.config.ledger-max-read-entry | counter | soroban config setting `ledger_max_read_ledger_entries`
211+
soroban.config.ledger-max-read-ledger-byte | counter | soroban config setting `ledger_max_read_bytes`
212+
soroban.config.ledger-max-write-entry | counter | soroban config setting `ledger_max_write_ledger_entries`
213+
soroban.config.ledger-max-write-ledger-byte | counter | soroban config setting `ledger_max_write_bytes`
214+
soroban.config.bucket-list-target-size-byte | counter | soroban config setting `bucket_list_target_size_bytes`

src/ledger/LedgerManagerImpl.cpp

+24-26
Original file line numberDiff line numberDiff line change
@@ -645,40 +645,38 @@ LedgerManagerImpl::publishSorobanMetrics()
645645
auto contractDataEntrySizeBytes =
646646
mSorobanNetworkConfig->maxContractDataEntrySizeBytes();
647647

648-
registry.NewCounter({"soroban", "config", "contract-max-size-bytes"})
648+
registry.NewCounter({"soroban", "config", "contract-max-rw-key-byte"})
649+
.set_count(contractDataKeySizeBytes);
650+
registry.NewCounter({"soroban", "config", "contract-max-rw-data-byte"})
651+
.set_count(contractDataEntrySizeBytes);
652+
registry.NewCounter({"soroban", "config", "contract-max-rw-code-byte"})
649653
.set_count(contractMaxSizeBytes);
650-
registry.NewCounter({"soroban", "config", "ledger-max-instructions"})
651-
.set_count(ledgerMaxInstructions);
652-
registry.NewCounter({"soroban", "config", "tx-max-instructions"})
654+
registry.NewCounter({"soroban", "config", "tx-max-cpu-insn"})
653655
.set_count(txMaxInstructions);
654-
registry.NewCounter({"soroban", "config", "tx-memory-limit"})
656+
registry.NewCounter({"soroban", "config", "tx-max-mem-byte"})
655657
.set_count(txMemoryLimit);
656-
registry.NewCounter({"soroban", "config", "ledger-max-read-ledger-entries"})
657-
.set_count(ledgerMaxReadLedgerEntries);
658-
registry.NewCounter({"soroban", "config", "ledger-max-read-bytes"})
659-
.set_count(ledgerMaxReadBytes);
660-
registry
661-
.NewCounter({"soroban", "config", "ledger-max-write-ledger-entries"})
662-
.set_count(ledgerMaxWriteLedgerEntries);
663-
registry.NewCounter({"soroban", "config", "ledger-max-write-bytes"})
664-
.set_count(ledgerMaxWriteBytes);
665-
registry.NewCounter({"soroban", "config", "tx-max-read-ledger-entries"})
658+
registry.NewCounter({"soroban", "config", "tx-max-read-entry"})
666659
.set_count(txMaxReadLedgerEntries);
667-
registry.NewCounter({"soroban", "config", "tx-max-read-bytes"})
660+
registry.NewCounter({"soroban", "config", "tx-max-read-ledger-byte"})
668661
.set_count(txMaxReadBytes);
669-
registry.NewCounter({"soroban", "config", "tx-max-write-ledger-entries"})
662+
registry.NewCounter({"soroban", "config", "tx-max-write-entry"})
670663
.set_count(txMaxWriteLedgerEntries);
671-
registry.NewCounter({"soroban", "config", "tx-max-write-bytes"})
664+
registry.NewCounter({"soroban", "config", "tx-max-write-ledger-byte"})
672665
.set_count(txMaxWriteBytes);
673-
registry.NewCounter({"soroban", "config", "bucket-list-target-size-bytes"})
674-
.set_count(bucketListTargetSizeBytes);
675-
registry
676-
.NewCounter({"soroban", "config", "tx-max-contract-events-size-bytes"})
666+
registry.NewCounter({"soroban", "config", "tx-max-emit-event-byte"})
677667
.set_count(txMaxContractEventsSizeBytes);
678-
registry.NewCounter({"soroban", "config", "contract-data-key-size-bytes"})
679-
.set_count(contractDataKeySizeBytes);
680-
registry.NewCounter({"soroban", "config", "contract-data-entry-size-bytes"})
681-
.set_count(contractDataEntrySizeBytes);
668+
registry.NewCounter({"soroban", "config", "ledger-max-cpu-insn"})
669+
.set_count(ledgerMaxInstructions);
670+
registry.NewCounter({"soroban", "config", "ledger-max-read-entry"})
671+
.set_count(ledgerMaxReadLedgerEntries);
672+
registry.NewCounter({"soroban", "config", "ledger-max-read-ledger-byte"})
673+
.set_count(ledgerMaxReadBytes);
674+
registry.NewCounter({"soroban", "config", "ledger-max-write-entry"})
675+
.set_count(ledgerMaxWriteLedgerEntries);
676+
registry.NewCounter({"soroban", "config", "ledger-max-write-ledger-byte"})
677+
.set_count(ledgerMaxWriteBytes);
678+
registry.NewCounter({"soroban", "config", "bucket-list-target-size-byte"})
679+
.set_count(bucketListTargetSizeBytes);
682680

683681
// then publish the actual ledger usage
684682
mSorobanLedgerMetrics.publishAndResetMetrics();

0 commit comments

Comments
 (0)