From 9645460e73537c19faf729481fd3e5e42e47ce22 Mon Sep 17 00:00:00 2001 From: Rick Boyd Date: Wed, 23 Feb 2022 07:25:35 -0500 Subject: [PATCH] Add Ingest Processor Line Chart to Chart Generator (#1444) add ingest type line chart --- esrally/chart_generator.py | 89 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/esrally/chart_generator.py b/esrally/chart_generator.py index 3ea79c420..003677f33 100644 --- a/esrally/chart_generator.py +++ b/esrally/chart_generator.py @@ -567,6 +567,11 @@ def index(environment, race_configs, title): }, } + @staticmethod + def ingest(title, environment, race_config): + # TBD + return None + class TimeSeriesCharts: @staticmethod @@ -1214,6 +1219,79 @@ def index(environment, race_configs, title): }, } + @staticmethod + def ingest(environment, race_config, title): + track = race_config.track + flavor = race_config.name + vis_state = { + "title": title, + "type": "metrics", + "params": { + "axis_formatter": "number", + "axis_position": "left", + "id": str(uuid.uuid4()), + "index_pattern": "rally-metrics-*", + "interval": "1d", + "series": [ + { + "axis_position": "left", + "chart_type": "line", + "color": "#68BC00", + "fill": "0", + "formatter": "number", + "id": str(uuid.uuid4()), + "line_width": "1", + "metrics": [{"id": str(uuid.uuid4()), "type": "sum", "field": "value"}], + "point_size": "3", + "separate_axis": 0, + "split_color_mode": "rainbow", + "split_mode": "terms", + "terms_field": "meta.type", + "stacked": "none", + "filter": 'environment:"%s" AND track:"%s" AND meta.tag_name:"%s" AND name:"ingest_pipeline_processor_time"' + % (environment, track, flavor), + "label": "Ingest Processor Time (ms)", + "steps": 0, + } + ], + "show_legend": 1, + "show_grid": 1, + "drop_last_bucket": 0, + "time_field": "race-timestamp", + "type": "timeseries", + "annotations": [ + { + "fields": "message", + "template": "{{message}}", + "index_pattern": "rally-annotations", + "query_string": f'((NOT _exists_:track) OR track:"{track}") ' + f"AND ((NOT _exists_:chart) OR chart:ingest) " + f'AND ((NOT _exists_:chart-name) OR chart-name:"{title}") AND environment:"{environment}"', + "id": str(uuid.uuid4()), + "color": "rgba(102,102,102,1)", + "time_field": "race-timestamp", + "icon": "fa-tag", + "ignore_panel_filters": 1, + } + ], + "axis_min": "0", + }, + "aggs": [], + "listeners": {}, + } + return { + "id": str(uuid.uuid4()), + "type": "visualization", + "attributes": { + "title": title, + "visState": json.dumps(vis_state), + "uiStateJSON": "{}", + "description": "index", + "version": 1, + "kibanaSavedObjectMeta": {"searchSourceJSON": '{"query":"*","filter":[]}'}, + }, + } + class RaceConfigTrack: def __init__(self, cfg, repository, name=None): @@ -1261,6 +1339,16 @@ def generate_index_ops(chart_type, race_configs, environment, logger): return charts +def generate_ingest(chart_type, race_configs, environment): + structures = [] + + for race_config in race_configs: + if "ingest" in race_config.charts: + title = f"{race_config.name}-ingest-time" + structures.append(chart_type.ingest(environment, race_config, title)) + return structures + + def generate_queries(chart_type, race_configs, environment): # output JSON structures structures = [] @@ -1542,6 +1630,7 @@ def add_race_configs(license_configs, flavor_name, track_name): def gen_charts_per_track_configs(race_configs, chart_type, env, flavor=None, logger=None): charts = ( generate_index_ops(chart_type, race_configs, env, logger) + + generate_ingest(chart_type, race_configs, env) + generate_io(chart_type, race_configs, env) + generate_gc(chart_type, race_configs, env) + generate_merge_time(chart_type, race_configs, env)