Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/metrics_center/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 0.0.9
- Remove legacy datastore and destination.

# 0.0.8
- Allow tests to override LegacyFlutterDestination GCP project id.

Expand Down
4 changes: 0 additions & 4 deletions packages/metrics_center/lib/src/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ const String kProjectId = 'project_id';
/// Timeline key in JSON.
const String kSourceTimeMicrosName = 'sourceTimeMicros';

/// The size of 500 is currently limited by Google datastore. It cannot write
/// more than 500 entities in a single call.
const int kMaxBatchSize = 500;

/// The prod bucket name for Flutter's instance of Skia Perf.
const String kBucketName = 'flutter-skia-perf-prod';

Expand Down
26 changes: 3 additions & 23 deletions packages/metrics_center/lib/src/flutter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

import 'common.dart';
import 'constants.dart';
import 'legacy_datastore.dart';
import 'legacy_flutter.dart';
import 'skiaperf.dart';

/// Convenient class to capture the benchmarks in the Flutter engine repo.
Expand All @@ -31,50 +29,32 @@ class FlutterEngineMetricPoint extends MetricPoint {
/// All Flutter performance metrics (framework, engine, ...) should be written
/// to this destination.
class FlutterDestination extends MetricDestination {
// TODO(liyuqian): change the implementation of this class (without changing
// its public APIs) to remove `LegacyFlutterDestination` and directly use
// `SkiaPerfDestination` once the migration is fully done.
FlutterDestination._(this._legacyDestination, this._skiaPerfDestination);
FlutterDestination._(this._skiaPerfDestination);

/// Creates a [FlutterDestination] from service account JSON.
static Future<FlutterDestination> makeFromCredentialsJson(
Map<String, dynamic> json,
{bool isTesting = false}) async {
// Specify the project id for LegacyFlutterDestination as we may get a
// service account json from another GCP project.
//
// When we're testing, let projectId be null so we'll still use the test
// project specified by the credentials json.
//
// This is completed, but fortunately we'll be able to remove all this
// once the migration is fully done.
final LegacyFlutterDestination legacyDestination =
await LegacyFlutterDestination.makeFromCredentialsJson(json,
projectId: isTesting ? null : 'flutter-cirrus');
final SkiaPerfDestination skiaPerfDestination =
await SkiaPerfDestination.makeFromGcpCredentials(json,
isTesting: isTesting);
return FlutterDestination._(legacyDestination, skiaPerfDestination);
return FlutterDestination._(skiaPerfDestination);
}

/// Creates a [FlutterDestination] from an OAuth access token.
static Future<FlutterDestination> makeFromAccessToken(
String accessToken, String projectId,
{bool isTesting = false}) async {
final LegacyFlutterDestination legacyDestination = LegacyFlutterDestination(
datastoreFromAccessToken(accessToken, projectId));
final SkiaPerfDestination skiaPerfDestination =
await SkiaPerfDestination.makeFromAccessToken(accessToken, projectId,
isTesting: isTesting);
return FlutterDestination._(legacyDestination, skiaPerfDestination);
return FlutterDestination._(skiaPerfDestination);
}

@override
Future<void> update(List<MetricPoint> points) async {
await _legacyDestination.update(points);
await _skiaPerfDestination.update(points);
}

final LegacyFlutterDestination _legacyDestination;
final SkiaPerfDestination _skiaPerfDestination;
}
37 changes: 0 additions & 37 deletions packages/metrics_center/lib/src/legacy_datastore.dart

This file was deleted.

94 changes: 0 additions & 94 deletions packages/metrics_center/lib/src/legacy_flutter.dart

This file was deleted.

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: 0.0.7
version: 0.0.9
description:
Support multiple performance metrics sources/formats and destinations.
homepage:
Expand Down
50 changes: 0 additions & 50 deletions packages/metrics_center/test/legacy_flutter_test.dart

This file was deleted.