in osbenchmark/chart_generator.py [0:0]
def index(environment, test_execution_configs, title):
filters = []
for test_execution_config in test_execution_configs:
label = index_label(test_execution_config)
# the assumption is that we only have one bulk task
for bulk_task in test_execution_config.bulk_tasks:
filters.append({
"input": {
"query": {
"query_string": {
"analyze_wildcard": True,
"query": "task:\"%s\" AND %s" % (bulk_task, BarCharts.filter_string(environment, test_execution_config))
}
}
},
"label": label
})
vis_state = {
"aggs": [
{
"enabled": True,
"id": "1",
"params": {
"customLabel": "Median Indexing Throughput [docs/s]",
"field": "value.median",
"percents": [
50
]
},
"schema": "metric",
"type": "median"
},
{
"enabled": True,
"id": "2",
"params": {
"field": "distribution-version",
"order": "asc",
"orderBy": "_term",
"size": 10
},
"schema": "segment",
"type": "terms"
},
{
"enabled": True,
"id": "3",
"params": {
"field": "user-tags.setup",
"order": "desc",
"orderBy": "_term",
"size": 10
},
"schema": "group",
"type": "terms"
},
{
"enabled": True,
"id": "4",
"params": {
"filters": filters
},
"schema": "split",
"type": "filters"
}
],
"listeners": {},
"params": {
"addLegend": True,
"addTimeMarker": False,
"addTooltip": True,
"categoryAxes": [
{
"id": "CategoryAxis-1",
"labels": {
"show": True,
"truncate": 100
},
"position": "bottom",
"scale": {
"type": "linear"
},
"show": True,
"style": {},
"title": {
"text": "distribution-version: Ascending"
},
"type": "category"
}
],
"defaultYExtents": False,
"drawLinesBetweenPoints": True,
"grid": {
"categoryLines": False,
"style": {
"color": "#eee"
}
},
"interpolate": "linear",
"legendPosition": "right",
"radiusRatio": 9,
"scale": "linear",
"seriesParams": [
{
"data": {
"id": "1",
"label": "Median Indexing Throughput [docs/s]"
},
"drawLinesBetweenPoints": True,
"mode": "normal",
"show": "True",
"showCircles": True,
"type": "histogram",
"valueAxis": "ValueAxis-1"
}
],
"setYExtents": False,
"showCircles": True,
"times": [],
"valueAxes": [
{
"id": "ValueAxis-1",
"labels": {
"filter": False,
"rotate": 0,
"show": True,
"truncate": 100
},
"name": "LeftAxis-1",
"position": "left",
"scale": {
"mode": "normal",
"type": "linear"
},
"show": True,
"style": {},
"title": {
"text": "Median Indexing Throughput [docs/s]"
},
"type": "value"
}
],
"row": True
},
"title": title,
"type": "histogram"
}
search_source = {
"index": "benchmark-results-*",
"query": {
"query_string": {
"analyze_wildcard": True,
"query": "environment:\"%s\" AND active:true AND name:\"throughput\"" % environment
}
},
"filter": []
}
return {
"id": str(uuid.uuid4()),
"type": "visualization",
"attributes": {
"title": title,
"visState": json.dumps(vis_state),
"uiStateJSON": BarCharts.UI_STATE_JSON,
"description": "index",
"version": 1,
"kibanaSavedObjectMeta": {
"searchSourceJSON": json.dumps(search_source)
}
}
}