Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Q
qmlbenchrunner
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
7
Issues
7
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Eskil Abrahamsen-Blomfeldt
qmlbenchrunner
Commits
ee3cfe9a
Commit
ee3cfe9a
authored
Feb 20, 2017
by
Eskil Abrahamsen-Blomfeldt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial commit: Add scripts
Copy scripts from private repo.
parents
Pipeline
#1032
skipped
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
337 additions
and
0 deletions
+337
-0
generatedashboard.py
generatedashboard.py
+282
-0
run.py
run.py
+55
-0
No files found.
generatedashboard.py
0 → 100755
View file @
ee3cfe9a
#!/usr/bin/env python3
import
os
import
json
if
__name__
==
"__main__"
:
qmlfiles
=
[]
for
subdir
,
dirs
,
files
in
os
.
walk
(
"."
):
for
file
in
files
:
filepath
=
subdir
+
os
.
sep
+
file
if
filepath
.
endswith
(
".qml"
):
qmlfiles
.
append
(
filepath
.
split
(
"/"
)[
-
1
])
content
=
{
"annotations"
:
{
"list"
:
[]
},
"editable"
:
True
,
"gnetId"
:
None
,
"graphTooltip"
:
0
,
"hideControls"
:
False
,
"id"
:
None
,
"links"
:
[],
"schemaVersion"
:
14
,
"style"
:
"dark"
,
"tags"
:
[],
"templating"
:
{
"list"
:
[]
},
"time"
:
{
"from"
:
"now-7d"
,
"to"
:
"now"
},
"timepicker"
:
{
"refresh_intervals"
:
[
"5s"
,
"10s"
,
"30s"
,
"1m"
,
"5m"
,
"15m"
,
"30m"
,
"1h"
,
"2h"
,
"1d"
],
"time_options"
:
[
"5m"
,
"15m"
,
"1h"
,
"6h"
,
"12h"
,
"24h"
,
"2d"
,
"7d"
,
"30d"
]
},
"timezone"
:
"browser"
,
"title"
:
"New dashboard"
,
"version"
:
0
}
panelId
=
0
rows
=
[]
for
qmlfile
in
qmlfiles
:
panelId
+=
1
panels
=
[
{
"aliasColors"
:
{},
"bars"
:
False
,
"datasource"
:
"qmlbench"
,
"fill"
:
1
,
"id"
:
panelId
,
"legend"
:
{
"avg"
:
False
,
"current"
:
False
,
"max"
:
False
,
"min"
:
False
,
"show"
:
True
,
"total"
:
False
,
"values"
:
False
,
},
"lines"
:
True
,
"linewidth"
:
1
,
"links"
:
[],
"nullPointMode"
:
"null"
,
"percentage"
:
False
,
"pointradius"
:
5
,
"points"
:
True
,
"renderer"
:
"flot"
,
"seriesOverride"
:
[],
"span"
:
12
,
"stack"
:
False
,
"steppedLine"
:
False
,
"targets"
:
[
{
"dsType"
:
"influxdb"
,
"groupBy"
:
[
{
"params"
:
[
"qtVersion"
],
"type"
:
"tag"
}
],
"measurement"
:
qmlfile
,
"policy"
:
"default"
,
"refId"
:
"A"
,
"resultFormat"
:
"time_series"
,
"select"
:
[
[
{
"params"
:
[
"mean"
],
"type"
:
"field"
}
]
],
"tags"
:
[
{
"key"
:
"osVersion"
,
"operator"
:
"="
,
"value"
:
"Ubuntu.15.04"
}
]
}
],
"thresholds"
:
[],
"timeFrom"
:
None
,
"timeShift"
:
None
,
"title"
:
qmlfile
,
"tooltip"
:
{
"shared"
:
True
,
"sort"
:
0
,
"value_type"
:
"individual"
},
"type"
:
"graph"
,
"xaxis"
:
{
"mode"
:
"time"
,
"name"
:
None
,
"show"
:
True
,
"values"
:
[]
},
"yaxes"
:
[
{
"format"
:
"short"
,
"label"
:
None
,
"logBase"
:
1
,
"max"
:
None
,
"min"
:
"0"
,
"show"
:
True
},
{
"format"
:
"short"
,
"label"
:
None
,
"logBase"
:
1
,
"max"
:
None
,
"min"
:
None
,
"show"
:
True
}
]
}
]
row
=
{
"collapse"
:
False
,
"height"
:
"250px"
,
"repeat"
:
None
,
"repeatIteration"
:
None
,
"repeatRowId"
:
None
,
"showTitle"
:
False
,
"title"
:
"A Row"
,
"titleSize"
:
"h6"
,
"panels"
:
panels
}
rows
.
append
(
row
)
table
=
{
"collapse"
:
False
,
"height"
:
250
,
"panels"
:
[
{
"columns"
:
[],
"datasource"
:
"qmlbench"
,
"fontSize"
:
"100%"
,
"id"
:
2
,
"links"
:
[],
"pageSize"
:
None
,
"scroll"
:
True
,
"showHeader"
:
True
,
"sort"
:
{
"col"
:
0
,
"desc"
:
True
},
"span"
:
12
,
"styles"
:
[
{
"dateFormat"
:
"YYYY-MM-DD HH:mm:ss"
,
"pattern"
:
"Time"
,
"type"
:
"date"
},
{
"colorMode"
:
None
,
"colors"
:
[
"rgba(245, 54, 54, 0.9)"
,
"rgba(237, 129, 40, 0.89)"
,
"rgba(50, 172, 45, 0.97)"
],
"decimals"
:
2
,
"pattern"
:
"/.*/"
,
"thresholds"
:
[],
"type"
:
"number"
,
"unit"
:
"short"
}
],
"targets"
:
[
{
"dsType"
:
"influxdb"
,
"groupBy"
:
[],
"measurement"
:
qmlfile
,
"policy"
:
"default"
,
"refId"
:
"A"
,
"resultFormat"
:
"time_series"
,
"select"
:
[
[
{
"params"
:
[
"mean"
],
"type"
:
"field"
}
],
[
{
"params"
:
[
"coefficientOfVariation"
],
"type"
:
"field"
}
],
[
{
"params"
:
[
"qtBaseHead"
],
"type"
:
"field"
}
],
[
{
"params"
:
[
"qtDeclarativeHead"
],
"type"
:
"field"
}
]
],
"tags"
:
[
{
"key"
:
"osVersion"
,
"operator"
:
"="
,
"value"
:
"Ubuntu.15.04"
}
]
}
],
"title"
:
qmlfile
,
"transform"
:
"timeseries_to_columns"
,
"type"
:
"table"
}
],
"repeat"
:
None
,
"repeatIteration"
:
None
,
"repeatRowId"
:
None
,
"showTitle"
:
False
,
"title"
:
"Dashboard Row"
,
"titleSize"
:
"h6"
}
rows
.
append
(
table
)
content
[
"rows"
]
=
rows
print
(
json
.
dumps
(
content
))
run.py
0 → 100755
View file @
ee3cfe9a
#!/usr/bin/env python3
import
os
import
sys
import
subprocess
import
logging
from
socket
import
gethostname
import
requests
import
json
HOSTNAME
=
"10.213.255.45"
def
submit_output
(
output
,
branch
,
qtBaseHead
,
qtDeclarativeHead
):
hostname
=
gethostname
()
tree
=
json
.
loads
(
output
)
gpuVendor
=
tree
[
"opengl"
][
"vendor"
]
driverVersion
=
tree
[
"opengl"
][
"version"
]
qtVersion
=
tree
[
"qt"
]
osVersion
=
tree
[
"os"
][
"prettyProductName"
].
replace
(
' '
,
'.'
)
for
key
in
tree
:
if
key
.
endswith
(
".qml"
):
mean
=
tree
[
key
][
"average"
]
standardDeviation
=
tree
[
key
][
"standard-deviation-all-samples"
]
coefficientOfVariation
=
standardDeviation
/
mean
if
mean
>
0.0
else
0.0
basename
=
key
.
split
(
"/"
)[
-
1
]
tags
=
(
'qtVersion='
+
qtVersion
,
'osVersion='
+
osVersion
,
'branch='
+
branch
)
fields
=
(
'mean='
+
str
(
mean
),
'coefficientOfVariation='
+
str
(
coefficientOfVariation
),
'qtBaseHead="'
+
qtBaseHead
+
'"'
,
'qtDeclarativeHead="'
+
qtDeclarativeHead
+
'"'
,)
data
=
'%s,%s %s'
%
(
basename
,
','
.
join
(
tags
),
','
.
join
(
fields
))
result
=
requests
.
post
(
"http://10.213.255.45:8086/write?db=qmlbench"
,
data
=
data
.
encode
(
'utf-8'
))
print
(
data
)
print
(
result
)
def
run_benchmark
(
filename
,
branch
,
qtBaseHead
,
qtDeclarativeHead
):
output
=
subprocess
.
check_output
([
"cat"
,
filename
])
submit_output
(
output
.
decode
(
"utf-8"
),
branch
,
qtBaseHead
,
qtDeclarativeHead
)
if
__name__
==
"__main__"
:
import
argparse
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"filename"
,
help
=
"The .json file to post"
)
parser
.
add_argument
(
"branch"
,
help
=
"The Qt branch tested"
)
parser
.
add_argument
(
"qtBaseHead"
,
help
=
"The current HEAD of Qt Base"
)
parser
.
add_argument
(
"qtDeclarativeHead"
,
help
=
"The current HEAD of Qt Declarative"
)
args
=
parser
.
parse_args
(
sys
.
argv
[
1
:])
print
(
"Posting results: "
+
args
.
filename
)
run_benchmark
(
args
.
filename
,
args
.
branch
,
args
.
qtBaseHead
,
args
.
qtDeclarativeHead
)
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