New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementation of the context timing #542
Implementation of the context timing #542
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sebastiencs overall it looks good, I left some comments.
Also, I think it would be better to use the rusqlite
crate, seems to have a more convenient API, more users, support for transactions, etc. Some of the things may not be needed now but if we extend this to be a replacement for the current context actions storage, those are going to be come useful (because those features will help with optimizing things more).
Oh and about your questions
Good question. I am not sure yet, add some default and we can figure it out later.
For the test you can initialize the Sqlite store in-memory, and insert whatever values you want to it, no need for an on-disk file. |
In-memory SQlite database: https://sqlite.org/inmemorydb.html |
cf289bf
to
2de786c
Compare
0b982c6
to
c66a99d
Compare
This exposes the context stats on the RPC endpoint
GET /stats/context
.Data is stored in a sqlite database from the protocol runner process, where statistics are computed.
When the RPC endpoint is called, it reads from that sqlite file and formats it according to the example JSON I got.
Note that the endpoint expose only tezedge stats, even though irmin ones are in the db.