@@ -190,7 +190,7 @@ var ProfilerView = function(id, name, container_class, html, default_handler)
190190 if ( ! container )
191191 return ;
192192
193- if ( ! this . _timeline_list . eventList . length )
193+ if ( ! ( this . _timeline_list && this . _timeline_list . eventList . length ) )
194194 {
195195 container . clearAndRender ( this . _templates . empty ( ui_strings . S_PROFILER_NO_DATA ) ) ;
196196 return ;
@@ -202,6 +202,10 @@ var ProfilerView = function(id, name, container_class, html, default_handler)
202202 var aggregated_event_list = this . _get_aggregated_event_list ( event_list ) ;
203203 var width = this . _container . clientWidth - AGGREGATED_EVENTS_WIDTH ;
204204
205+ event_list = event_list . filter ( function ( event ) {
206+ return event . time > this . _min_event_time ;
207+ } , this ) ;
208+
205209 // TODO: Check if these are already appended
206210 var frag = document . createDocumentFragment ( ) ;
207211 frag . appendChild ( this . _legend_ele ) ;
@@ -415,6 +419,25 @@ var ProfilerView = function(id, name, container_class, html, default_handler)
415419 }
416420 } ;
417421
422+ this . _on_settings_initialized = function ( msg )
423+ {
424+ if ( msg . view_id == "profiler_all" )
425+ {
426+ this . _min_event_time = window . settings [ "profiler_all" ] . get ( "min-event-time" )
427+ }
428+ } ;
429+
430+ this . _on_single_select_changed = function ( msg )
431+ {
432+ if ( msg . name == "min-event-time" )
433+ {
434+ window . settings [ "profiler_all" ] . set ( "min-event-time" , msg . values [ 0 ] )
435+ this . _min_event_time = Number ( msg . values [ 0 ] ) ;
436+ if ( this . _timeline_list )
437+ this . _update_view ( ) ;
438+ }
439+ } ;
440+
418441 this . _ontooltip = function ( event , target )
419442 {
420443 var id = Number ( target . get_attr ( "parent-node-chain" , "data-event-id" ) ) ;
@@ -479,6 +502,10 @@ var ProfilerView = function(id, name, container_class, html, default_handler)
479502 var aggregated_event_list = this . _get_aggregated_event_list ( event_list ) ;
480503 var width = this . _timeline_width ;
481504
505+ event_list = event_list . filter ( function ( event ) {
506+ return event . time > this . _min_event_time ;
507+ } , this ) ;
508+
482509 this . _x0 = 0 ;
483510 this . _x1 = interval . end ;
484511 this . _timeline_ele . clearAndRender ( this . _templates . event_list_all ( event_list , interval , this . _event_id , width ) ) ;
@@ -496,9 +523,10 @@ var ProfilerView = function(id, name, container_class, html, default_handler)
496523 var event_list = timeline_list . eventList . filter ( function ( event ) {
497524 var start = event . interval . start ;
498525 var end = event . interval . end ;
499- return ( start <= x0 && end >= x0 ) ||
500- ( start >= x0 && start <= x1 ) ;
501- } ) ;
526+ return ( ( start <= x0 && end >= x0 ) ||
527+ ( start >= x0 && start <= x1 ) ) &&
528+ event . time > this . _min_event_time ;
529+ } , this ) ;
502530 var aggregated_event_list = this . _get_aggregated_event_list ( event_list ) ;
503531 var width = this . _timeline_width ;
504532
@@ -539,8 +567,9 @@ var ProfilerView = function(id, name, container_class, html, default_handler)
539567 this . _old_session_id = null ;
540568 this . _reset ( ) ;
541569
542- this . x0 = 0 ;
543- this . x1 = 0 ;
570+ this . _x0 = 0 ;
571+ this . _x1 = 0 ;
572+ this . _min_event_time = 0 ;
544573
545574 this . _legend_ele = null ;
546575 this . _zoomer_ele = null ;
@@ -566,6 +595,8 @@ var ProfilerView = function(id, name, container_class, html, default_handler)
566595 this . _handle_details_list_bound = this . _handle_details_list . bind ( this ) ;
567596
568597 window . messages . addListener ( "profile-enabled" , this . _on_profile_enabled . bind ( this ) ) ;
598+ window . messages . addListener ( "single-select-changed" , this . _on_single_select_changed . bind ( this ) ) ;
599+ window . messages . addListener ( "settings-initialized" , this . _on_settings_initialized . bind ( this ) ) ;
569600
570601 window . event_handlers . click [ "profiler-start-stop" ] = this . _start_stop_profiler . bind ( this ) ;
571602 window . event_handlers . click [ "profiler-reload-window" ] = this . _reload_window . bind ( this ) ;
@@ -592,9 +623,37 @@ ProfilerView.create_ui_widgets = function()
592623 title : ui_strings . S_BUTTON_START_PROFILER
593624 }
594625 ]
626+ } ,
627+ {
628+ type : UI . TYPE_SINGLE_SELECT ,
629+ name : "min-event-time" ,
630+ items : [
631+ {
632+ text : "All" ,
633+ title : "Show all events" ,
634+ value : "0"
635+ } ,
636+ {
637+ text : "> 1 ms" ,
638+ title : "Show events with a self time of at least 1 ms" ,
639+ value : "1"
640+ } ,
641+ {
642+ text : "> 15 ms" ,
643+ title : "Show events with a self time of at least 15 ms" ,
644+ value : "15"
645+ } ,
646+ ]
595647 }
596648 ]
597649 } ) ;
650+
651+ new Settings (
652+ "profiler_all" ,
653+ {
654+ "min-event-time" : "0"
655+ }
656+ ) ;
598657} ;
599658
600659/**
0 commit comments