@@ -3395,7 +3395,9 @@ def init_root(self):
33953395 def update (self ):
33963396 items = self .scheduler .cumulative_worker_metrics .items ()
33973397 items = (
3398- (k , v ) for k , v in items if isinstance (k , tuple ) and k [0 ] == "get-data"
3398+ (k , v )
3399+ for k , v in items
3400+ if isinstance (k , tuple ) and k [0 ] == "get-data" and k [- 1 ] == "seconds"
33993401 )
34003402 for (_type , operation , freq ), value in items :
34013403 if operation not in self .data ["operation" ]:
@@ -3405,14 +3407,10 @@ def update(self):
34053407 idx = self .data ["operation" ].index (operation )
34063408 while idx >= len (self .data ["operation_val" ]):
34073409 self .data ["operation_val" ].append (float ("NaN" ))
3408- self .data ["operation_log" ].append (float ("NaN" ))
34093410 self .data [f"operation_text" ].append ("" )
34103411
34113412 self .data ["operation_val" ][idx ] = value
3412- self .data ["operation_log" ][idx ] = np .log (value )
3413-
3414- text = format_time (value ) if freq == "seconds" else f"{ value } { freq } "
3415- self .data [f"operation_text" ][idx ] = text
3413+ self .data [f"operation_text" ][idx ] = format_time (value )
34163414
34173415 if self .data :
34183416 from bokeh .palettes import small_palettes
@@ -3421,14 +3419,14 @@ def update(self):
34213419 fig = figure (x_range = self .data ["operation" ], title = "Get Data" )
34223420 renderers = fig .vbar (
34233421 x = "operation" ,
3424- top = "operation_log " ,
3422+ top = "operation_val " ,
34253423 width = 0.9 ,
34263424 source = self .source ,
34273425 legend_field = "operation" ,
34283426 line_color = "white" ,
34293427 fill_color = factor_cmap (
34303428 "operation" ,
3431- palette = small_palettes ["YlGnBu" ][9 ][: len (self .data ["operation" ])],
3429+ palette = small_palettes ["YlGnBu" ][len (self .data ["operation" ])],
34323430 factors = self .data ["operation" ],
34333431 ),
34343432 )
@@ -3484,12 +3482,7 @@ def handle_toggle(_toggle):
34843482 self .root = column (
34853483 self .function_selector ,
34863484 self .toggle ,
3487- row (
3488- [
3489- self .piechart ,
3490- self .barchart ,
3491- ]
3492- ),
3485+ row ([self .piechart , self .barchart ]),
34933486 sizing_mode = "scale_width" ,
34943487 )
34953488
@@ -3504,7 +3497,6 @@ def update(self):
35043497 and k [- 1 ] in ("bytes" , "seconds" )
35053498 )
35063499 for (_type , function_name , operation , freq ), value in items :
3507-
35083500 if operation not in self .operations :
35093501 self .substantial_change = True
35103502 self .operations .append (operation )
@@ -3621,7 +3613,9 @@ def update(self):
36213613 self .source .data = dict (data )
36223614
36233615 # Show total number of functions to choose from
3624- self .function_selector .title = f"Filter by function ({ len (self .function_selector .options )} ):"
3616+ self .function_selector .title = (
3617+ f"Filter by function ({ len (self .function_selector .options )} ):"
3618+ )
36253619
36263620 # replacing the child causes small blips if done every iteration vs updating renderers
36273621 # but it's needed when new functions and/or operations show up to rerender plot
0 commit comments