File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4040DEF_TIMELINE_LIMIT = 50 # Default number of revisions to be plotted
4141 # Possible values 10,50,200,1000
4242
43+ TIMELINE_GRID_LIMIT = 30 # Number of benchmarks beyond which the timeline view
44+ # is disabled as default setting. Too many benchmarks make
45+ # the view slow, and put load on the database, which may be
46+ # undeseriable.
47+
4348#TIMELINE_BRANCHES = True # NOTE: Only the default branch is currently shown
4449 # Get timeline results for specific branches
4550 # Set to False if you want timeline plots and results only for trunk.
Original file line number Diff line number Diff line change @@ -224,6 +224,12 @@ def comparison(request):
224224 'selecteddirection' : selecteddirection
225225 })
226226
227+ def get_setting (name , default = None ):
228+ if hasattr (settings , name ):
229+ return getattr (settings , name )
230+ else :
231+ return default
232+
227233
228234@require_GET
229235def gettimelinedata (request ):
@@ -442,7 +448,7 @@ def timeline(request):
442448 defaultlast = data ['revs' ]
443449
444450 benchmarks = Benchmark .objects .all ()
445- grid_limit = 30
451+
446452 defaultbenchmark = "grid"
447453 if not len (benchmarks ):
448454 return no_data_found (request )
@@ -457,7 +463,7 @@ def timeline(request):
457463 name = settings .DEF_BENCHMARK )
458464 except Benchmark .DoesNotExist :
459465 pass
460- elif len (benchmarks ) >= grid_limit :
466+ elif len (benchmarks ) >= get_setting ( 'TIMELINE_GRID_LIMIT' , 30 ) :
461467 defaultbenchmark = 'show_none'
462468
463469 if 'ben' in data and data ['ben' ] != defaultbenchmark :
You can’t perform that action at this time.
0 commit comments