Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
locust
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Thomas Bär
locust
Commits
89ad769b
Commit
89ad769b
authored
8 months ago
by
Thomas Bär
Browse files
Options
Downloads
Patches
Plain Diff
Balken
parent
49b2c841
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
extract_logs.py
+16
-10
16 additions, 10 deletions
extract_logs.py
requirements.txt
+2
-1
2 additions, 1 deletion
requirements.txt
with
18 additions
and
11 deletions
extract_logs.py
+
16
−
10
View file @
89ad769b
...
...
@@ -5,6 +5,7 @@ import pandas as pd
import
concurrent.futures
import
pyarrow
as
pa
import
pyarrow.parquet
as
pq
from
tqdm
import
tqdm
def
clean_query
(
query_string
):
...
...
@@ -73,18 +74,23 @@ def extract_urls_from_logs():
total_urls
=
0
with
concurrent
.
futures
.
ThreadPoolExecutor
(
max_workers
=
10
)
as
executor
:
future
_to_file
=
{
future
s
=
{
executor
.
submit
(
process_file
,
file
):
file
for
file
in
files_to_process
}
for
future
in
concurrent
.
futures
.
as_completed
(
future_to_file
):
file
=
future_to_file
[
future
]
try
:
df
=
future
.
result
()
total_urls
+=
len
(
df
)
table
=
pa
.
Table
.
from_pandas
(
df
)
writer
.
write_table
(
table
)
except
Exception
as
exc
:
print
(
f
"
{
file
}
generated an exception:
{
exc
}
"
)
# Erstelle einen Fortschrittsbalken für die Gesamtanzahl der Dateien
with
tqdm
(
total
=
len
(
files_to_process
),
desc
=
"
Gesamtfortschritt
"
)
as
pbar
:
for
future
in
concurrent
.
futures
.
as_completed
(
futures
):
file
=
futures
[
future
]
try
:
df
=
future
.
result
()
total_urls
+=
len
(
df
)
table
=
pa
.
Table
.
from_pandas
(
df
)
writer
.
write_table
(
table
)
pbar
.
update
(
1
)
pbar
.
set_postfix
({
"
Datei
"
:
os
.
path
.
basename
(
file
),
"
URLs
"
:
len
(
df
)})
except
Exception
as
exc
:
print
(
f
"
{
file
}
generierte eine Ausnahme:
{
exc
}
"
)
writer
.
close
()
return
total_urls
...
...
This diff is collapsed.
Click to expand it.
requirements.txt
+
2
−
1
View file @
89ad769b
locust
locust-plugins
pandas
pyarrow
\ No newline at end of file
pyarrow
tqdm
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment