Skip to content

Commit 488faba

Browse files
committed
Change the name and add counter
1 parent b3bfd43 commit 488faba

File tree

4 files changed

+29
-20
lines changed

4 files changed

+29
-20
lines changed

engine/execution/computation/computer/computer.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -651,17 +651,17 @@ func (e *blockComputer) executeProcessCallback(
651651
}
652652

653653
if len(callbackTxs) > 0 {
654-
// calculate total gas limits for execute callback transactions
655-
var totalExecuteGasLimits uint64
654+
// calculate total computation limits for execute callback transactions
655+
var totalExecuteComputationLimits uint64
656656
for _, tx := range callbackTxs {
657-
totalExecuteGasLimits += tx.GasLimit
657+
totalExecuteComputationLimits += tx.GasLimit
658658
}
659659

660660
// report metrics for callbacks executed
661661
e.metrics.ExecutionCallbacksExecuted(
662662
len(callbackTxs),
663663
txn.Output().ComputationUsed,
664-
totalExecuteGasLimits,
664+
totalExecuteComputationLimits,
665665
)
666666
}
667667

module/metrics.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,8 +1027,8 @@ type ExecutionMetrics interface {
10271027
// ExecutionScriptExecuted reports the time and memory spent on executing an script
10281028
ExecutionScriptExecuted(dur time.Duration, compUsed, memoryUsed, memoryEstimate uint64)
10291029

1030-
// ExecutionCallbacksExecuted reports the number of callbacks executed, gas used by process transaction, and total gas limits for execute transactions
1031-
ExecutionCallbacksExecuted(callbackCount int, processGasUsed, executeGasLimits uint64)
1030+
// ExecutionCallbacksExecuted reports the number of callbacks executed, computation used by process transaction, and total computation limits for execute transactions
1031+
ExecutionCallbacksExecuted(callbackCount int, processComputationUsed, executeComputationLimits uint64)
10321032

10331033
// ExecutionCollectionRequestSent reports when a request for a collection is sent to a collection node
10341034
ExecutionCollectionRequestSent()

module/metrics/execution.go

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,9 @@ type ExecutionCollector struct {
9999
evmBlockTxCount prometheus.Histogram
100100
evmBlockGasUsed prometheus.Histogram
101101
callbacksExecutedCount prometheus.Histogram
102-
callbacksProcessGasUsed prometheus.Histogram
103-
callbacksExecuteGasLimits prometheus.Histogram
102+
callbacksExecutedTotal prometheus.Counter
103+
callbacksProcessComputationUsed prometheus.Histogram
104+
callbacksExecuteComputationLimits prometheus.Histogram
104105
}
105106

106107
func NewExecutionCollector(tracer module.Tracer) *ExecutionCollector {
@@ -805,19 +806,26 @@ func NewExecutionCollector(tracer module.Tracer) *ExecutionCollector {
805806
Buckets: prometheus.ExponentialBuckets(1, 2, 8),
806807
}),
807808

808-
callbacksProcessGasUsed: promauto.NewHistogram(prometheus.HistogramOpts{
809+
callbacksExecutedTotal: promauto.NewCounter(prometheus.CounterOpts{
809810
Namespace: namespaceExecution,
810811
Subsystem: subsystemRuntime,
811-
Name: "callbacks_process_gas_used",
812-
Help: "the gas used by the process callback transaction",
812+
Name: "callbacks_executed_total",
813+
Help: "the total number of callbacks executed",
814+
}),
815+
816+
callbacksProcessComputationUsed: promauto.NewHistogram(prometheus.HistogramOpts{
817+
Namespace: namespaceExecution,
818+
Subsystem: subsystemRuntime,
819+
Name: "callbacks_process_computation_used",
820+
Help: "the computation used by the process callback transaction",
813821
Buckets: prometheus.ExponentialBuckets(10_000, 2, 12),
814822
}),
815823

816-
callbacksExecuteGasLimits: promauto.NewHistogram(prometheus.HistogramOpts{
824+
callbacksExecuteComputationLimits: promauto.NewHistogram(prometheus.HistogramOpts{
817825
Namespace: namespaceExecution,
818826
Subsystem: subsystemRuntime,
819-
Name: "callbacks_execute_gas_limits",
820-
Help: "the total gas limits for execute callback transactions",
827+
Name: "callbacks_execute_computation_limits",
828+
Help: "the total computation limits for execute callback transactions",
821829
Buckets: prometheus.ExponentialBuckets(10_000, 2, 12),
822830
}),
823831
}
@@ -911,10 +919,11 @@ func (ec *ExecutionCollector) ExecutionScriptExecuted(dur time.Duration, compUse
911919
}
912920

913921
// ExecutionCallbacksExecuted reports callback execution metrics
914-
func (ec *ExecutionCollector) ExecutionCallbacksExecuted(callbackCount int, processGasUsed, executeGasLimits uint64) {
922+
func (ec *ExecutionCollector) ExecutionCallbacksExecuted(callbackCount int, processComputationUsed, executeComputationLimits uint64) {
915923
ec.callbacksExecutedCount.Observe(float64(callbackCount))
916-
ec.callbacksProcessGasUsed.Observe(float64(processGasUsed))
917-
ec.callbacksExecuteGasLimits.Observe(float64(executeGasLimits))
924+
ec.callbacksExecutedTotal.Add(float64(callbackCount))
925+
ec.callbacksProcessComputationUsed.Observe(float64(processComputationUsed))
926+
ec.callbacksExecuteComputationLimits.Observe(float64(executeComputationLimits))
918927
}
919928

920929
// ExecutionStateStorageDiskTotal reports the total storage size of the execution state on disk in bytes

module/mock/execution_metrics.go

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)