-
Notifications
You must be signed in to change notification settings - Fork 795
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
Export stats #2326
Merged
Merged
Export stats #2326
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mvandeberg
suggested changes
Apr 11, 2018
stats_export_plugin_impl( stats_export_plugin& _plugin ) : | ||
_db( appbase::app().get_plugin< chain_plugin >().db() ), | ||
_self( _plugin ), | ||
_export_plugin( appbase::app().get_plugin< block_data_export_plugin >() ) |
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.
Because you are using the block_data_export_plugin
as a dependency, you should specify it in APPBASE_PLUGIN_REQUIRES
mvandeberg
approved these changes
Apr 11, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This code implements two plugins:
block_data_export_plugin
allows export of per-block data; it effectively implements Routing per-block data #2244.stats_export_plugin
uses the interface provided byblock_data_export_plugin
to dump GPO and per-user bytes per block. The intent is that this data will be consumed by a Python script for further processing.The data path implemented by
block_data_export_plugin
will be extremely useful going forward, especially when combined with a UNIX FIFO connected to some external script.I also implemented a simple thread pool to allow all available processor cores to be utilized for the JSON conversion of exported data objects. Unfortunately Boost's thread pools aren't suitable, because (1) they're marked experimental and may be subject to change in future Boost versions, and (2) there's no way to set the thread stack size, which we need because FC JSON processing uses stack very heavily.
When processing the main blockchain, approximately 40 GB of stats are produced. To minimize disk usage, you can do streaming compression of the output JSON by simply using a UNIX FIFO connected to
pbzip2
or similar.