diff --git a/dashboards/dashboard_fe2ti.py b/dashboards/dashboard_fe2ti.py index b540eaca9880c2e45b97fe644231d3ee3442dfbf..366e88f03a99d82e8ce25cce207a8d8bec80b9d3 100644 --- a/dashboards/dashboard_fe2ti.py +++ b/dashboards/dashboard_fe2ti.py @@ -102,9 +102,13 @@ def dashboard_fe2ti(): get_time_series_panel( field, data_source, - measurment_name, - where=where, - group_by=[f.name for f in filters], + [Query(select_=field.name, + from_=measurment_name, + where_=where, + group_by=[f.name for f in filters], + from_string=not is_regex(measurment_name), + select_string=not is_regex(field.name)) + ], overrides=overrides, ) for field in fields] diff --git a/dashboards/dashboard_pystencils.py b/dashboards/dashboard_pystencils.py index 251dde7cabfafd52ac97b9573ae720e81e79693e..9dd297f6b4e7479e6a4ca1d860635e522dccc74e 100644 --- a/dashboards/dashboard_pystencils.py +++ b/dashboards/dashboard_pystencils.py @@ -64,9 +64,12 @@ def dashboard_pystencils_cpu(): get_time_series_panel( field, data_source, - f"/^${benchmark.name}$/", - where=where, - group_by=group_by, + [Query(select_=field.name, + from_=f"/^${benchmark.name}$/", + where_=where, + group_by=group_by, + from_string=not is_regex(f"/^${benchmark.name}$/"), + select_string=not is_regex(field.name))], ) for field in fields] @@ -125,9 +128,12 @@ def dashboard_pystencils_gpu(): get_time_series_panel( field, data_source, - f"/^${benchmark.name}$/", - where=where, - group_by=group_by, + [Query(select_=field.name, + from_=f"/^${benchmark.name}$/", + where_=where, + group_by=group_by, + from_string=not is_regex(f"/^${benchmark.name}$/"), + select_string=not is_regex(field.name))], ) for field in fields] diff --git a/dashboards/dashboard_walberla.py b/dashboards/dashboard_walberla.py index 78410e304b84aa44fb2ee2f64c43e13f168ba795..fef4cae169a8082fce2d9bb29e0a5fe0790bc3c0 100644 --- a/dashboards/dashboard_walberla.py +++ b/dashboards/dashboard_walberla.py @@ -115,9 +115,12 @@ def dashboard_uniformgridcpu(): get_time_series_panel( field, data_source, - measurment_name, - where=where, - group_by=[f.name for f in filters], + [Query(select_=field.name, + from_=measurment_name, + where_=where, + group_by=[f.name for f in filters], + from_string=not is_regex(measurment_name), + select_string=not is_regex(field.name))], ) for field in fields ] @@ -188,9 +191,12 @@ def dashboard_uniformgridgpu(): get_time_series_panel( field, data_source, - measurment_name, - where=where, - group_by=[f.name for f in filters], + [Query(select_=field.name, + from_=measurment_name, + where_=where, + group_by=[f.name for f in filters], + from_string=not is_regex(measurment_name), + select_string=not is_regex(field.name))], ) for field in fields ] @@ -271,9 +277,12 @@ def dashboard_uniformgridgpu_profile(): get_time_series_panel( field, data_source, - measurment_name, - where=where, - group_by=[f.name for f in filters], + [Query(select_=field.name, + from_=measurment_name, + where_=where, + group_by=[f.name for f in filters], + from_string=not is_regex(measurment_name), + select_string=not is_regex(field.name))], ) for field in fields ] @@ -304,54 +313,16 @@ def dashboard_uniformgridcpu_relativeperformance(): ) filters = [ - Filter("host", multi=True, default_value="icx36"), - Filter("cellsPerBlock_0", multi=True, default_value="128"), + Filter("host", multi=False, default_value="icx36"), + Filter("cellsPerBlock_0", multi=False, default_value="128"), Filter("collisionSetup"), - Filter("project_id", multi=True, default_value="walberla/walberla"), - Filter("branch", multi=True, default_value="master"), - Filter("BandwidthBenchmark", multi=True, default_value="bw_stream"), + Filter("project_id", multi=False, default_value="walberla/walberla"), + Filter("branch", multi=False, default_value="master"), + Filter("BandwidthBenchmark", multi=False, default_value="bw_stream"), ] fieldConfig = { "defaults": { - "custom": { - "lineWidth": 1, - "fillOpacity": 80, - "gradientMode": "none", - "axisPlacement": "auto", - "axisLabel": "", - "axisColorMode": "text", - "axisBorderShow": False, - "scaleDistribution": { - "type": "linear" - }, - "axisCenteredZero": False, - "hideFrom": { - "tooltip": False, - "viz": False, - "legend": False - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "color": { - "mode": "palette-classic" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": None - }, - { - "color": "red", - "value": 80 - } - ] - }, "fieldMinMax": True, "max": 1, "unit": "percentunit" @@ -367,15 +338,16 @@ def dashboard_uniformgridcpu_relativeperformance(): filter_vars = [ get_dashboard_variable(filter, measurment_name, data_source) - for filter in filters[0:5] + for filter in filters[1:5] ] filter_vars = [ + get_dashboard_variable(filters[0], measurment_name2, data_source), *filter_vars, get_field_keys_dashboard_variable( filters[5], measurment_name2, data_source ), ] - + row_repeat_var = [fv for fv in filter_vars if fv.name == row_repeat][0] where0A2 = join_conditions( @@ -610,12 +582,14 @@ def dashboard_uniformgridcpu_relativeperformance(): [query0A1, query0B1], alias_list = [alias0A, ""], transformations=transformations0, + gridPos=get_grid_pos(14, 10, 0, 1), ), # Panel 1 get_table_panel( fields[1], data_source, [query1A], + gridPos=get_grid_pos(5, 10, 10, 1), ), # Panel 2 get_bar_chart_panel( @@ -624,16 +598,12 @@ def dashboard_uniformgridcpu_relativeperformance(): [query2A1, query2B1], alias_list = [alias2A, ""], transformations=transformations2, + gridPos=get_grid_pos(9, 10, 10, 6), ), ] - row = pack_in_row( - title=f"{row_repeat}: ${row_repeat_var.name}", - panels=[*panels], - repeat=Repeat("v", row_repeat_var.name), - ) return build_dashboard( - options, rows=[row], templating=[*filter_vars], annotations=annotations + options, panels=panels, templating=filter_vars, annotations=annotations ) @@ -659,6 +629,10 @@ def dashboard_fslbmgravitywave(): fields = [ PanelInfos("simulationTime", Units.seconds), + PanelInfos("/.*_percentage/", Units.percent), + PanelInfos("/Communication:.*_percentage/", Units.percent), + PanelInfos(r"/Sweep:.*_percentage/", Units.percent), + PanelInfos(r"/MPI Barrier:.*_percentage/", Units.percent), ] filter_vars = [ @@ -676,25 +650,32 @@ def dashboard_fslbmgravitywave(): for group, color in zip(groups, colors) ] + queries = [ + Query( + select_=field.name, + from_=measurment_name, + where_=where, + group_by=[f.name for f in filters], + from_string=not is_regex(measurment_name), + select_string=not is_regex(field.name) + ) + for index, field in enumerate(fields) + ] + panels = [ get_time_series_panel( - field, + fields[0], data_source, - measurment_name, - where=where, - group_by=[f.name for f in filters], - gridPos=get_grid_pos(12, 24, 0, idx * (13)), + [queries[0]], + gridPos=get_grid_pos(12, 24, 0, 0), ) - for idx, field in enumerate(fields) ] panels.append( get_time_series_panel( - PanelInfos("/.*_percentage/", Units.percent), + fields[1], data_source, - measurment_name, - where=where, - group_by=[f.name for f in filters], - gridPos=get_grid_pos(12, 12, 0, len(fields) * (13)), + [queries[1]], + gridPos=get_grid_pos(12, 12, 0, 13), drawStyle="bars", stacking={"mode": "normal"}, fillOpacity=70, @@ -707,12 +688,10 @@ def dashboard_fslbmgravitywave(): panels.append( get_time_series_panel( - PanelInfos("/Communication:.*_percentage/", Units.percent), + fields[2], data_source, - measurment_name, - where=where, - group_by=[f.name for f in filters], - gridPos=get_grid_pos(12, 12, 12, len(fields) * (13)), + [queries[2]], + gridPos=get_grid_pos(12, 12, 12, 13), drawStyle="bars", stacking={"mode": "normal"}, fillOpacity=70, @@ -723,12 +702,10 @@ def dashboard_fslbmgravitywave(): panels.append( get_time_series_panel( - PanelInfos(r"/Sweep:.*_percentage/", Units.percent), + fields[3], data_source, - measurment_name, - where=where, - group_by=[f.name for f in filters], - gridPos=get_grid_pos(12, 12, 0, (len(fields) + 1) * (13)), + [queries[3]], + gridPos=get_grid_pos(12, 12, 0, 2 * 13), drawStyle="bars", stacking={"mode": "normal"}, fillOpacity=70, @@ -739,12 +716,10 @@ def dashboard_fslbmgravitywave(): panels.append( get_time_series_panel( - PanelInfos(r"/MPI Barrier:.*_percentage/", Units.percent), + fields[4], data_source, - measurment_name, - where=where, - group_by=[f.name for f in filters], - gridPos=get_grid_pos(12, 12, 12, (len(fields) + 1) * (13)), + [queries[4]], + gridPos=get_grid_pos(12, 12, 12, 2 * 13), drawStyle="bars", stacking={"mode": "normal"}, fillOpacity=70, diff --git a/dashboards/panels.py b/dashboards/panels.py index bfe23ccb2b86cc82c89ffbd1ce874793fb0dfe2c..7dd6dce50c429106a17497b1c81a634b2acba90d 100644 --- a/dashboards/panels.py +++ b/dashboards/panels.py @@ -22,18 +22,11 @@ def is_regex(name): def get_time_series_panel(panel_infos: PanelInfos, data_source: str, - measurment_name: str, + query_list: list[Query], *, - where=None, - group_by=None, overrides=None, **kwargs): - query = Query(select_=panel_infos.name, - from_=measurment_name, - where_=where, - group_by=group_by, - from_string=not is_regex(measurment_name), - select_string=not is_regex(panel_infos.name)) + targets = [get_influx_target(str(query)) for query in query_list] new_kwargs = {**kwargs} if panel_infos.absthreshold is not None: new_kwargs.update({'thresholdType': 'absolute', @@ -46,7 +39,7 @@ def get_time_series_panel(panel_infos: PanelInfos, return TimeSeries( title=panel_infos.name, dataSource=data_source, - targets=[get_influx_target(str(query))], + targets=targets, unit=panel_infos.unit, pointSize=9, overrides=overrides, @@ -150,14 +143,22 @@ def get_bar_chart_panel(panel_infos: PanelInfos, Threshold('red', index=1, value=float(panel_infos.absthreshold), op='lt'), ], } ) - - + extraJson = {"fieldConfig": { + "defaults": { + "fieldMinMax": True, + "max": 1, + "unit": panel_infos.unit + } + } + } + return BarChart( title=panel_infos.name, dataSource=data_source, targets=targets, transformations=transformations, - xTickLabelRotation=-45, + xTickLabelRotation=-45, + extraJson=extraJson, **new_kwargs, )