Skip to content

Commit

Permalink
[metrics_center] Add new non-numeric keys in the Google Benchmark JSO…
Browse files Browse the repository at this point in the history
…N format (#511)
  • Loading branch information
George Wright authored Nov 10, 2021
1 parent 70d2ffb commit b1fdbab
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 12 deletions.
4 changes: 3 additions & 1 deletion packages/metrics_center/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## NEXT
## 1.0.2

- Updated the GoogleBenchmark parser to correctly parse new keys added
in the JSON schema.
- Fix `unnecessary_import` lint errors.
- Update version titles in CHANGELOG.md so plugins tooling understands them.
- (Moved from `# X.Y.Z` to `## X.Y.Z`)
Expand Down
11 changes: 11 additions & 0 deletions packages/metrics_center/lib/src/google_benchmark.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ const String _kTimeUnitKey = 'time_unit';
const List<String> _kNonNumericalValueSubResults = <String>[
kNameKey,
_kTimeUnitKey,
'aggregate_name',
'aggregate_unit',
'error_message',
'family_index',
'per_family_instance_index',
'label',
'run_name',
'run_type',
'repetitions',
'repetition_index',
'threads',
'iterations',
'big_o',
];
Expand Down
2 changes: 1 addition & 1 deletion packages/metrics_center/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: metrics_center
version: 1.0.1
version: 1.0.2
description:
Support multiple performance metrics sources/formats and destinations.
repository: https://github.com/flutter/packages/tree/master/packages/metrics_center
Expand Down
67 changes: 59 additions & 8 deletions packages/metrics_center/test/example_google_benchmark.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,79 @@
{
"context": {
"date": "2019-12-17 15:14:14",
"num_cpus": 56,
"mhz_per_cpu": 2594,
"cpu_scaling_enabled": true,
"date": "2021-11-09T15:08:32-08:00",
"host_name": "test",
"executable": "benchmarks",
"num_cpus": 16,
"mhz_per_cpu": 2300,
"cpu_scaling_enabled": false,
"caches": [
{
"type": "Data",
"level": 1,
"size": 32768,
"num_sharing": 2
},
{
"type": "Instruction",
"level": 1,
"size": 32768,
"num_sharing": 2
},
{
"type": "Unified",
"level": 2,
"size": 262144,
"num_sharing": 2
},
{
"type": "Unified",
"level": 3,
"size": 16777216,
"num_sharing": 16
}
],
"load_avg": [2.59033,17.2754,24.2168],
"library_build_type": "release"
},
"benchmarks": [
{
"name": "BM_PaintRecordInit",
"iterations": 6749079,
"family_index": 0,
"per_family_instance_index": 0,
"run_name": "BM_PaintRecordInit",
"run_type": "iteration",
"repetitions": 1,
"repetition_index": 0,
"threads": 1,
"iterations": 3072884,
"real_time": 101,
"cpu_time": 101,
"time_unit": "ns"
},
{
"name": "BM_ParagraphShortLayout",
"iterations": 151761,
"name": "SkParagraphFixture/ShortLayout",
"family_index": 22,
"per_family_instance_index": 0,
"run_name": "SkParagraphFixture/ShortLayout",
"run_type": "iteration",
"repetitions": 1,
"repetition_index": 0,
"threads": 1,
"iterations": 200874,
"real_time": 4460,
"cpu_time": 4460,
"time_unit": "ns"
},
{
"name": "BM_ParagraphStylesBigO_BigO",
"name": "SkParagraphFixture/TextBigO_BigO",
"family_index": 26,
"per_family_instance_index": 0,
"run_name": "SkParagraphFixture/TextBigO",
"run_type": "aggregate",
"repetitions": 1,
"threads": 1,
"aggregate_name": "BigO",
"aggregate_unit": "time",
"cpu_coefficient": 6548,
"real_coefficient": 6548,
"big_o": "N",
Expand Down
4 changes: 2 additions & 2 deletions packages/metrics_center/test/google_benchmark_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ void main() {
points.map((MetricPoint p) => p.tags[kNameKey]),
<String>[
'BM_PaintRecordInit',
'BM_ParagraphShortLayout',
'BM_ParagraphStylesBigO_BigO',
'SkParagraphFixture/ShortLayout',
'SkParagraphFixture/TextBigO_BigO',
],
);
});
Expand Down

0 comments on commit b1fdbab

Please sign in to comment.