From 283f443c3e6f561fd98b5fabb975d37e28d8185d Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Thu, 25 Aug 2022 07:17:11 -0700 Subject: [PATCH 1/3] Only bin/graph current sync --- bin/graph | 24 +++++++++++++++++------- justfile | 8 ++++++-- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/bin/graph b/bin/graph index 3d96cb3933..5f77aba304 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.time for block in sync], ) show() diff --git a/justfile b/justfile index f6e09ed8f3..9daaa0d700 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 -graph: - ./bin/graph +download-log host="ordinals.com": + ssh root@{{host}} 'journalctl -u ord > ord.log' + rsync --progress root@{{host}}:ord.log ord.log + +graph host="ordinals.com": + ./bin/graph ord.log From 84f5a2eaaf7248141af83d9ddd6cce423e604074 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Thu, 25 Aug 2022 07:18:46 -0700 Subject: [PATCH 2/3] tweak --- bin/graph | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/graph b/bin/graph index 5f77aba304..c49b687a26 100755 --- a/bin/graph +++ b/bin/graph @@ -52,7 +52,7 @@ b.scatter( c.set_xlabel('Tx\'s in block') c.set_ylabel('Time') c.scatter( - [block.transactions for block in blocks], + [block.transactions for block in sync], [block.time for block in sync], ) From 398c572d9373b970e1b6a2b2367f4e7bcbd29488 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Mon, 29 Aug 2022 11:05:57 -0700 Subject: [PATCH 3/3] Don't pass host to graph --- justfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/justfile b/justfile index 9daaa0d700..df0c5e90b9 100644 --- a/justfile +++ b/justfile @@ -91,5 +91,5 @@ download-log host="ordinals.com": ssh root@{{host}} 'journalctl -u ord > ord.log' rsync --progress root@{{host}}:ord.log ord.log -graph host="ordinals.com": +graph: ./bin/graph ord.log