Skip to content

Commit

Permalink
feat: eval duration metric
Browse files Browse the repository at this point in the history
  • Loading branch information
icorderi committed Jun 16, 2023
1 parent c898718 commit 5d330b7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ledger/eval/eval.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"errors"
"fmt"
"sync"
"time"

"github.com/algorand/go-algorand/config"
"github.com/algorand/go-algorand/crypto"
Expand Down Expand Up @@ -1599,6 +1600,11 @@ func (validator *evalTxValidator) run() {
// AddBlock: Eval(context.Background(), l, blk, false, txcache, nil)
// tracker: Eval(context.Background(), l, blk, false, txcache, nil)
func Eval(ctx context.Context, l LedgerForEvaluator, blk bookkeeping.Block, validate bool, txcache verify.VerifiedTransactionCache, executionPool execpool.BacklogPool, tracer logic.EvalTracer) (ledgercore.StateDelta, error) {
start := time.Now()
defer func() {
evalEvalDurationMicros.AddMicrosecondsSince(start, nil)
}()

// flush the pending writes in the cache to make everything read so far available during eval
l.FlushCaches()

Expand Down Expand Up @@ -1756,3 +1762,4 @@ transactionGroupLoop:

var evalCacheMissAccounts = metrics.NewCounter("eval_cache_miss_accounts", "missed accounts")
var evalPrefetchMissAccounts = metrics.NewCounter("eval_prefetch_miss_accounts", "missed accounts")
var evalEvalDurationMicros = metrics.NewCounter("eval_duration_micros", "µs spent")

0 comments on commit 5d330b7

Please sign in to comment.