Skip to content

Commit

Permalink
chore(taiko-client): add more proof generation metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha committed Jan 6, 2025
1 parent b9bd6ea commit 52daaaf
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/taiko-client/internal/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,33 @@ var (
ProverAggregationSubmissionErrorCounter = factory.NewCounter(prometheus.CounterOpts{
Name: "prover_proof_aggregation_submission_error",
})
ProverAggregationGenerationTime = factory.NewGauge(prometheus.GaugeOpts{
Name: "prover_proof_aggregation_generation_time",
})
ProverSgxProofGeneratedCounter = factory.NewCounter(prometheus.CounterOpts{
Name: "prover_proof_sgx_generated",
})
ProverSgxProofGenerationTime = factory.NewGauge(prometheus.GaugeOpts{
Name: "prover_proof_sgx_generation_time",
})
ProverSgxProofAggregationGeneratedCounter = factory.NewCounter(prometheus.CounterOpts{
Name: "prover_proof_sgx_aggregation_generated",
})
ProverR0ProofGeneratedCounter = factory.NewCounter(prometheus.CounterOpts{
Name: "prover_proof_r0_generated",
})
ProverR0ProofGenerationTime = factory.NewGauge(prometheus.GaugeOpts{
Name: "prover_proof_r0_generation_time",
})
ProverR0ProofAggregationGeneratedCounter = factory.NewCounter(prometheus.CounterOpts{
Name: "prover_proof_r0_aggregation_generated",
})
ProverSp1ProofGeneratedCounter = factory.NewCounter(prometheus.CounterOpts{
Name: "prover_proof_sp1_generated",
})
ProverSP1ProofGenerationTime = factory.NewGauge(prometheus.GaugeOpts{
Name: "prover_proof_sp1_generation_time",
})
ProverSp1ProofAggregationGeneratedCounter = factory.NewCounter(prometheus.CounterOpts{
Name: "prover_proof_sp1_aggregation_generated",
})
Expand Down
2 changes: 2 additions & 0 deletions packages/taiko-client/prover/proof_producer/sgx_producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ func (s *SGXProofProducer) requestBatchProof(
"time", time.Since(requestAt),
"producer", "SGXProofProducer",
)
metrics.ProverAggregationGenerationTime.Set(float64(time.Since(requestAt).Seconds()))

return proof, nil
}
Expand Down Expand Up @@ -390,6 +391,7 @@ func (s *SGXProofProducer) callProverDaemon(
"time", time.Since(requestAt),
"producer", "SGXProofProducer",
)
metrics.ProverSgxProofGenerationTime.Set(float64(time.Since(requestAt).Seconds()))

return proof, nil
}
Expand Down
5 changes: 5 additions & 0 deletions packages/taiko-client/prover/proof_producer/zkvm_producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@ func (s *ZKvmProofProducer) callProverDaemon(
"time", time.Since(requestAt),
"producer", "ZKvmProofProducer",
)
if s.ZKProofType == ZKProofTypeR0 {
metrics.ProverR0ProofGenerationTime.Set(float64(time.Since(requestAt).Seconds()))
} else if s.ZKProofType == ZKProofTypeSP1 {
metrics.ProverSP1ProofGenerationTime.Set(float64(time.Since(requestAt).Seconds()))
}

return proof, nil
}
Expand Down

0 comments on commit 52daaaf

Please sign in to comment.