ydb-platform / ydb

YDB is an open source Distributed SQL Database that combines high availability and scalability with strong consistency and ACID transactions
https://ydb.tech
Apache License 2.0
4.03k stars 587 forks source link

Collect and visualize portion distribution #11564

Open zverevgeny opened 2 weeks ago

zverevgeny commented 2 weeks ago

Tool(scritp) that:

vlad-gogov commented 1 week ago

Instructions

Example run:

python3 intersect_portions.py --parsing_file=example1.txt

run

Output in terminal:

Parsing rectangles: 100001
remaining rectangles: 90001
remaining rectangles: 80001
remaining rectangles: 70001
remaining rectangles: 60001
remaining rectangles: 50001
remaining rectangles: 40001
remaining rectangles: 30001
remaining rectangles: 20001
remaining rectangles: 10001
remaining rectangles: 1
parsing time: 14.31 seconds
count drawn rectangles: 100001

In the lower left corner, you will find a control panel that allows you to move around the graph and adjust the zoom.

Rectangles are drawn with black dotted lines. Rectangle with a zero height or width are represented as red solid lines in the drawing.

Additional args for run:

Run with max_intersect:

python3 intersect_portions.py --parsing_file=example1.txt --max_intersect

It is necessary to find the area with the maximum intersection along the X-axis.

max_intersect

Output in terminal:

Parsing rectangles: 100001
remaining rectangles: 90001
remaining rectangles: 80001
remaining rectangles: 70001
remaining rectangles: 60001
remaining rectangles: 50001
remaining rectangles: 40001
remaining rectangles: 30001
remaining rectangles: 20001
remaining rectangles: 10001
remaining rectangles: 1
parsing time: 14.02 seconds
max_intersect_interval: (2024-11-11 15:49:41+00:00, 2024-11-11 15:59:47+00:00), max count intersect: 2624
count drawn rectangles: 100001

Run with set border:

python3 intersect_portions.py --parsing_file=example1.txt --pk_min="2024-11-11 16:00:00" --pk_max="2024-11-11 18:00:00"

border

Output in terminal:

Parsing rectangles: 100001
remaining rectangles: 90001
remaining rectangles: 80001
remaining rectangles: 70001
remaining rectangles: 60001
remaining rectangles: 50001
remaining rectangles: 40001
remaining rectangles: 30001
remaining rectangles: 20001
remaining rectangles: 10001
remaining rectangles: 1
parsing time: 9.50 seconds
count drawn rectangles: 12373