From 602ca3bba943fcf66a1b143b7ce29afec5dc6991 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Mon, 29 Aug 2022 11:46:10 -0700 Subject: [PATCH] [bin/graph] Skip previous syncs (#376) --- bin/graph | 26 ++++++++++++++++++-------- justfile | 6 +++++- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/bin/graph b/bin/graph index 3d96cb3933..c49b687a26 100755 --- a/bin/graph +++ b/bin/graph @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -import re +import re, sys from matplotlib.pyplot import * from dataclasses import dataclass @@ -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() diff --git a/justfile b/justfile index f6e09ed8f3..df0c5e90b9 100644 --- a/justfile +++ b/justfile @@ -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