Skip to content

Conversation

@keyonghan
Copy link
Contributor

This PR is part of flutter/flutter#51807

It adds branch select on performance dashboard;
It adds branch parameter injection in get-benchmark API
It adds branch property in TimeseriesValue
It saves branch property when inserting records to TimeseriesValue

Copy link
Contributor

@CaseyHillers CaseyHillers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Angular Dart side LGTM, just a question on the updates to the time series model with branching.

Thanks for adding the test to the get benchmarks handler!

(onZoomIn)="zoomInto = benchmark">
</benchmark-card>
</div>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: the project leaves a new line at EOF

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.

@KeyConverter()
Key get key => series.key;

Map<String, dynamic> get facade {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If SerializableTimeSeries is no longer used, we should move this into the model class to clean this up.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

'ID': series.timeSeriesId,
'Label': series.label,
'TaskName': series.taskName,
'Unit': series.unit,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitty nit: I would add branch here and update the TimeSeriesValue.toJson() to not serialize it. Every single time series value shared will be repeating the same bytes. (I think it's fine to just add a TODO)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking about that too. But it didn't work out based on current logic in https://github.com/flutter/cocoon/blob/master/app_dart/lib/src/request_handlers/get_benchmarks.dart
It queries recent 50 commits, and recent 50 TimeseriesValue, then if the sha matches between those two entities, a point is recorded, otherwise it will be noted as missing value.
When we consider branching, different branches may share same sha. Results will be messed up.
Another reason why I add the branch property to TimeseriesValue: existing logic queries data based on timestamp, which is the latest 50 records. If without branch property, there is no way to query the exact records of one specific branch. For example: in the latest 50 commits, if 48 is with master, 2 with release branch, the dashboard will show only the 2 records for that release branch, even though we may have older records beyond the 50 limit.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with the model needing to have the branch field for TimeSeriesValue. Only the backend needs to know about what branch a TimeSeriesValue is on. The frontend shouldn't need to further parse the data.

This was moreso on just hiding the TimeSeriesValue.branch field when returning the JSON.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

branch in TimeseriesValue is only as a Property, rather than a JsonKey:

@StringProperty(propertyName: 'Branch')
.
So it should not be parsed in the frontend side.


/// The branch of [commit].
@StringProperty(propertyName: 'Branch')
String branch;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a plan in place to update past time series data include the branch field? Or will this only work on new timeseries data?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated all historical data to have the branch property over the weekend.

bool _isShowArchived = false;
bool _userIsAuthenticated = false;
List<String> _values = ['master'];
String _selectedValue = 'master';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Uri.base.queryParameters['branch'] ?? 'master' would allow users to share the performance page of the branch they are viewing. set selectedValue(...) will have to be updated to set the query parameter.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This was a request on the build dashboard branch pages)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add it in issue: flutter/flutter#53714

Copy link
Contributor

@CaseyHillers CaseyHillers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants