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

util: python script to get stats of reorg #2757

Merged
merged 2 commits into from
Nov 21, 2024
Merged

util: python script to get stats of reorg #2757

merged 2 commits into from
Nov 21, 2024

Conversation

emailtovamos
Copy link
Contributor

Description

Run this script to get stats of reorgs. Especially the validators responsible for it in some way.

Rationale

To understand reorgs.

Example

Example commands: (You can either given path to the directory which has all the .log files or just one .log file name)
python reorg_analyzer.py /path/to/logs_directory
or
python reorg_analyzer.py bsc.log

Example output is given at the end of the code.

@zzzckck
Copy link
Collaborator

zzzckck commented Nov 20, 2024

1.got this error when run: python3 check_reorg_new.py ./bsc.log.2024-11-1/

No .log files found in directory: ./bsc.log.2024-11-1/

2.Can we support regexp, like: python3 check_reorg_new.py ./bsc.log.2024-11-1*

@emailtovamos
Copy link
Contributor Author

  1. The script currently only looks for .log files. Are there .log files in ./bsc.log.2024-11-1/? If there are .log files and still it is not working then permissions issue is the only guess I can have for now. If there is permission as well, the could you give me the output of ls in that folder? So that I can check if there is any edge case in the script.
  2. ./bsc.log.2024-11-1* is supposed to be folders or files?

@zzzckck
Copy link
Collaborator

zzzckck commented Nov 20, 2024

  1. The script currently only looks for .log files. Are there .log files in ./bsc.log.2024-11-1/? If there are .log files and still it is not working then permissions issue is the only guess I can have for now. If there is permission as well, the could you give me the output of ls in that folder? So that I can check if there is any edge case in the script.

the log files may not use the ".log" suffix

  1. ./bsc.log.2024-11-1* is supposed to be folders or files?

files

=== here is layout of the log folder:

# ls ./bsc.log.2024-11-1*
./bsc.log.2024-11-10_00  ./bsc.log.2024-11-11_03  ./bsc.log.2024-11-12_06  ./bsc.log.2024-11-13_09  ./bsc.log.2024-11-14_12  ./bsc.log.2024-11-15_15  ./bsc.log.2024-11-16_18  ./bsc.log.2024-11-17_21  ./bsc.log.2024-11-19_00
./bsc.log.2024-11-10_01  ./bsc.log.2024-11-11_04  ./bsc.log.2024-11-12_07  ./bsc.log.2024-11-13_10  ./bsc.log.2024-11-14_13  ./bsc.log.2024-11-15_16  ./bsc.log.2024-11-16_19  ./bsc.log.2024-11-17_22  ./bsc.log.2024-11-19_01
./bsc.log.2024-11-10_02  ./bsc.log.2024-11-11_05  ./bsc.log.2024-11-12_08  ./bsc.log.2024-11-13_11  ./bsc.log.2024-11-14_14  ./bsc.log.2024-11-15_17  ./bsc.log.2024-11-16_20  ./bsc.log.2024-11-17_23  ./bsc.log.2024-11-19_02
./bsc.log.2024-11-10_03  ./bsc.log.2024-11-11_06  ./bsc.log.2024-11-12_09  ./bsc.log.2024-11-13_12  ./bsc.log.2024-11-14_15  ./bsc.log.2024-11-15_18  ./bsc.log.2024-11-16_21  ./bsc.log.2024-11-18_00  ./bsc.log.2024-11-19_03
./bsc.log.2024-11-10_04  ./bsc.log.2024-11-11_07  ./bsc.log.2024-11-12_10  ./bsc.log.2024-11-13_13  ./bsc.log.2024-11-14_16  ./bsc.log.2024-11-15_19  ./bsc.log.2024-11-16_22  ./bsc.log.2024-11-18_01  ./bsc.log.2024-11-19_04
./bsc.log.2024-11-10_05  ./bsc.log.2024-11-11_08  ./bsc.log.2024-11-12_11  ./bsc.log.2024-11-13_14  ./bsc.log.2024-11-14_17  ./bsc.log.2024-11-15_20  ./bsc.log.2024-11-16_23  ./bsc.log.2024-11-18_02  ./bsc.log.2024-11-19_05
./bsc.log.2024-11-10_06  ./bsc.log.2024-11-11_09  ./bsc.log.2024-11-12_12  ./bsc.log.2024-11-13_15  ./bsc.log.2024-11-14_18  ./bsc.log.2024-11-15_21  ./bsc.log.2024-11-17_00  ./bsc.log.2024-11-18_03  ./bsc.log.2024-11-19_06
./bsc.log.2024-11-10_07  ./bsc.log.2024-11-11_10  ./bsc.log.2024-11-12_13  ./bsc.log.2024-11-13_16  ./bsc.log.2024-11-14_19  ./bsc.log.2024-11-15_22  ./bsc.log.2024-11-17_01  ./bsc.log.2024-11-18_04  ./bsc.log.2024-11-19_07
./bsc.log.2024-11-10_08  ./bsc.log.2024-11-11_11  ./bsc.log.2024-11-12_14  ./bsc.log.2024-11-13_17  ./bsc.log.2024-11-14_20  ./bsc.log.2024-11-15_23  ./bsc.log.2024-11-17_02  ./bsc.log.2024-11-18_05  ./bsc.log.2024-11-19_08
./bsc.log.2024-11-10_09  ./bsc.log.2024-11-11_12  ./bsc.log.2024-11-12_15  ./bsc.log.2024-11-13_18  ./bsc.log.2024-11-14_21  ./bsc.log.2024-11-16_00  ./bsc.log.2024-11-17_03  ./bsc.log.2024-11-18_06  ./bsc.log.2024-11-19_09
./bsc.log.2024-11-10_10  ./bsc.log.2024-11-11_13  ./bsc.log.2024-11-12_16  ./bsc.log.2024-11-13_19  ./bsc.log.2024-11-14_22  ./bsc.log.2024-11-16_01  ./bsc.log.2024-11-17_04  ./bsc.log.2024-11-18_07  ./bsc.log.2024-11-19_10
./bsc.log.2024-11-10_11  ./bsc.log.2024-11-11_14  ./bsc.log.2024-11-12_17  ./bsc.log.2024-11-13_20  ./bsc.log.2024-11-14_23  ./bsc.log.2024-11-16_02  ./bsc.log.2024-11-17_05  ./bsc.log.2024-11-18_08  ./bsc.log.2024-11-19_11
./bsc.log.2024-11-10_12  ./bsc.log.2024-11-11_15  ./bsc.log.2024-11-12_18  ./bsc.log.2024-11-13_21  ./bsc.log.2024-11-15_00  ./bsc.log.2024-11-16_03  ./bsc.log.2024-11-17_06  ./bsc.log.2024-11-18_09  ./bsc.log.2024-11-19_12
./bsc.log.2024-11-10_13  ./bsc.log.2024-11-11_16  ./bsc.log.2024-11-12_19  ./bsc.log.2024-11-13_22  ./bsc.log.2024-11-15_01  ./bsc.log.2024-11-16_04  ./bsc.log.2024-11-17_07  ./bsc.log.2024-11-18_10  ./bsc.log.2024-11-19_13
./bsc.log.2024-11-10_14  ./bsc.log.2024-11-11_17  ./bsc.log.2024-11-12_20  ./bsc.log.2024-11-13_23  ./bsc.log.2024-11-15_02  ./bsc.log.2024-11-16_05  ./bsc.log.2024-11-17_08  ./bsc.log.2024-11-18_11  ./bsc.log.2024-11-19_14
./bsc.log.2024-11-10_15  ./bsc.log.2024-11-11_18  ./bsc.log.2024-11-12_21  ./bsc.log.2024-11-14_00  ./bsc.log.2024-11-15_03  ./bsc.log.2024-11-16_06  ./bsc.log.2024-11-17_09  ./bsc.log.2024-11-18_12  ./bsc.log.2024-11-19_15
./bsc.log.2024-11-10_16  ./bsc.log.2024-11-11_19  ./bsc.log.2024-11-12_22  ./bsc.log.2024-11-14_01  ./bsc.log.2024-11-15_04  ./bsc.log.2024-11-16_07  ./bsc.log.2024-11-17_10  ./bsc.log.2024-11-18_13  ./bsc.log.2024-11-19_16
./bsc.log.2024-11-10_17  ./bsc.log.2024-11-11_20  ./bsc.log.2024-11-12_23  ./bsc.log.2024-11-14_02  ./bsc.log.2024-11-15_05  ./bsc.log.2024-11-16_08  ./bsc.log.2024-11-17_11  ./bsc.log.2024-11-18_14  ./bsc.log.2024-11-19_17
./bsc.log.2024-11-10_18  ./bsc.log.2024-11-11_21  ./bsc.log.2024-11-13_00  ./bsc.log.2024-11-14_03  ./bsc.log.2024-11-15_06  ./bsc.log.2024-11-16_09  ./bsc.log.2024-11-17_12  ./bsc.log.2024-11-18_15  ./bsc.log.2024-11-19_18
./bsc.log.2024-11-10_19  ./bsc.log.2024-11-11_22  ./bsc.log.2024-11-13_01  ./bsc.log.2024-11-14_04  ./bsc.log.2024-11-15_07  ./bsc.log.2024-11-16_10  ./bsc.log.2024-11-17_13  ./bsc.log.2024-11-18_16  ./bsc.log.2024-11-19_19
./bsc.log.2024-11-10_20  ./bsc.log.2024-11-11_23  ./bsc.log.2024-11-13_02  ./bsc.log.2024-11-14_05  ./bsc.log.2024-11-15_08  ./bsc.log.2024-11-16_11  ./bsc.log.2024-11-17_14  ./bsc.log.2024-11-18_17  ./bsc.log.2024-11-19_20
./bsc.log.2024-11-10_21  ./bsc.log.2024-11-12_00  ./bsc.log.2024-11-13_03  ./bsc.log.2024-11-14_06  ./bsc.log.2024-11-15_09  ./bsc.log.2024-11-16_12  ./bsc.log.2024-11-17_15  ./bsc.log.2024-11-18_18  ./bsc.log.2024-11-19_21
./bsc.log.2024-11-10_22  ./bsc.log.2024-11-12_01  ./bsc.log.2024-11-13_04  ./bsc.log.2024-11-14_07  ./bsc.log.2024-11-15_10  ./bsc.log.2024-11-16_13  ./bsc.log.2024-11-17_16  ./bsc.log.2024-11-18_19  ./bsc.log.2024-11-19_22
./bsc.log.2024-11-10_23  ./bsc.log.2024-11-12_02  ./bsc.log.2024-11-13_05  ./bsc.log.2024-11-14_08  ./bsc.log.2024-11-15_11  ./bsc.log.2024-11-16_14  ./bsc.log.2024-11-17_17  ./bsc.log.2024-11-18_20  ./bsc.log.2024-11-19_23
./bsc.log.2024-11-11_00  ./bsc.log.2024-11-12_03  ./bsc.log.2024-11-13_06  ./bsc.log.2024-11-14_09  ./bsc.log.2024-11-15_12  ./bsc.log.2024-11-16_15  ./bsc.log.2024-11-17_18  ./bsc.log.2024-11-18_21
./bsc.log.2024-11-11_01  ./bsc.log.2024-11-12_04  ./bsc.log.2024-11-13_07  ./bsc.log.2024-11-14_10  ./bsc.log.2024-11-15_13  ./bsc.log.2024-11-16_16  ./bsc.log.2024-11-17_19  ./bsc.log.2024-11-18_22
./bsc.log.2024-11-11_02  ./bsc.log.2024-11-12_05  ./bsc.log.2024-11-13_08  ./bsc.log.2024-11-14_11  ./bsc.log.2024-11-15_14  ./bsc.log.2024-11-16_17  ./bsc.log.2024-11-17_20  ./bsc.log.2024-11-18_23

@zzzckck zzzckck merged commit 6056007 into develop Nov 21, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants