Use task name when uploading metrics to skia perf (#89004)
This commit is contained in:
@@ -70,8 +70,33 @@ List<MetricPoint> parse(Map<String, dynamic> resultsJson) {
|
||||
return metricPoints;
|
||||
}
|
||||
|
||||
/// Upload metrics to GCS bucket used by Skia Perf.
|
||||
///
|
||||
/// Skia Perf picks up all available files under the folder, and
|
||||
/// is robust to duplicate entries.
|
||||
///
|
||||
/// Files will be named based on `taskName`, such as
|
||||
/// `complex_layout_scroll_perf__timeline_summary_values.json`.
|
||||
/// If no `taskName` is specified, data will be saved to
|
||||
/// `default_values.json`.
|
||||
Future<void> upload(
|
||||
FlutterDestination metricsDestination,
|
||||
List<MetricPoint> metricPoints,
|
||||
int commitTimeSinceEpoch,
|
||||
String? taskName,
|
||||
) async {
|
||||
await metricsDestination.update(
|
||||
metricPoints,
|
||||
DateTime.fromMillisecondsSinceEpoch(
|
||||
commitTimeSinceEpoch,
|
||||
isUtc: true,
|
||||
),
|
||||
taskName ?? 'default',
|
||||
);
|
||||
}
|
||||
|
||||
/// Upload test metrics to metrics center.
|
||||
Future<void> uploadToMetricsCenter(String? resultsPath, String? commitTime) async {
|
||||
Future<void> uploadToMetricsCenter(String? resultsPath, String? commitTime, String? taskName) async {
|
||||
int commitTimeSinceEpoch;
|
||||
if (resultsPath == null) {
|
||||
return;
|
||||
@@ -86,11 +111,5 @@ Future<void> uploadToMetricsCenter(String? resultsPath, String? commitTime) asyn
|
||||
resultsJson = json.decode(await resultFile.readAsString()) as Map<String, dynamic>;
|
||||
final List<MetricPoint> metricPoints = parse(resultsJson);
|
||||
final FlutterDestination metricsDestination = await connectFlutterDestination();
|
||||
await metricsDestination.update(
|
||||
metricPoints,
|
||||
DateTime.fromMillisecondsSinceEpoch(
|
||||
commitTimeSinceEpoch,
|
||||
isUtc: true,
|
||||
),
|
||||
);
|
||||
await upload(metricsDestination, metricPoints, commitTimeSinceEpoch, taskName);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user