Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for merge_count and merge_time graphs #1211

Merged
merged 4 commits into from
Mar 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
205 changes: 204 additions & 1 deletion esrally/chart_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,186 @@ def gc(title, environment, race_config):
}
}

@staticmethod
def merge_time(title, environment, race_config):
vis_state = {
"title": title,
"type": "metrics",
"params": {
"axis_formatter": "number",
"axis_position": "left",
"id": str(uuid.uuid4()),
"index_pattern": "rally-results-*",
"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": "avg",
"field": "value.single"
}
],
"point_size": "3",
"seperate_axis": 1,
"split_mode": "filters",
"stacked": "none",
"filter": "",
"split_filters": [
{
"filter": "merge_time",
"label": "Cumulative merge time",
"color": "rgba(0,191,179,1)",
"id": str(uuid.uuid4())
},
{
"filter": "merge_throttle_time",
"label": "Cumulative merge throttle time",
"color": "rgba(254,209,10,1)",
"id": str(uuid.uuid4())
}
],
"label": "Merge Times",
"value_template": "{{value}} ms",
"steps": 0
}
],
"show_legend": 1,
"show_grid": 1,
"drop_last_bucket": 0,
"time_field": "race-timestamp",
"type": "timeseries",
"filter": TimeSeriesCharts.filter_string(environment, race_config),
"annotations": [
{
"fields": "message",
"template": "{{message}}",
"index_pattern": "rally-annotations",
"query_string": f"((NOT _exists_:track) OR track:\"{race_config.track}\") "
f"AND ((NOT _exists_:chart) OR chart:merge_times) "
f"AND ((NOT _exists_:chart_name) OR chart:\"{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": "merge_times",
"version": 1,
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"query\":\"*\",\"filter\":[]}"
}
}
}

@staticmethod
def merge_count(title, environment, race_config):
vis_state = {
"title": title,
"type": "metrics",
"params": {
"axis_formatter": "number",
"axis_position": "left",
"id": str(uuid.uuid4()),
"index_pattern": "rally-results-*",
"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": "avg",
"field": "value.single"
}
],
"point_size": "3",
"seperate_axis": 1,
"split_mode": "filters",
"stacked": "none",
"filter": "",
"split_filters": [
{
"filter": "merge_count",
"label": "Cumulative merge count",
"color": "rgba(0,191,179,1)",
"id": str(uuid.uuid4())
}
],
"label": "Merge Count",
"value_template": "{{value}}",
"steps": 0
}
],
"show_legend": 1,
"show_grid": 1,
"drop_last_bucket": 0,
"time_field": "race-timestamp",
"type": "timeseries",
"filter": TimeSeriesCharts.filter_string(environment, race_config),
"annotations": [
{
"fields": "message",
"template": "{{message}}",
"index_pattern": "rally-annotations",
"query_string": f"((NOT _exists_:track) OR track:\"{race_config.track}\") "
f"AND ((NOT _exists_:chart) OR chart:merge_count) "
f"AND ((NOT _exists_:chart_name) OR chart:\"{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": "merge_count",
"version": 1,
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"query\":\"*\",\"filter\":[]}"
}
}
}

@staticmethod
def io(title, environment, race_config):
vis_state = {
Expand Down Expand Up @@ -1377,7 +1557,8 @@ def load_track(self, cfg, name=None, params=None, excluded_tasks=None):
cfg.add(config.Scope.applicationOverride, "track", "track.name", name)
# another hack to ensure any track-params in the race config are used by Rally's track loader
cfg.add(config.Scope.applicationOverride, "track", "params", params)
cfg.add(config.Scope.application, "track", "exclude.tasks", excluded_tasks)
if excluded_tasks:
cfg.add(config.Scope.application, "track", "exclude.tasks", excluded_tasks)
return track.load_track(cfg)

def get_track(self, cfg, name=None, params=None, excluded_tasks=None):
Expand Down Expand Up @@ -1433,6 +1614,26 @@ def generate_gc(chart_type, race_configs, environment):

return structures

def generate_merge_time(chart_type, race_configs, environment):
structures = []
for race_config in race_configs:
if "merge_times" in race_config.charts:
title = chart_type.format_title(environment, race_config.track, es_license=race_config.es_license,
suffix=f"{race_config.label}-merge-times")
structures.append(chart_type.merge_time(title, environment, race_config))

return structures

def generate_merge_count(chart_type, race_configs, environment):
structures = []
for race_config in race_configs:
if "merge_count" in race_config.charts:
title = chart_type.format_title(environment, race_config.track, es_license=race_config.es_license,
suffix=f"{race_config.label}-merge-count")
structures.append(chart_type.merge_count(title, environment, race_config))

return structures


def generate_segment_memory(chart_type, race_configs, environment):
structures = []
Expand Down Expand Up @@ -1660,6 +1861,8 @@ def gen_charts_per_track_configs(race_configs, chart_type, env, flavor=None, log
charts = generate_index_ops(chart_type, race_configs, env, logger) + \
generate_io(chart_type, race_configs, env) + \
generate_gc(chart_type, race_configs, env) + \
generate_merge_time(chart_type, race_configs, env) + \
generate_merge_count(chart_type, race_configs, env) + \
generate_segment_memory(chart_type, race_configs, env) + \
generate_queries(chart_type, race_configs, env)

Expand Down