Unverified Commit 43932aa2 authored by Kate Lovett's avatar Kate Lovett Committed by GitHub

Benchmark for un-triaged image results on Flutter Gold (#40634)

parent 0ca5e71f
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'package:flutter_devicelab/framework/framework.dart';
const String _kTriageCountKey = 'count';
Future<TaskResult> getTriageCount() async {
final HttpClient skiaClient = HttpClient();
int digestCount = 0;
try {
final HttpClientRequest request = await skiaClient.getUrl(Uri.parse(
'https://flutter-gold.skia.org/json/trstatus'
));
final HttpClientResponse response = await request.close();
final String responseBody = await response.transform(utf8.decoder).join();
final Map<String, dynamic> json = jsonDecode(responseBody);
digestCount = json['corpStatus'][0]['untriagedCount'];
} catch(e) {
return TaskResult.failure(e.toString());
}
return TaskResult.success(
<String, dynamic>{_kTriageCountKey: digestCount},
benchmarkScoreKeys: <String>[_kTriageCountKey],
);
}
Future<void> main() async {
await task(() => getTriageCount());
}
......@@ -655,6 +655,12 @@ tasks:
stage: devicelab
required_agent_capabilities: ["linux/android"]
flutter_gold_triage:
description: >
Checks the number of un-triaged image digests from Flutter Gold.
stage: devicelab
required_agent_capabilities: ["linux/android"]
# run_without_leak_linux:
# description: >
# Checks that `flutter run` does not leak dart on Linux.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment