Skip to content

Commit

Permalink
black
Browse files Browse the repository at this point in the history
  • Loading branch information
maximyurchuk committed May 30, 2024
1 parent 0c059e7 commit 3ee9bbc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
16 changes: 9 additions & 7 deletions ydb/ci/build_bloat/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ def generate_cpp_bloat(build_output_dir: str, result_dir: str, base_src_dir: str
result.sort()

tree = {"name": "/"}
cpp_compilation_times = []

cpp_compilation_times = []
total_compilation_time = 0.0

for duration, path, time_trace_path in result:
Expand All @@ -166,10 +166,12 @@ def generate_cpp_bloat(build_output_dir: str, result_dir: str, base_src_dir: str
additional_chunks = list(zip(inc_path, "h" * len(inc_path)))
add_to_tree(chunks + additional_chunks, inc_duration / 1000, tree)
print("{} -> {:.2f}s".format(path, duration))
cpp_compilation_times.append({
"path": path,
"time_s": duration,
})
cpp_compilation_times.append(
{
"path": path,
"time_s": duration,
}
)
total_compilation_time += duration

os.makedirs(result_dir, exist_ok=True)
Expand All @@ -181,7 +183,7 @@ def generate_cpp_bloat(build_output_dir: str, result_dir: str, base_src_dir: str

with open(os.path.join(result_dir, "output.json"), "w") as f:
json.dump(human_readable_output, f, indent=4)

propogate_area(tree)
enrich_names_with_sec(tree)

Expand Down
8 changes: 6 additions & 2 deletions ydb/ci/build_bloat/ydb_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,17 @@ def main():

if rows:
row = rows[0]
driver.table_client.bulk_upsert(DATABASE_PATH + "/code-agility/cpp_compile_time", rows, generate_column_types(row))
driver.table_client.bulk_upsert(
DATABASE_PATH + "/code-agility/cpp_compile_time", rows, generate_column_types(row)
)

row = copy.copy(common_parameters)
row["id"] = str(uuid.uuid4())
row["total_compilation_time_s"] = cpp_stats["total_compilation_time"]

driver.table_client.bulk_upsert(DATABASE_PATH + "/code-agility/total_compile_time", [row], generate_column_types(row))
driver.table_client.bulk_upsert(
DATABASE_PATH + "/code-agility/total_compile_time", [row], generate_column_types(row)
)


if __name__ == "__main__":
Expand Down

0 comments on commit 3ee9bbc

Please sign in to comment.