Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DetectorWriteSim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Analyze
Value stream analytics
Contributor 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
EWMSCP
DetectorWriteSim
Merge requests
!4
Python driver and data analysis part
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Python driver and data analysis part
controller
into
main
Overview
0
Commits
82
Pipelines
0
Changes
31
Merged
Juergen Hannappel
requested to merge
controller
into
main
1 year ago
Overview
0
Commits
82
Pipelines
0
Changes
31
Expand
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
e9b99abb
82 commits,
1 year ago
31 files
+
1275
−
20
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
31
Search (e.g. *.vue) (Ctrl+P)
PythonTests/main.py
0 → 100644
+
54
−
0
Options
import
random
import
time
import
os
def
create_size_list
(
length
):
start
=
16
size_l
=
[
start
*
(
2
**
i
)
for
i
in
range
(
length
)]
return
size_l
def
make_folders_local
(
output_path
):
os
.
makedirs
(
output_path
,
mode
=
0o777
,
exist_ok
=
True
)
return
output_path
def
generate_random_data
(
points
,
size
):
data
=
[]
start_time
=
time
.
time
()
for
p
in
range
(
points
):
timestamp
=
start_time
+
random
.
random
()
duration
=
random
.
uniform
(
0.0001
,
0.001
)
data
.
append
((
timestamp
,
duration
,
size
))
return
data
def
wirte_data_file
(
rnd_data
,
name
,
folder_p
):
with
open
(
f
"
./
{
folder_p
}
/
{
name
}
.dat
"
,
"
w
"
)
as
file
:
file
.
write
(
"
t duration size
\n
"
)
# Schreibe den Kopf der Datei
for
i
,
(
timestamp
,
duration
,
size
)
in
enumerate
(
rnd_data
):
if
i
==
0
:
file
.
write
(
f
"
{
timestamp
:
.
9
f
}
{
duration
:
.
9
f
}
{
size
}
\n
"
)
else
:
file
.
write
(
f
"
{
timestamp
:
.
9
f
}
{
duration
:
.
9
f
}
{
size
}
\n
"
)
num_points
=
500000
# Anzahl der gewünschten Datenpunkte
nodes
=
8
types
=
[
'
posix-close-
'
,
'
posix-open-
'
,
'
posix-write-
'
,
'
worker-burst-
'
,
'
worker-dump-
'
,
'
worker-idle-
'
,
'
worker-wait-
'
]
events
=
23
size_list
=
create_size_list
(
events
)
for
n
in
range
(
nodes
):
for
t
in
types
:
for
s
in
size_list
:
filename
=
f
'
{
t
}{
n
}
'
folder
=
f
'
test_output/Data_Set_
{
s
}
_Local
'
folder_path
=
make_folders_local
(
folder
)
random_data
=
generate_random_data
(
num_points
,
s
)
wirte_data_file
(
random_data
,
filename
,
folder_path
)
Loading