Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions src/detectmateperformance/match_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ def __call__(
batch: int = int(3e+6),
regex: str = r"(?P<Content>.*)"
) -> pl.DataFrame:
print("\033[46m >>>> Tree Matcher \033[0m")
print("\033[46m" + "".join([" " for _ in range(100)]) + "\033[0m")

if isinstance(logs, pl.DataFrame):
return run_batches(
Expand Down
20 changes: 14 additions & 6 deletions src/detectmateperformance/pipeline_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,13 @@ def run_batches(
) -> pl.DataFrame:

first = True
print(">>> Matching data")
for i in tqdm(range(batch, len(table) + batch, batch)):
print("\033[46m \033[0m 🛠️ Matching data")
for i in tqdm(
range(batch, len(table) + batch, batch),
desc="\033[46m \033[0m Matching logs ⏳",
unit="logs",
bar_format='{l_bar}{bar:10}{r_bar}{bar:-10b}'
):
results = func( # type: ignore
table["Content"][i-batch: i].to_list(), get_var=get_var, n_workers=n_workers
)
Expand All @@ -74,8 +79,11 @@ def run_batches(
df = pl.concat([df, add_parsed(df=table[i-batch: i], results=results)])
del results

print(">>> Postprocessing results")
return postprocessing(df)
print("\033[46m \033[0m 🛠️ Postprocessing results")
df = postprocessing(df)
print("\033[46m \033[0m ✅ Finish")
print("\033[46m" + "".join([" " for _ in range(100)]) + "\033[0m")
return df


def run_full_pipeline(
Expand All @@ -87,11 +95,11 @@ def run_full_pipeline(
regex: str = r"(?P<Content>.*)"
) -> pl.DataFrame:

print(">>> Preprocesing logs")
print("\033[46m \033[0m 🛠️ Preprocesing logs")
table = preprocessing(logs, regex=regex)

if "Content" not in table.columns:
print("!Content not found")
print("\033[46m \033[0m ⚠️ Content not found")
return table

return run_batches(
Expand Down
Loading