Skip to content

Commit db628d3

Browse files
committed
feat: First stab at urwid UI & async
- Adds async backends using asyncio for ClickHouse direct, Ralph, CSV, and CHDB/S3 using a new task management system - Adds an urwid based UI for displaying the load state as the various loads happen - Refactors several configuration variables
1 parent 077408d commit db628d3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+3921
-1319
lines changed
52 KB
Binary file not shown.

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ test::
8787
log_dir: logs
8888

8989
# xAPI statements will be generated in batches, the total number of
90-
# statements is ``num_batches * batch_size``. The batch size is the number
90+
# statements is ``num_xapi_batches * batch_size``. The batch size is the number
9191
# of statements sent to the backend (Ralph POST, ClickHouse insert, etc.)
92-
num_batches: 3
92+
num_xapi_batches: 3
9393
batch_size: 100
9494

9595
# Overall start and end date for the entire run. All xAPI statements

default_config.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CSV backend configuration
22
# #########################
3-
backend: csv_file
3+
backend: csv
44
# This can be anything smart_open can handle, a local directory or
55
# an S3 bucket, etc., but importing to ClickHouse only supports S3 right now
66
# https://pypi.org/project/smart-open/
@@ -37,8 +37,13 @@ csv_load_from_s3_after: false
3737

3838
# Run options
3939
log_dir: logs
40-
num_batches: 3
41-
batch_size: 100
40+
num_xapi_batches: 300
41+
batch_size: 1000
42+
43+
# This number is used for each QueueBackend that use workers, so the number of threads if
44+
# multiplicative. Generally this performs best less than 10, as more threads will cost more
45+
# in context switching than they save.
46+
num_workers: 4
4247

4348
# Overall start and end date for the entire run
4449
start_date: 2014-01-01

example_configs/clickhouse_example.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ s3_secret: ...
1212

1313
# Run options
1414
log_dir: logs
15-
num_batches: 3
15+
num_xapi_batches: 3
1616
batch_size: 100
1717

1818
# Overall start and end date for the entire run

example_configs/large_csv_load.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ s3_secret: ...
2424

2525
# Run options
2626
log_dir: logs
27-
num_batches: 100000
27+
num_xapi_batches: 100000
2828
batch_size: 10000
2929

3030
# Overall start and end date for the entire run

example_configs/local_csv.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ csv_output_destination: logs
55

66
# Run options
77
log_dir: logs
8-
num_batches: 3
8+
num_xapi_batches: 3
99
batch_size: 100
1010

1111
# Overall start and end date for the entire run

example_configs/ralph_clickhouse_example.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ lrs_password: test
1212

1313
# Run options
1414
log_dir: logs
15-
num_batches: 3
15+
num_xapi_batches: 3
1616
batch_size: 100
1717

1818
# Overall start and end date for the entire run

example_configs/s3_csv.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ csv_load_from_s3_after: false
99

1010
# Run options
1111
log_dir: logs
12-
num_batches: 3
12+
num_xapi_batches: 3
1313
batch_size: 100
1414

1515
# Overall start and end date for the entire run

example_configs/s3_csv_clickhouse.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ s3_secret: ...
2424

2525
# Run options
2626
log_dir: logs
27-
num_batches: 3
27+
num_xapi_batches: 3
2828
batch_size: 100
2929

3030
# Overall start and end date for the entire run

requirements/base.in

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
# Core requirements for using this application
22
-c constraints.txt
33

4-
click
5-
clickhouse-connect>=0.5,<0.7
6-
pyyaml
7-
requests
8-
smart_open[s3]
4+
chdb # Embedded ClickHouse client
5+
click # Command line interface library
6+
clickhouse-connect # ClickHouse client
7+
pyyaml # YAML parser
8+
requests # HTTP library
9+
smart_open[s3] # Consistent file handing between local and object storage
10+
urwid # Console UI library
11+
uvloop # Improved performance with asyncio

0 commit comments

Comments
 (0)