readPoints method

Future<List<SkiaPerfPoint>> readPoints(
  1. String objectName
)

Read a list of SkiaPerfPoint that have been previously written to the GCS file with name objectName.

The Github repo and revision of those points will be inferred from the objectName.

Return an empty list if the object does not exist in the GCS bucket.

The read may retry multiple times if transient network errors with code 504 happens.

Implementation

Future<List<SkiaPerfPoint>> readPoints(String objectName) async {
  // Retry multiple times as GCS may return 504 timeout.
  for (int retry = 0; retry < 5; retry += 1) {
    try {
      return await _readPointsWithoutRetry(objectName);
    } catch (e) {
      if (e is DetailedApiRequestError && e.status == 504) {
        continue;
      }
      rethrow;
    }
  }
  // Retry one last time and let the exception go through.
  return _readPointsWithoutRetry(objectName);
}