@@ -548,6 +548,84 @@ LedgerManagerImpl::getMutableSorobanNetworkConfig()
548
548
}
549
549
#endif
550
550
551
+ void
552
+ LedgerManagerImpl::publishSorobanNetworkConfigMetrics ()
553
+ {
554
+ releaseAssert (mSorobanNetworkConfig );
555
+ medida::MetricsRegistry& metrics = mApp .getMetrics ();
556
+
557
+ auto contractMaxSizeBytes = mSorobanNetworkConfig ->maxContractSizeBytes ();
558
+ auto ledgerMaxInstructions = mSorobanNetworkConfig ->ledgerMaxInstructions ();
559
+ auto txMaxInstructions = mSorobanNetworkConfig ->txMaxInstructions ();
560
+ auto txMemoryLimit = mSorobanNetworkConfig ->txMemoryLimit ();
561
+ auto ledgerMaxReadLedgerEntries =
562
+ mSorobanNetworkConfig ->ledgerMaxReadLedgerEntries ();
563
+ auto ledgerMaxReadBytes = mSorobanNetworkConfig ->ledgerMaxReadBytes ();
564
+ auto ledgerMaxWriteLedgerEntries =
565
+ mSorobanNetworkConfig ->ledgerMaxWriteLedgerEntries ();
566
+ auto ledgerMaxWriteBytes = mSorobanNetworkConfig ->ledgerMaxWriteBytes ();
567
+ auto txMaxReadLedgerEntries =
568
+ mSorobanNetworkConfig ->txMaxReadLedgerEntries ();
569
+ auto txMaxReadBytes = mSorobanNetworkConfig ->txMaxReadBytes ();
570
+ auto txMaxWriteLedgerEntries =
571
+ mSorobanNetworkConfig ->txMaxWriteLedgerEntries ();
572
+ auto txMaxWriteBytes = mSorobanNetworkConfig ->txMaxWriteBytes ();
573
+ auto bucketListTargetSizeBytes =
574
+ mSorobanNetworkConfig ->bucketListTargetSizeBytes ();
575
+ auto txMaxContractEventsSizeBytes =
576
+ mSorobanNetworkConfig ->txMaxContractEventsSizeBytes ();
577
+ auto contractDataKeySizeBytes =
578
+ mSorobanNetworkConfig ->maxContractDataKeySizeBytes ();
579
+ auto contractDataEntrySizeBytes =
580
+ mSorobanNetworkConfig ->maxContractDataEntrySizeBytes ();
581
+
582
+ metrics.NewMeter ({" soroban" , " config" , " contract-max-size-bytes" }, " byte" )
583
+ .Mark (contractMaxSizeBytes);
584
+ metrics.NewMeter ({" soroban" , " config" , " ledger-max-instructions" }, " insn" )
585
+ .Mark (ledgerMaxInstructions);
586
+ metrics.NewMeter ({" soroban" , " config" , " tx-max-instructions" }, " insn" )
587
+ .Mark (txMaxInstructions);
588
+ metrics.NewMeter ({" soroban" , " config" , " tx-memory-limit" }, " byte" )
589
+ .Mark (txMemoryLimit);
590
+ metrics
591
+ .NewMeter ({" soroban" , " config" , " ledger-max-read-ledger-entries" },
592
+ " entry" )
593
+ .Mark (ledgerMaxReadLedgerEntries);
594
+ metrics.NewMeter ({" soroban" , " config" , " ledger-max-read-bytes" }, " byte" )
595
+ .Mark (ledgerMaxReadBytes);
596
+ metrics
597
+ .NewMeter ({" soroban" , " config" , " ledger-max-write-ledger-entries" },
598
+ " entry" )
599
+ .Mark (ledgerMaxWriteLedgerEntries);
600
+ metrics.NewMeter ({" soroban" , " config" , " ledger-max-write-bytes" }, " byte" )
601
+ .Mark (ledgerMaxWriteBytes);
602
+ metrics
603
+ .NewMeter ({" soroban" , " config" , " tx-max-read-ledger-entries" }, " entry" )
604
+ .Mark (txMaxReadLedgerEntries);
605
+ metrics.NewMeter ({" soroban" , " config" , " tx-max-read-bytes" }, " byte" )
606
+ .Mark (txMaxReadBytes);
607
+ metrics
608
+ .NewMeter ({" soroban" , " config" , " tx-max-write-ledger-entries" }, " entry" )
609
+ .Mark (txMaxWriteLedgerEntries);
610
+ metrics.NewMeter ({" soroban" , " config" , " tx-max-write-bytes" }, " byte" )
611
+ .Mark (txMaxWriteBytes);
612
+ metrics
613
+ .NewMeter ({" soroban" , " config" , " bucket-list-target-size-bytes" },
614
+ " byte" )
615
+ .Mark (bucketListTargetSizeBytes);
616
+ metrics
617
+ .NewMeter ({" soroban" , " config" , " tx-max-contract-events-size-bytes" },
618
+ " byte" )
619
+ .Mark (txMaxContractEventsSizeBytes);
620
+ metrics
621
+ .NewMeter ({" soroban" , " config" , " contract-data-key-size-bytes" }, " byte" )
622
+ .Mark (contractDataKeySizeBytes);
623
+ metrics
624
+ .NewMeter ({" soroban" , " config" , " contract-data-entry-size-bytes" },
625
+ " byte" )
626
+ .Mark (contractDataEntrySizeBytes);
627
+ }
628
+
551
629
// called by txherder
552
630
void
553
631
LedgerManagerImpl::valueExternalized (LedgerCloseData const & ledgerData)
@@ -1222,6 +1300,7 @@ LedgerManagerImpl::updateNetworkConfig(AbstractLedgerTxn& rootLtx)
1222
1300
mSorobanNetworkConfig ->loadFromLedger (
1223
1301
rootLtx, mApp .getConfig ().CURRENT_LEDGER_PROTOCOL_VERSION ,
1224
1302
ledgerVersion);
1303
+ publishSorobanNetworkConfigMetrics ();
1225
1304
}
1226
1305
else
1227
1306
{
0 commit comments