This repository has been archived by the owner on May 15, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Using the RCP call "confirmation_history" to retrieve past confirmation durations.
Collect data and calculate average, 50th, 75th, 90th, 95th and 99th percentiles over last 10minutes or 2048 values max. Also output number of blocks used in the calculation and the total timespan in ms. During high TPS on the network, the timespan will be smaller and limited to 2048 tx.
Added to api json output:
"confirmationInfo":{"count":110,"timeSpan":544570,"average":1872,"percentile50":1396,"percentile75":"2091","percentile90":3359,"percentile95":"4319","percentile99":"12247"}
An example of how the data can be used is shown here in the Block Confirmation Times chart:
https://node.nanolinks.info/nano.html
The metrics could also be used by nanocrawler for example to track average of all monitored reps to get a measure of overall network performance.
The complete execution time, including RPC call for this addition was measured to 69ms out of 300ms total for the api.php script. Also added the total execution metric to the JSON output like so:
"apiProcTime":278}
That can help node owners to not set their cache interval too low if their node is slow.
The new json output is found here: https://monitor.nanolinks.info/api.php
If this is merged, I will also update https://github.com/Joohansson/NanoNodeGraphics to give this tool to everyone.