Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
Collectl2plotly
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Matthias Lieber
Collectl2plotly
Commits
5c4f06a6
Commit
5c4f06a6
authored
Mar 25, 2020
by
Julius Metz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ordered yaxis
parent
f38de2d9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
9 deletions
+20
-9
Collectl2plotly/Collectl2plotly/Collectl2plotly.py
Collectl2plotly/Collectl2plotly/Collectl2plotly.py
+15
-4
readme.md
readme.md
+5
-5
No files found.
Collectl2plotly/Collectl2plotly/Collectl2plotly.py
View file @
5c4f06a6
...
...
@@ -506,6 +506,7 @@ def make_plot(cmds_data, filter_info, cmd_color, plot_settings, plotly_format_va
dict -- with plotly jsons
"""
plot_data
=
[]
# make plotly plots config
for
cmd
in
filter_info
[
needed_key
]:
plot_data
.
append
({
'x'
:
[
str
(
date
)
for
date
in
cmds_data
[
cmd
][
'datetime'
]],
...
...
@@ -667,11 +668,22 @@ def data_from_file(arguments):
if
line
.
startswith
(
b
'# Host:'
):
host
=
re
.
search
(
r
'# Host: *([^ ]+)'
,
line
.
decode
()).
group
(
1
)
data
,
filter_data
=
parse_file
(
path
,
collectl
,
shorten_cmds
,
coarsest
,
config
)
filter_infos
=
None
if
filtercmds
:
filter_infos
=
getattr
(
filter_func
,
filtertype
)(
filter_data
,
filtervalue
)
else
:
filter_infos
=
{
key
:
list
(
data
.
keys
())
for
key
in
config
[
'NEEDED_VALUES'
]}
return
host
,
data
,
filter_infos
# make new dict with sorted cmd from big to small
filter_infos_sorted
=
{}
for
metric
in
config
[
'NEEDED_VALUES'
]:
filter_infos_sorted
[
metric
]
=
[]
# go over all sorted commands and add if is not filtered out
for
(
cmd
,
_
)
in
sorted
(
filter_data
[
'commands'
].
items
(),
key
=
lambda
x
:
x
[
1
][
metric
],
reverse
=
True
):
if
not
filtercmds
or
cmd
in
filter_infos
[
metric
]:
filter_infos_sorted
[
metric
].
append
(
cmd
)
return
host
,
data
,
filter_infos_sorted
@
click
.
command
(
help
=
'Generate htmlfiles with Plotlyplots with data from collectlfiles(".raw.gz")'
)
...
...
@@ -720,7 +732,6 @@ def main(source, collectl, plotlypath, destination, configpath,
# validate config and make dict from values
config
=
{}
a
=
time
.
time
()
for
config_var_name
,
validator_dict
in
VALIDATIONS_INFOS
.
items
():
try
:
config
[
config_var_name
]
=
getattr
(
config_module
,
config_var_name
)
...
...
readme.md
View file @
5c4f06a6
...
...
@@ -13,6 +13,11 @@ After that you can use it like that:
```
For informations of the options use "--help" or go to the
[
options
](
#options
)
description.
## Collectl commad to make Datafiles
Important is "-sZ" with out Collectl2plotly can not get the data from the file for the plots
```
collectl -f <filename that will be created> -i <interval>:<interval> -sZ
```
## Options
...
...
@@ -30,11 +35,6 @@ For informations of the options use "--help" or go to the [options](#options) de
| --filtervalue | any value (string, int, ...) | is passed to the filter function as string | - |
| --force | - | override existing plot directory if exist | - |
### make collectl source files
Important is "-sZ" with out Collectl2plotly can not get the data from the file for the plots
```
collectl -f <filename that will be created> -i <interval> -sZ
```
## Config
The config is python file with following varibles to create spezial plots or/and with different values instead of the default.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment