Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
CAD-1073 scripts | analyses: simplify automation
- Loading branch information
Showing
7 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
|
||
grep --no-filename -F 'MsgBlock' "$@" | | ||
jq 'def katip_timestamp_to_iso8601: | ||
.[:-4] + "Z"; | ||
. | ||
| map | ||
( (.at | katip_timestamp_to_iso8601) | ||
as $date_iso | ||
| { date_iso: $date_iso | ||
, timestamp: $date_iso | fromdateiso8601 | ||
, blkid: .data.msg.blkid | ||
, txs: (.data.msg.txids | length) | ||
} | ||
) | ||
| sort_by (.timestamp) | ||
| .[] | ||
' --slurp --compact-output |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh | ||
|
||
grep -Fh '"TraceAddBlockEvent.AddedBlockToQueue"' "$@" | | ||
jq '. | ||
| { timestamp: .at | ||
, host: .host | ||
, slot: .data.block.slot | ||
, kind: .data.kind | ||
} | ||
' --compact-output |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh | ||
|
||
grep -Fh '"TraceAddBlockEvent.AddedToCurrentChain"' "$@" | | ||
jq '. | ||
| { timestamp: .at | ||
, host: .host | ||
, slot: .data.headers[0].slotNo | ||
, kind: .data.kind | ||
} | ||
' --compact-output |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/sh | ||
|
||
grep -Fh '"TraceMempoolRejectedTx"' "$@" | | ||
jq 'def katip_timestamp_to_iso8601: | ||
.[:-4] + "Z"; | ||
. | ||
| map | ||
( (.at | katip_timestamp_to_iso8601) | ||
as $date_iso | ||
| { date_iso: $date_iso | ||
, timestamp: ($date_iso | fromdateiso8601) | ||
, host: .host | ||
, txid: .data.tx.txid[5:] | ||
, err: .data.err | ||
}) | ||
| sort_by (.timestamp) | ||
| .[] | ||
' --slurp --compact-output |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
|
||
jq '[ .timestamp, .kind, .slot | tostring ] | ||
| @csv | ||
' --raw-output "$@" | | ||
sed -e 's/\([0-9-]\+\)T\([0-9:.]\+\)Z/\1 \2/; s_"__g' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
|
||
jq '[ .timestamp, .kind, .slot | tostring ] | ||
| @csv | ||
' --raw-output "$@" | | ||
sed -e 's/\([0-9-]\+\)T\([0-9:.]\+\)Z/\1 \2/; s_"__g' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/sh | ||
|
||
jq 'def nodename_to_index: | ||
.[5:]; | ||
[ .date_iso | ||
, (.host | nodename_to_index) | ||
, .txid | ||
, .err | ||
] | ||
| join(",") | ||
' --raw-output "$@" | | ||
sed -e 's/\([0-9-]\+\)T\([0-9:.]\+\)Z/\1 \2/; s_"__g' |