Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[perf dashboard] Modernize TimeSeries and TimeSeriesView
https://bugs.webkit.org/show_bug.cgi?id=222872 Reviewed by Dewei Zhu. Declare instance fields in class declarations, use const/let instead of var, and use generators for forward and backward iterations instead of manually implementing the iterator protocol. This patch also splits FilteredTimeSeriesView out of TimeSeriesView. * public/v3/models/time-series.js: (TimeSeries): Moved the declaration of _data instance field to the class declaration. (TimeSeries.prototype.constructor): Deleted. (TimeSeries.prototype.extendToFuture): (TimeSeries.prototype.valuesBetweenRange): (TimeSeries.prototype.findById): (TimeSeries.prototype.findPointAfterTime): (TimeSeriesView): Declared the instance fields in the class declaration. (TimeSeriesView.prototype.constructor): Removed filteredData from the argument since it's split out to FilteredTimeSeriesView now. (TimeSeriesView.prototype.get _data): Added. An abstraction needed for FilteredTimeSeriesView. (TimeSeriesView.prototype._findIndexForPoint): Ditto. Moved out of the constructor. (TimeSeriesView.prototype.filter): Return a FilteredTimeSeriesView. (TimeSeriesView.prototype.viewTimeRange): Use _subRange to return either TimeSeriesView or FilteredTimeSeriesView which ever is needed. (TimeSeriesView.prototype._subRange): An abstraction needed for FilteredTimeSeriesView. (TimeSeriesView.prototype.Symbol.iterator): Made this a generator instead of implementing the iterator protocol directly. (TimeSeriesView.prototype._reverse): Ditto. (FilteredTimeSeriesView): Added. (FilteredTimeSeriesView.prototype.constructor): Added. Assert that afterEndingIndex is less than the length of the filtered data. This assertion was missing in TimeSeries prior to this patch when filteredData is specified. (FilteredTimeSeriesView.prototype.get _data): Added. (FilteredTimeSeriesView.prototype._subRange): Added. Instantiate FilteredTimeSeriesView with the same filtered data. (FilteredTimeSeriesView.prototype._findIndexForPoint): Moved from TimeSeriesView's constructor. (FilteredTimeSeriesView.prototype._buildPointIndexMap): Moved from TimeSeriesView. Canonical link: https://commits.webkit.org/234983@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274047 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
2 changed files
with
113 additions
and
54 deletions.
There are no files selected for viewing
This file contains 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 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