Skip to content
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

Only bin/graph current sync #376

Merged
merged 3 commits into from
Aug 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions bin/graph
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3

import re
import re, sys
from matplotlib.pyplot import *
from dataclasses import dataclass

Expand All @@ -19,31 +19,41 @@ pat = re.compile(
blocks = [
Block(**{k : int(v) for k, v in group.items()})
for group in [
match.groupdict() for match in pat.finditer(open('ord.log').read())
match.groupdict() for match in pat.finditer(open(sys.argv[1]).read())
]
]

start = 0

for i in range(len(blocks)):
if blocks[i].height == 1:
start = i

print(f"Skipping {start + 1} blocks from previous sync")

sync = blocks[start:]

_, (a, b, c) = subplots(3)

a.set_xlabel('Height')
a.set_ylabel('Time')
a.plot(
[block.height for block in blocks],
[block.time for block in blocks],
[block.height for block in sync],
[block.time for block in sync],
)

b.set_xlabel('Ranges')
b.set_ylabel('Time')
b.scatter(
[block.ranges for block in blocks],
[block.time for block in blocks],
[block.ranges for block in sync],
[block.time for block in sync],
)

c.set_xlabel('Tx\'s in block')
c.set_ylabel('Time')
c.scatter(
[block.transactions for block in blocks],
[block.time for block in blocks],
[block.transactions for block in sync],
[block.time for block in sync],
)

show()
6 changes: 5 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,9 @@ update-modern-normalize:
https://raw.githubusercontent.com/sindresorhus/modern-normalize/main/modern-normalize.css \
> static/modern-normalize.css

download-log host="ordinals.com":
ssh root@{{host}} 'journalctl -u ord > ord.log'
rsync --progress root@{{host}}:ord.log ord.log

graph:
./bin/graph
./bin/graph ord.log