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
30d3866a
Unverified
Commit
30d3866a
authored
Oct 27, 2021
by
keyonghan
Committed by
GitHub
Oct 27, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add extra benchmark metrics to test name in addition to builder name (#92530)
parent
53de8899
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
13 deletions
+47
-13
metrics_center.dart
dev/devicelab/lib/framework/metrics_center.dart
+17
-4
metrics_center_test.dart
dev/devicelab/test/metrics_center_test.dart
+30
-9
No files found.
dev/devicelab/lib/framework/metrics_center.dart
View file @
30d3866a
...
...
@@ -54,7 +54,7 @@ Future<FlutterDestination> connectFlutterDestination() async {
/// "host_type": "linux",
/// "host_version": "debian-10.11"
/// }
List
<
MetricPoint
>
parse
(
Map
<
String
,
dynamic
>
resultsJson
,
Map
<
String
,
dynamic
>
benchmarkTags
)
{
List
<
MetricPoint
>
parse
(
Map
<
String
,
dynamic
>
resultsJson
,
Map
<
String
,
dynamic
>
benchmarkTags
,
String
taskName
)
{
print
(
'Results to upload to skia perf:
$resultsJson
'
);
print
(
'Benchmark tags to upload to skia perf:
$benchmarkTags
'
);
final
List
<
String
>
scoreKeys
=
...
...
@@ -82,6 +82,18 @@ List<MetricPoint> parse(Map<String, dynamic> resultsJson, Map<String, dynamic> b
tags
,
),
);
// Add an extra entry under test name. This way we have duplicate metrics
// under both builder name and test name. Once we have enough data and update
// existing alerts to point to test name, we can deprecate builder name ones.
// https://github.com/flutter/flutter/issues/74522#issuecomment-942575581
tags
[
kNameKey
]
=
taskName
;
metricPoints
.
add
(
MetricPoint
(
(
resultData
[
scoreKey
]
as
num
).
toDouble
(),
tags
,
),
);
}
return
metricPoints
;
}
...
...
@@ -99,7 +111,7 @@ Future<void> upload(
FlutterDestination
metricsDestination
,
List
<
MetricPoint
>
metricPoints
,
int
commitTimeSinceEpoch
,
String
?
taskName
,
String
taskName
,
)
async
{
await
metricsDestination
.
update
(
metricPoints
,
...
...
@@ -107,7 +119,7 @@ Future<void> upload(
commitTimeSinceEpoch
,
isUtc:
true
,
),
taskName
??
'default'
,
taskName
,
);
}
...
...
@@ -127,11 +139,12 @@ Future<void> uploadToSkiaPerf(String? resultsPath, String? commitTime, String? t
}
else
{
commitTimeSinceEpoch
=
DateTime
.
now
().
millisecondsSinceEpoch
;
}
taskName
=
taskName
??
'default'
;
final
Map
<
String
,
dynamic
>
benchmarkTagsMap
=
jsonDecode
(
benchmarkTags
??
'{}'
)
as
Map
<
String
,
dynamic
>;
final
File
resultFile
=
File
(
resultsPath
);
Map
<
String
,
dynamic
>
resultsJson
=
<
String
,
dynamic
>{};
resultsJson
=
json
.
decode
(
await
resultFile
.
readAsString
())
as
Map
<
String
,
dynamic
>;
final
List
<
MetricPoint
>
metricPoints
=
parse
(
resultsJson
,
benchmarkTagsMap
);
final
List
<
MetricPoint
>
metricPoints
=
parse
(
resultsJson
,
benchmarkTagsMap
,
taskName
);
final
FlutterDestination
metricsDestination
=
await
connectFlutterDestination
();
await
upload
(
metricsDestination
,
metricPoints
,
commitTimeSinceEpoch
,
taskName
);
}
dev/devicelab/test/metrics_center_test.dart
View file @
30d3866a
...
...
@@ -24,6 +24,27 @@ class FakeFlutterDestination implements FlutterDestination {
void
main
(
)
{
group
(
'Parse'
,
()
{
test
(
'duplicate entries for both builder name and test name'
,
()
{
final
Map
<
String
,
dynamic
>
results
=
<
String
,
dynamic
>{
'CommitBranch'
:
'master'
,
'CommitSha'
:
'abc'
,
'BuilderName'
:
'Linux test'
,
'ResultData'
:
<
String
,
dynamic
>{
'average_frame_build_time_millis'
:
0.4550425531914895
,
},
'BenchmarkScoreKeys'
:
<
String
>[
'average_frame_build_time_millis'
,
],
};
final
List
<
MetricPoint
>
metricPoints
=
parse
(
results
,
<
String
,
String
>{},
'test'
);
expect
(
metricPoints
.
length
,
2
);
expect
(
metricPoints
[
0
].
value
,
equals
(
0.4550425531914895
));
expect
(
metricPoints
[
0
].
tags
[
kNameKey
],
'Linux test'
);
expect
(
metricPoints
[
1
].
value
,
equals
(
0.4550425531914895
));
expect
(
metricPoints
[
1
].
tags
[
kNameKey
],
'test'
);
});
test
(
'without additional benchmark tags'
,
()
{
final
Map
<
String
,
dynamic
>
results
=
<
String
,
dynamic
>{
'CommitBranch'
:
'master'
,
...
...
@@ -38,10 +59,10 @@ void main() {
'90th_percentile_frame_build_time_millis'
,
],
};
final
List
<
MetricPoint
>
metricPoints
=
parse
(
results
,
<
String
,
String
>{});
final
List
<
MetricPoint
>
metricPoints
=
parse
(
results
,
<
String
,
String
>{}
,
'task abc'
);
expect
(
metricPoints
[
0
].
value
,
equals
(
0.4550425531914895
));
expect
(
metricPoints
[
1
].
value
,
equals
(
0.473
));
expect
(
metricPoints
[
2
].
value
,
equals
(
0.473
));
});
test
(
'with additional benchmark tags'
,
()
{
...
...
@@ -65,12 +86,12 @@ void main() {
'host_type'
:
'linux'
,
'host_version'
:
'debian-10.11'
};
final
List
<
MetricPoint
>
metricPoints
=
parse
(
results
,
tags
);
final
List
<
MetricPoint
>
metricPoints
=
parse
(
results
,
tags
,
'task abc'
);
expect
(
metricPoints
[
0
].
value
,
equals
(
0.4550425531914895
));
expect
(
metricPoints
[
0
].
tags
.
keys
.
contains
(
'arch'
),
isTrue
);
expect
(
metricPoints
[
1
].
value
,
equals
(
0.473
));
expect
(
metricPoints
[
1
].
tags
.
keys
.
contains
(
'device_type'
),
isTrue
);
expect
(
metricPoints
[
2
].
value
,
equals
(
0.473
));
expect
(
metricPoints
[
2
].
tags
.
keys
.
contains
(
'device_type'
),
isTrue
);
});
test
(
'succeeds - null ResultData'
,
()
{
...
...
@@ -81,7 +102,7 @@ void main() {
'ResultData'
:
null
,
'BenchmarkScoreKeys'
:
null
,
};
final
List
<
MetricPoint
>
metricPoints
=
parse
(
results
,
<
String
,
String
>{});
final
List
<
MetricPoint
>
metricPoints
=
parse
(
results
,
<
String
,
String
>{}
,
'tetask abcst'
);
expect
(
metricPoints
.
length
,
0
);
});
...
...
@@ -102,9 +123,9 @@ void main() {
'90th_percentile_frame_build_time_millis'
,
],
};
final
List
<
MetricPoint
>
metricPoints
=
parse
(
results
,
<
String
,
String
>{});
final
List
<
MetricPoint
>
metricPoints
=
parse
(
results
,
<
String
,
String
>{}
,
'task abc'
);
final
FakeFlutterDestination
flutterDestination
=
FakeFlutterDestination
();
String
?
taskName
;
const
String
taskName
=
'default'
;
const
int
commitTimeSinceEpoch
=
1629220312
;
await
upload
(
flutterDestination
,
metricPoints
,
commitTimeSinceEpoch
,
taskName
);
...
...
@@ -126,7 +147,7 @@ void main() {
'90th_percentile_frame_build_time_millis'
,
],
};
final
List
<
MetricPoint
>
metricPoints
=
parse
(
results
,
<
String
,
String
>{});
final
List
<
MetricPoint
>
metricPoints
=
parse
(
results
,
<
String
,
String
>{}
,
'task abc'
);
final
FakeFlutterDestination
flutterDestination
=
FakeFlutterDestination
();
const
String
taskName
=
'test'
;
const
int
commitTimeSinceEpoch
=
1629220312
;
...
...
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