Conversation
alexghr
left a comment
There was a problem hiding this comment.
Looks good, I'd change the callDuration to use the high resolution timer
| valueType: ValueType.INT, | ||
| }); | ||
|
|
||
| this.blockBuilderInsertions = meter.createGauge(Metrics.SEQUENCER_BLOCK_BUILD_INSERTION_TIME, { |
There was a problem hiding this comment.
Was this intended to be a histogram?
There was a problem hiding this comment.
Yeah it probably should be
| } | ||
|
|
||
| const duration = timer.s(); | ||
| const rate = duration > 0 ? totalGas.l2Gas / duration : 0; |
There was a problem hiding this comment.
Non blocking: I think it would be cool to calculate the rate in Grafana (e.g. adding to a counter the gas used after each tx)
There was a problem hiding this comment.
I don't think that would work would it? I think I actually want histograms here.
| throw new Error('Invalid response message type: ' + response.msgType + ' != ' + messageType); | ||
| } | ||
|
|
||
| this.instrumentation.recordRoundTrip(callDuration * 1000, messageType); |
There was a problem hiding this comment.
I don't think this is going to give us the resolution we want. We should be using process.hrtime for this https://nodejs.org/api/process.html#processhrtimebigint
| this.requestHistogram = meter.createHistogram(Metrics.WORLD_STATE_REQUEST_TIME, { | ||
| description: 'The round trip time of world state requests', | ||
| unit: 'microseconds', | ||
| valueType: ValueType.INT, | ||
| }); |
There was a problem hiding this comment.
This will need buckets as the ones for ms won't be applied.
|
|
||
| this.requestHistogram = meter.createHistogram(Metrics.WORLD_STATE_REQUEST_TIME, { | ||
| description: 'The round trip time of world state requests', | ||
| unit: 'microseconds', |
There was a problem hiding this comment.
| unit: 'microseconds', | |
| unit: 'us', |
| provingJobBlocks: Gauge; | ||
| provingJobTransactions: Gauge; |
There was a problem hiding this comment.
These are created as histograms.
|
|
||
| this.totalGasHistogram = meter.createHistogram(Metrics.PUBLIC_PROCESSOR_TOTAL_GAS_HISTOGRAM, { | ||
| description: 'Total gas used in block as histogram', | ||
| unit: 'gas', |
There was a problem hiding this comment.
Just a heads up that the default histogram buckets only go up to 10k
* master: (119 commits) chore(master): Release 0.68.0 (#10834) feat: enable profiling with local PXE in cli-wallet (#10736) chore: values for sepolia deployment (#10362) fix: vm_full_tests.yml (#10912) chore: disable bb-sanitizers.yml (#10901) chore: Check yarn version during bootstrap (#10910) fix(p2p): default peer score penalties (#10896) feat: Updated metrics (#10885) feat: Reduce bundle sizes, remove polyfills (#10877) chore: Replace bbup.dev link (#10908) chore(avm): extra column information in lookups (#10905) git subrepo push --branch=master noir-projects/aztec-nr git_subrepo.sh: Fix parent in .gitrepo file. [skip ci] chore: replace relative paths to noir-protocol-circuits git subrepo push --branch=master barretenberg chore: disable flake in e2e_fees/private_payments (#10898) chore(ci): disable e2e_cheat_codes.test.ts (#10897) fix: increase default heartbeat (#10891) fix(p2p): less verbose error (#10886) refactor: `contact` --> `sender` in PXE API (#10861) ...
This PR adds a number of metrics.