Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
Expetator
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
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
sepia-pub
Expetator
Commits
27b49d10
Commit
27b49d10
authored
3 years ago
by
Georges Da Costa
Browse files
Options
Downloads
Patches
Plain Diff
Adds commands *list_plot* and *csv_plot*
parent
e8c842c3
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
expetator/monitoring_csv.py
+19
-0
19 additions, 0 deletions
expetator/monitoring_csv.py
expetator/monitoring_list.py
+19
-0
19 additions, 0 deletions
expetator/monitoring_list.py
setup.py
+2
-0
2 additions, 0 deletions
setup.py
with
40 additions
and
0 deletions
expetator/monitoring_csv.py
+
19
−
0
View file @
27b49d10
import
os
import
pandas
as
pd
import
matplotlib.pyplot
as
plt
import
sys
def
read_host_csv
(
prefix
,
hostname
,
startTime
,
basename
,
fullname
,
archive_fid
=
None
):
fullpath
=
'
%s_%s/%s_%s_%s
'
%
(
basename
,
prefix
,
hostname
,
fullname
,
startTime
)
...
...
@@ -39,3 +41,20 @@ def write_run_csv(prefix, hostname, startTime, basename, fullname, hostlist, dat
def
write_bundle_csv
(
prefix
,
bundle
,
data
,
target_directory
):
for
index
,
row
in
bundle
.
iterrows
():
write_run_csv
(
prefix
,
row
.
hostname
,
row
.
startTime
,
row
.
basename
,
row
.
fullname
,
row
.
hostlist
,
data
[
index
],
target_directory
)
def
show_csv
(
filename
,
norm
=
False
):
filename
=
sys
.
argv
[
-
1
]
a
=
pd
.
read_csv
(
filename
,
sep
=
"
"
)
a
[
'
#timestamp
'
]
=
a
[
'
#timestamp
'
]
-
a
[
'
#timestamp
'
][
0
]
if
norm
:
tmp
=
(
a
/
a
.
max
())
tmp
[
'
#timestamp
'
]
=
a
[
'
#timestamp
'
]
a
=
tmp
a
.
plot
(
x
=
'
#timestamp
'
)
plt
.
show
(
block
=
True
)
def
show_csv_main
():
filename
=
sys
.
argv
[
-
1
]
norm
=
len
(
sys
.
argv
)
==
3
show_csv
(
filename
,
norm
)
This diff is collapsed.
Click to expand it.
expetator/monitoring_list.py
+
19
−
0
View file @
27b49d10
import
os
import
sys
import
json
import
pandas
as
pd
import
matplotlib.pyplot
as
plt
## Power
def
read_run_list
(
prefix
,
hostname
,
startTime
,
basename
,
fullname
,
hostlist
=
None
,
archive_fid
=
None
):
...
...
@@ -55,3 +57,20 @@ def write_bundle_list(prefix, bundle, data, target_directory):
for
index
,
row
in
bundle
.
iterrows
():
write_run_list
(
prefix
,
row
.
hostname
,
row
.
startTime
,
row
.
basename
,
row
.
fullname
,
row
.
hostlist
,
data
[
index
],
target_directory
)
def
show_list
(
filename
):
with
open
(
filename
)
as
f_id
:
data
=
json
.
load
(
f_id
)
for
name
,
timestamps
,
power
in
data
:
plt
.
plot
([
t
-
timestamps
[
0
]
for
t
in
timestamps
],
power
,
label
=
name
)
plt
.
legend
()
plt
.
show
(
block
=
True
)
def
show_list_main
():
filename
=
sys
.
argv
[
-
1
]
show_list
(
filename
)
This diff is collapsed.
Click to expand it.
setup.py
+
2
−
0
View file @
27b49d10
...
...
@@ -27,6 +27,8 @@ setuptools.setup(
entry_points
=
{
'
console_scripts
'
:
[
'
remove_watermark = expetator.remove_watermark:main
'
,
'
csv_plot = expetator.monitoring_csv:show_csv_main
'
,
'
list_plot = expetator.monitoring_list:show_list_main
'
,
]
}
...
...
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