Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
03d6b580
Unverified
Commit
03d6b580
authored
Feb 28, 2020
by
Mouad Debbar
Committed by
GitHub
Feb 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[web] Allow benchmarks to customize their score keys (#51493)
parent
396e8d3e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
4 deletions
+28
-4
recorder.dart
dev/benchmarks/macrobenchmarks/lib/src/web/recorder.dart
+1
-0
web_benchmarks.dart
dev/devicelab/lib/tasks/web_benchmarks.dart
+27
-4
No files found.
dev/benchmarks/macrobenchmarks/lib/src/web/recorder.dart
View file @
03d6b580
...
...
@@ -430,6 +430,7 @@ class Profile {
Map
<
String
,
dynamic
>
toJson
()
{
return
<
String
,
dynamic
>{
'name'
:
name
,
'scoreKeys'
:
<
String
>[
'averageDrawFrameDuration'
],
'averageDrawFrameDuration'
:
averageDrawFrameDuration
.
inMicroseconds
,
'drawFrameDurationNoise'
:
drawFrameDurationNoise
,
'frames'
:
frames
...
...
dev/devicelab/lib/tasks/web_benchmarks.dart
View file @
03d6b580
...
...
@@ -124,10 +124,33 @@ Future<TaskResult> runWebBenchmark({ @required bool useCanvasKit }) async {
print
(
'Received profile data'
);
for
(
final
Map
<
String
,
dynamic
>
profile
in
profiles
)
{
final
String
benchmarkName
=
profile
[
'name'
]
as
String
;
final
String
benchmarkScoreKey
=
'
$benchmarkName
.
$backend
.averageDrawFrameDuration'
;
taskResult
[
benchmarkScoreKey
]
=
profile
[
'averageDrawFrameDuration'
].
toDouble
();
// micros
taskResult
[
'
$benchmarkName
.
$backend
.drawFrameDurationNoise'
]
=
profile
[
'drawFrameDurationNoise'
].
toDouble
();
// micros
benchmarkScoreKeys
.
add
(
benchmarkScoreKey
);
if
(
benchmarkName
.
isEmpty
)
{
throw
'Benchmark name is empty'
;
}
final
String
namespace
=
'
$benchmarkName
.
$backend
'
;
final
List
<
String
>
scoreKeys
=
List
<
String
>.
from
(
profile
[
'scoreKeys'
]
as
List
<
dynamic
>);
if
(
scoreKeys
==
null
||
scoreKeys
.
isEmpty
)
{
throw
'No score keys in benchmark "
$benchmarkName
"'
;
}
for
(
final
String
scoreKey
in
scoreKeys
)
{
if
(
scoreKey
==
null
||
scoreKey
.
isEmpty
)
{
throw
'Score key is empty in benchmark "
$benchmarkName
". '
'Received [
${scoreKeys.join(', ')}
]'
;
}
if
(
scoreKey
.
contains
(
'.'
))
{
throw
'Score key contain dots in benchmark "
$benchmarkName
". '
'Received [
${scoreKeys.join(', ')}
]'
;
}
benchmarkScoreKeys
.
add
(
'
$namespace
.
$scoreKey
'
);
}
for
(
final
String
key
in
profile
.
keys
)
{
if
(
key
==
'name'
||
key
==
'scoreKeys'
)
{
continue
;
}
taskResult
[
'
$namespace
.
$key
'
]
=
profile
[
key
];
}
}
return
TaskResult
.
success
(
taskResult
,
benchmarkScoreKeys:
benchmarkScoreKeys
);
}
finally
{
...
...
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