Skip to content

Commit

Permalink
ops: cleanup collapse query logs, add sha tag to clustering script
Browse files Browse the repository at this point in the history
  • Loading branch information
cdxker authored and densumesh committed Jul 23, 2024
1 parent 0bf5ffe commit 32ef0e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/push-clustering-script.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
trieve/clickhouse-clustering
tags: |
type=raw,latest
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@v5
Expand Down
5 changes: 2 additions & 3 deletions docker/collapse-query-script/collapse_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def set_dataset_last_collapsed(
last_collapsed: datetime.datetime,
):
delete_dataset_last_collapsed(client, dataset_id)
print("setting last collapsed for", dataset_id, last_collapsed)

client.insert(
"last_collapsed_dataset",
[
Expand Down Expand Up @@ -116,7 +116,6 @@ def collapse_queries(rows):
elif row[1].startswith(cur_row[1]):
# Check if the current row's timestamp is within 10 seconds of the previous row
time_difference = (row[3] - cur_row[3]).total_seconds()
print(time_difference)
if time_difference <= 10:
rows_to_be_deleted.append(cur_row)
cur_row = row
Expand Down Expand Up @@ -156,7 +155,7 @@ def main():

last_collapsed = get_dataset_last_collapsed(client, dataset_id)

print("last collapsed", last_collapsed, "dataset_id", dataset_id)
print("Collapsing dataset ", dataset_id, "from ", last_collapsed)

num_deleted = 0

Expand Down

0 comments on commit 32ef0e4

Please sign in to comment.