-
Notifications
You must be signed in to change notification settings - Fork 32
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
Add time buckets and forwarded and rebalanced volume #231
Add time buckets and forwarded and rebalanced volume #231
Conversation
0c974d0
to
dad5753
Compare
dad5753
to
080468d
Compare
080468d
to
2ee3b69
Compare
This makes it easier to generate test cases by using literal JSON.
This makes it easier to write test cases by comparing to expected values
…tracker A time source is needed for upcoming time buckets change.
This commit modifies the schema of EarningsTracker to allow storing and accessing earning and expenditure data in specific time ranges. All existing strategies and reports still use all data from all time so this PR should not change any balancing behavior. After we've run w/ this for a while we'll have time-based data collected and can evaluate how to improve the strategies.
…racker Addresses ([ZmnSCPxj#229]) This allows effective feerates (PPM) to be computed for earnings and expenses. This PR updates the schema automatically. Downgrading to previous will require manual DB migration (but is possible). Downgrade commands are in a comment in EarningsTracker.c
2ee3b69
to
c3d679d
Compare
I rebased onto master and improved the scripts output format |
c3d679d
to
c674e28
Compare
ok i'm running it
Any thing you need me to keep an eye on? Any way I can generate some history? This is a small mainnet node btw. |
okay it compiled on my raspi with any way we can add this to the Makefile? running on my raspiblitz now! :) |
@chrisguida Check out the scripts in the |
Figuring out the CXXFLAGS="-std=c++17" part next ... |
@chrisguida reports that compilation fails on raspiblitz w/o this
@chrisguida pushed a commit to configure for c++-17 ... does that fix the raspiblitz build? |
@ksedgwic works great, thanks!! :D |
@ksedgwic I tried the scripts in contrib/
how are these scripts different from the rpc commands?
also, do you have a requirements file for these scripts?
|
I need to add install stuff for the scripts, will do. |
Tested, and works! missing some python deps
|
edc2e4c
to
3b06673
Compare
This PR (includes and) extends #228 ; only the final commits of this PR are unique ...
Addresses #229
Addresses #227
IMPORTANT - This PR makes a schema change and migrates data!
Abstract
This PR modifies the
EarningsTracker
schema to hold data in "buckets", one per day. This PR only modifies the collection and storage, the strategies and existing status continue to use earnings data from all time for now.Motivation
As described in #227 there are several shortcomings w/ the current storage of
EarningsTracker
data:This PR enables time-based data earnings collection, future PR's should investigate modifying the strategies and reports to take advantage of the ability to filter by time range.
Specification
This PR updates the
EarningsTracker
table to have a "time bucket" column. The timestamps of incoming fee and balance events are quantized to a time bucket, currently one day.The existing strategies and reports use the sql
SUM
to return the same answers that they would with the current schema.The time and nodeid columns are indexed for efficient operations.
Existing legacy data is migrated into the table with a time bucket value of 0. This allows it to be considered and used but eventually be aged out.
Two new CLI commands are added to allow inspecting the new data:
clboss-recent-earnings
:offchain_earnings_tracker
collection inclboss-status
, butonly includes recent earnings and expenditures.
days
(optional): Specifies the number of days to include inthe report. Defaults to a fortnight (14 days) if not provided.
clboss-earnings-history
:nodeid
(optional): Limits the history to a particular node ifprovided. Without this argument, the values are accumulated
across all peers.
and expenditures for each day.
which contains any legacy earnings and expenditures collected by
CLBOSS before daily tracking was implemented.
This allows effective feerates (PPM) to be computed for earnings and expenses.
This PR updates the schema automatically. Downgrading to previous will require manual DB migration (but is possible).
Adds two scripts which summarize earnings data. The first summarizes earning history by date:
The second summarizes the recent earnings data: