-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[metrics_center] Remove github dependency #323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
fluttergithubbot
merged 10 commits into
flutter:master
from
CaseyHillers:CaseyHillers-patch-1
Apr 13, 2021
Merged
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
6b0dc8e
Update metrics_center github version
30dced1
remove github dependency
37213a4
changelog + lints
adcee5b
flutterfmt
5fbfb84
version bump
46dd369
plugin tools format
5c583eb
use utc time of commit timestamp
ef8cdca
remove utc
d9d1745
re-add explicit utc
46e4c89
format
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,7 +12,6 @@ import 'package:googleapis_auth/auth_io.dart'; | |
| import 'common.dart'; | ||
| import 'constants.dart'; | ||
| import 'gcs_lock.dart'; | ||
| import 'github_helper.dart'; | ||
|
|
||
| /// A [MetricPoint] modeled after the format that Skia Perf expects. | ||
| /// | ||
|
|
@@ -317,16 +316,15 @@ class SkiaPerfGcsAdaptor { | |
| /// json files can be put in that leaf directory. We intend to use multiple | ||
| /// json files in the future to scale up the system if too many writes are | ||
| /// competing for the same json file. | ||
| static Future<String> computeObjectName(String githubRepo, String revision, | ||
| {GithubHelper githubHelper}) async { | ||
| static Future<String> computeObjectName( | ||
| String githubRepo, String revision, DateTime commitTime) async { | ||
| assert(_githubRepoToGcsName[githubRepo] != null); | ||
| final String topComponent = _githubRepoToGcsName[githubRepo]; | ||
| final DateTime t = await (githubHelper ?? GithubHelper()) | ||
| .getCommitDateTime(githubRepo, revision); | ||
| final String month = t.month.toString().padLeft(2, '0'); | ||
| final String day = t.day.toString().padLeft(2, '0'); | ||
| final String hour = t.hour.toString().padLeft(2, '0'); | ||
| final String dateComponents = '${t.year}/$month/$day/$hour'; | ||
| final DateTime commitTimeUtc = commitTime.toUtc(); | ||
| final String month = commitTimeUtc.month.toString().padLeft(2, '0'); | ||
| final String day = commitTimeUtc.day.toString().padLeft(2, '0'); | ||
| final String hour = commitTimeUtc.hour.toString().padLeft(2, '0'); | ||
| final String dateComponents = '${commitTime.year}/$month/$day/$hour'; | ||
| return '$topComponent/$dateComponents/$revision/values.json'; | ||
| } | ||
|
|
||
|
|
@@ -392,7 +390,7 @@ class SkiaPerfDestination extends MetricDestination { | |
| } | ||
|
|
||
| @override | ||
| Future<void> update(List<MetricPoint> points) async { | ||
| Future<void> update(List<MetricPoint> points, DateTime commitTime) async { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tests are failing as I should be using a Utc datetime instead of the local time |
||
| // 1st, create a map based on git repo, git revision, and point id. Git repo | ||
| // and git revision are the top level components of the Skia perf GCS object | ||
| // name. | ||
|
|
@@ -410,8 +408,8 @@ class SkiaPerfDestination extends MetricDestination { | |
| // 2nd, read existing points from the gcs object and update with new ones. | ||
| for (final String repo in pointMap.keys) { | ||
| for (final String revision in pointMap[repo].keys) { | ||
| final String objectName = | ||
| await SkiaPerfGcsAdaptor.computeObjectName(repo, revision); | ||
| final String objectName = await SkiaPerfGcsAdaptor.computeObjectName( | ||
| repo, revision, commitTime); | ||
| final Map<String, SkiaPerfPoint> newPoints = pointMap[repo][revision]; | ||
| // If too many bots are writing the metrics of a git revision into this | ||
| // single json file (with name `objectName`), the contention on the lock | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@keyonghan I switched the timestamps to be explicitly stored as UTC. Before they were based on the local time of the server it was run in. Is this okay?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it easy to fix from test side rather than enforcing the UTC from code here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay switched back to previous functionality. This will cause issues if there are instances distributed globally running this logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After revisiting the code, I agree that we need to enforce the timezone to be consistent.
But I guess our current logic is based on PST (could you please double check?). If so, let's enforce PST instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Cocoon, the GAE instance is in us-central. I presume the engine use case is running on LUCI, which has more variance.
I think UTC is the safest option to default to the data would only jump forward in time when this change occurs (unless there are instances in EMEA/Asia). SG?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just validated existing bucket is using UTC. Sounds good to me.