forked from XRPLF/rippled
-
Notifications
You must be signed in to change notification settings - Fork 1
Consensus sim flatten distributed #3
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
Open
jmmcgee
wants to merge
15
commits into
bachase:consensus-sim-flatten
Choose a base branch
from
jmmcgee:consensus-sim-flatten-distributed
base: consensus-sim-flatten
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
6ce5330
[FOLD] Separate Scheduler from BasicNetwork
bachase cf05599
[FOLD] Remove tagged_integer multi-inheritance
bachase ab85692
[FOLD] Add Digraph
bachase 2f5a582
[FOLD] Use Digraph in BasicNetwork
bachase 0a76b6c
[FOLD] Prepare for CSF redesign:
bachase b3afd73
Redesign CSF framework:
jmmcgee ed0c326
[FOLD] Add CSF readme
bachase d5d2227
[FOLD] Address PR comments
bachase 73dba2e
[FOLD] Use proper closeTime when accepting ledger
bachase 1bc30ed
[FOLD] Address PR comments
bachase 8712d36
[FOLD] python script to visualize simulation data
jmmcgee fa89ca7
[FOLD] Added threading to DistributedValidators:
jmmcgee 4be10f6
[FOLD] Tx submission follows exponential distribution
jmmcgee 6c4d436
[FOLD] Add random delay generation
jmmcgee 88a8094
[FOLD] Specify duration at runtime
jmmcgee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| import sys | ||
| import csv | ||
| import json | ||
| import matplotlib | ||
|
|
||
| import matplotlib.pyplot as plt | ||
| from matplotlib.backends.backend_pdf import PdfPages | ||
|
|
||
| def plotGraph(report, keys): | ||
| with open(report, 'rb') as csvfile: | ||
| csvReader = csv.reader(csvfile, delimiter='|', quotechar='$') | ||
| dictReader = csv.DictReader(csvfile, delimiter='|', quotechar='$') | ||
|
|
||
| byN = dict() | ||
| byDelay = dict() | ||
|
|
||
| # populate byN | ||
| for row in dictReader: | ||
| tag = json.loads(row["tag"]) | ||
| numPeers = tag["numPeers"] | ||
| delay = tag["delay"] | ||
|
|
||
| if not numPeers in byN: | ||
| byN[numPeers] = dict() | ||
| byN[numPeers][delay] = row | ||
| if not delay in byDelay: | ||
| byDelay[delay] = dict() | ||
| byDelay[delay][numPeers] = row | ||
|
|
||
| ## tx.csv | ||
| for (numPeers, delayRows) in sorted(byN.iteritems()): | ||
| delays = list() | ||
| values = dict() | ||
| for key in keys: | ||
| values[key] = list() | ||
|
|
||
| # collect measured values into lists by delay for a given numPeers | ||
| for (delay, row) in sorted(delayRows.iteritems()): | ||
| delays.append(delay) | ||
| for key in keys: | ||
| values[key].append(row[key]) | ||
|
|
||
| # plot one line on each figure corresponding to run of sim with fixed | ||
| # numPeers and varying delays for a given measure | ||
|
|
||
| for key in keys: | ||
| plt.figure(key) | ||
| plt.plot(delays, values[key], alpha=0.2, label=str(numPeers)) | ||
|
|
||
| pdf = PdfPages(report + ".pdf") | ||
|
|
||
| for key in keys: | ||
| fig = plt.figure(key) | ||
| plt.title(report + "\n" + key) | ||
| plt.xlabel("delays") | ||
| plt.ylabel(key) | ||
| #plt.legend(loc='best') | ||
|
|
||
| pdf.savefig(fig) | ||
| pdf.close() | ||
|
|
||
| txStats = ( | ||
| "txNumSubmitted", | ||
| "txNumAccepted", | ||
| "txNumValidated", | ||
| "txNumOrphaned", | ||
| "txUnvalidated", | ||
| "txRateSumbitted", | ||
| "txRateAccepted", | ||
| "txRateValidated", | ||
| "txLatencySubmitToAccept10Pctl", | ||
| "txLatencySubmitToAccept50Pctl", | ||
| "txLatencySubmitToAccept90Pctl", | ||
| "txLatencySubmitToValidate10Pctl", | ||
| "txLatencySubmitToValidate50Pctl", | ||
| "txLatencySubmitToValidate90Pctl", | ||
| ) | ||
|
|
||
| ledgerStats = ( | ||
| "ledgerNumAccepted", | ||
| "ledgerNumFullyValidated", | ||
| "ledgerRateAccepted", | ||
| "ledgerRateFullyValidated", | ||
| "ledgerLatencyAcceptToAccept10Pctl", | ||
| "ledgerLatencyAcceptToAccept50Pctl", | ||
| "ledgerLatencyAcceptToAccept90Pctl", | ||
| "ledgerLatencyFullyValidToFullyValid10Pctl", | ||
| "ledgerLatencyFullyValidToFullyValid50Pctl", | ||
| "ledgerLatencyFullyValidToFullyValid90Pctl", | ||
| ) | ||
|
|
||
| for report in sys.argv[1:]: | ||
| if "tx" in report: | ||
| keys = txStats | ||
| print("Generating tx graphs from '" + report + "'") | ||
| elif "ledger" in report: | ||
| keys = ledgerStats | ||
| print("Generating ledger graphs from '" + report + "'") | ||
| plotGraph(report, keys) | ||
|
|
||
|
|
||
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
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.
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.
Is it worth inferring the keys from the file itself?
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.
Definitely worth it and possible with a bit more effort. I'll look into it.