in osbenchmark/chart_generator.py [0:0]
def io(title, environment, test_execution_config):
vis_state = {
"title": title,
"type": "histogram",
"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": "filters"
},
"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": "[Bytes]"
},
"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": "[Bytes]"
},
"type": "value"
}
]
},
"aggs": [
{
"id": "1",
"enabled": True,
"type": "sum",
"schema": "metric",
"params": {
"field": "value.single",
"customLabel": "[Bytes]"
}
},
{
"id": "2",
"enabled": True,
"type": "filters",
"schema": "segment",
"params": {
"filters": [
{
"input": {
"query": {
"query_string": {
"analyze_wildcard": True,
"query": "name:index_size"
}
}
},
"label": "Index size"
},
{
"input": {
"query": {
"query_string": {
"analyze_wildcard": True,
"query": "name:bytes_written"
}
}
},
"label": "Bytes written"
}
]
}
},
{
"id": "3",
"enabled": True,
"type": "terms",
"schema": "split",
"params": {
"field": "distribution-version",
"size": 10,
"order": "asc",
"orderBy": "_term",
"row": False
}
},
{
"id": "4",
"enabled": True,
"type": "terms",
"schema": "group",
"params": {
"field": "user-tags.setup",
"size": 5,
"order": "desc",
"orderBy": "_term"
}
}
],
"listeners": {}
}
search_source = {
"index": "benchmark-results-*",
"query": {
"query_string": {
"query": BarCharts.filter_string(environment, test_execution_config),
"analyze_wildcard": True
}
},
"filter": []
}
return {
"id": str(uuid.uuid4()),
"type": "visualization",
"attributes": {
"title": title,
"visState": json.dumps(vis_state),
"uiStateJSON": BarCharts.UI_STATE_JSON,
"description": "io",
"version": 1,
"kibanaSavedObjectMeta": {
"searchSourceJSON": json.dumps(search_source)
}
}
}