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

Batching for upload test results #12838

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions .github/scripts/analytics/upload_tests_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,9 @@ def main():
test_results_file, build_type, job_name, job_id, commit, branch, pull, run_timestamp
)
result_with_owners = get_codeowners_for_tests(codeowners, results)
prepared_for_update_rows = []
prepared_for_upload_rows = []
for index, row in enumerate(result_with_owners):
prepared_for_update_rows.append({
prepared_for_upload_rows.append({
'branch': row['branch'],
'build_type': row['build_type'],
'commit': row['commit'],
Expand All @@ -240,13 +240,18 @@ def main():
'test_id': f"{row['pull']}_{row['run_timestamp']}_{index}",
'test_name': row['test_name'],
})
print(f'upserting runs: {len(prepared_for_update_rows)} rows')
if prepared_for_update_rows:
with ydb.SessionPool(driver) as pool:
create_tables(pool, test_table_name)
bulk_upsert(driver.table_client, full_path,
prepared_for_update_rows)
print('tests updated')
print(f'upserting runs: {len(prepared_for_upload_rows)} rows')
if prepared_for_upload_rows:

batch_rows_for_upload_size = 1000
for start in range(0, len(prepared_for_upload_rows), batch_rows_for_upload_size):
batch_rows_for_upload = prepared_for_upload_rows[start:start + batch_rows_for_upload_size]
with ydb.SessionPool(driver) as pool:
create_tables(pool, test_table_name)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вынести вне цикла наверное стоит

bulk_upsert(driver.table_client, full_path,
batch_rows_for_upload)

print('tests uploaded')
else:
print('nothing to upsert')

Expand Down
1 change: 1 addition & 0 deletions ydb/core/tx/columnshard/columnshard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ void TColumnShard::Handle(TEvPrivate::TEvPeriodicWakeup::TPtr& ev, const TActorC
AFL_DEBUG(NKikimrServices::TX_COLUMNSHARD)("event", "TEvPrivate::TEvPeriodicWakeup")("tablet_id", TabletID());
SendWaitPlanStep(GetOutdatedStep());


SendPeriodicStats();
EnqueueBackgroundActivities();
ctx.Schedule(PeriodicWakeupActivationPeriod, new TEvPrivate::TEvPeriodicWakeup());
Expand Down
Loading