Initial web benchmark harness and 3 benchmarks (#49460)

Initial web benchmark harness and 3 benchmarks
This commit is contained in:
Yegor
2020-01-30 14:19:17 -08:00
committed by GitHub
parent e7baef08a1
commit 423459da18
16 changed files with 1235 additions and 27 deletions

View File

@@ -181,10 +181,10 @@ class TaskResult {
if (benchmarkScoreKeys != null) {
for (final String key in benchmarkScoreKeys) {
if (!data.containsKey(key)) {
throw 'Invalid Golem score key "$key". It does not exist in task '
throw 'Invalid benchmark score key "$key". It does not exist in task '
'result data ${prettyJson.convert(data)}';
} else if (data[key] is! num) {
throw 'Invalid Golem score for key "$key". It is expected to be a num '
throw 'Invalid benchmark score for key "$key". It is expected to be a num '
'but was ${data[key].runtimeType}: ${prettyJson.convert(data[key])}';
}
}
@@ -212,17 +212,9 @@ class TaskResult {
/// Task-specific JSON data
final Map<String, dynamic> data;
/// Keys in [data] that store scores that will be submitted to Golem.
/// Keys in [data] that store scores that will be submitted to Cocoon.
///
/// Each key is also part of a benchmark's name tracked by Golem.
/// A benchmark name is computed by combining [Task.name] with a key
/// separated by a dot. For example, if a task's name is
/// `"complex_layout__start_up"` and score key is
/// `"engineEnterTimestampMicros"`, the score will be submitted to Golem under
/// `"complex_layout__start_up.engineEnterTimestampMicros"`.
///
/// This convention reduces the amount of configuration that needs to be done
/// to submit benchmark scores to Golem.
/// Each key is also part of a benchmark's name tracked by Cocoon.
final List<String> benchmarkScoreKeys;
/// Whether the task failed.