11import TimelineUIUtils from './../devtools/timelineModel/timelineUIUtils'
2- import { StatsArray } from './../devtools/types'
2+ import { CountersData } from './../devtools/types'
33import TimelineModel from './../devtools/timelineModel'
44import Event from './../devtools/tracingModel/event'
55import TracingModel from './../devtools/tracingModel'
@@ -11,22 +11,22 @@ export default class CustomUtils extends TimelineUIUtils {
1111 * @param {number } endTime
1212 * @return {!Object<string, number> }
1313 */
14- public detailStatsForTimeRange ( events : Event [ ] , startTime : number , endTime : number ) : StatsArray {
14+ public detailStatsForTimeRange ( events : Event [ ] , startTime : number , endTime : number ) : CountersData {
1515 const eventStyle = this . eventStyle . bind ( this )
1616 const visibleEventsFilterFunc = this . visibleEventsFilter . bind ( this )
1717
1818 if ( ! events . length ) {
1919 return {
2020 idle : {
21- 'time ' : [ endTime - startTime ] ,
22- 'value ' : [ endTime - startTime ]
21+ 'times ' : [ endTime - startTime ] ,
22+ 'values ' : [ endTime - startTime ]
2323 }
2424 }
2525 }
2626
2727 // aggeregatedStats is a map by categories. For each category there's an array
2828 // containing sorted time points which records accumulated value of the category.
29- const aggregatedStats : StatsArray = { }
29+ const aggregatedStats : CountersData = { }
3030 const categoryStack : string [ ] = [ ]
3131 let lastTime = 0
3232 TimelineModel . forEachEvent (
@@ -54,15 +54,14 @@ export default class CustomUtils extends TimelineUIUtils {
5454 function updateCategory ( category : string , time : number ) : void {
5555 let statsArrays = aggregatedStats [ category ]
5656 if ( ! statsArrays ) {
57- statsArrays = { time : [ ] , value : [ ] }
57+ statsArrays = { times : [ ] , values : [ ] }
5858 aggregatedStats [ category ] = statsArrays
5959 }
60- if ( statsArrays . time . length && statsArrays . time [ statsArrays . time . length - 1 ] === time ) {
60+ if ( statsArrays . times . length && statsArrays . times [ statsArrays . times . length - 1 ] === time ) {
6161 return
6262 }
63- // const lastValue = statsArrays.value.length ? statsArrays.value[statsArrays.value.length - 1] : 0
64- statsArrays . value . push ( time - lastTime )
65- statsArrays . time . push ( time )
63+ statsArrays . values . push ( time - lastTime )
64+ statsArrays . times . push ( time )
6665 }
6766
6867 /**
0 commit comments