Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions yarn-project/bb-prover/src/instrumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,18 @@ export class ProverInstrumentation {
circuitName: CircuitName,
timerOrMS: Timer | number,
) {
const s = typeof timerOrMS === 'number' ? timerOrMS / 1000 : timerOrMS.s();
this[metric].record(s, {
[Attributes.PROTOCOL_CIRCUIT_NAME]: circuitName,
});
// Simulation duration is stored in ms, while the others are stored in seconds
if (metric === 'simulationDuration') {
const ms = typeof timerOrMS === 'number' ? timerOrMS : timerOrMS.ms();
this[metric].record(Math.trunc(ms), {
[Attributes.PROTOCOL_CIRCUIT_NAME]: circuitName,
});
} else {
const s = typeof timerOrMS === 'number' ? timerOrMS / 1000 : timerOrMS.s();
this[metric].record(s, {
[Attributes.PROTOCOL_CIRCUIT_NAME]: circuitName,
});
}
}

/**
Expand Down
Loading