Improved IDE performance tests vega specs

This commit is contained in:
Vladimir Dolzhenko
2020-10-08 12:26:01 +02:00
parent 0682084ca3
commit 165a147dd8
3 changed files with 47 additions and 25 deletions
@@ -87,7 +87,8 @@
"update": "span(brush) ? invert('x', brush) : null"
}
]
}
},
{"name": "timestamp", "value": true, "bind": {"input": "checkbox"}}
],
"data": [
{
@@ -96,7 +97,7 @@
"comment": "source index pattern",
"index": "kotlin_ide_benchmarks*",
"comment": "it's a body of ES _search query to check query place it into `POST /kotlin_ide_benchmarks*/_search`",
"comment": "it uses Kibana specific %timefilter% for time frame selection"
"comment": "it uses Kibana specific %timefilter% for time frame selection",
"body": {
"size": 1000,
"query": {
@@ -132,6 +133,7 @@
"comment": "we need to have follow data: \"build_id\", \"metric_name\", \"metric_value\" and \"metric_error\"",
"comment": "so it has to be array of {\"build_id\": \"...\", \"metric_name\": \"...\", \"metric_value\": ..., \"metric_error\": ...}",
"transform": [
{"type": "collect","sort": {"field": "_source.build\\.timestamp"}},
{
"comment": "make alias: _source.build_id -> build_id",
"type": "formula",
@@ -156,6 +158,11 @@
"as": "metric_error",
"expr": "0"
},
{
"type": "formula",
"as": "timestamp",
"expr": "timeFormat(toDate(datum._source['build.timestamp']), '%Y-%m-%d %H:%M')"
},
{
"comment": "create `url` value that points to TC build",
"type": "formula",
@@ -182,7 +189,7 @@
"orient": "bottom",
"labelAngle": -20,
"labelAlign": "right",
"title": "build_id",
"title": {"signal": "timestamp ? 'timestamp' : 'build_id'"},
"titlePadding": 10,
"tickCount": 5,
"encode": {
@@ -208,7 +215,7 @@
"name": "x",
"type": "point",
"range": "width",
"domain": {"data": "table", "field": "build_id"}
"domain": {"data": "table", "field": {"signal": "timestamp ? 'timestamp' : 'build_id'"}}
},
{
"name": "y",
@@ -290,7 +297,7 @@
"encode": {
"hover": {"opacity": {"value": 1}, "strokeWidth": {"value": 4}},
"update": {
"x": {"scale": "x", "field": "build_id"},
"x": {"scale": "x", "field": {"signal": "timestamp ? 'timestamp' : 'build_id'"}},
"y": {"scale": "y", "field": "metric_value"},
"strokeWidth": {"value": 2},
"opacity": [
@@ -322,7 +329,7 @@
"href": {"field": "url"},
"cursor": {"value": "pointer"},
"size": {"scale": "size", "field": "metric_error"},
"x": {"scale": "x", "field": "build_id"},
"x": {"scale": "x", "field": {"signal": "timestamp ? 'timestamp' : 'build_id'"}},
"y": {"scale": "y", "field": "metric_value"},
"strokeWidth": {"value": 1},
"fill": {"scale": "color", "field": "metric_name"}
@@ -87,13 +87,14 @@
"update": "span(brush) ? invert('x', brush) : null"
}
]
}
},
{"name": "timestamp", "value": true, "bind": {"input": "checkbox"}}
],
"data": [
{
"name": "table",
"comment": "Uncomment `values` and comment `url` to test chart in VEGA editor https://vega.github.io/editor/#/",
/*"values" : {
"comment": "To test chart in VEGA editor https://vega.github.io/editor/#/ change `_values` to `values` and rename `url` property",
"_values" : {
"hits" : {
"hits" : [
{
@@ -113,12 +114,12 @@
}
]
}
},*/
},
"url": {
"comment": "source index pattern",
"index": "kotlin_ide_benchmarks*",
"comment": "it's a body of ES _search query to check query place it into `POST /kotlin_ide_benchmarks*/_search`",
"comment": "it uses Kibana specific %timefilter% for time frame selection"
"comment": "it uses Kibana specific %timefilter% for time frame selection",
"body": {
"size": 1000,
"query": {
@@ -136,6 +137,7 @@
"comment": "we need to have follow data: \"build_id\", \"metric_name\", \"metric_value\" and \"metric_error\"",
"comment": "so it has to be array of {\"build_id\": \"...\", \"metric_name\": \"...\", \"metric_value\": ..., \"metric_error\": ...}",
"transform": [
{"type": "collect","sort": {"field": "_source.build\\.timestamp"}},
{
"comment": "make alias: _source.build_id -> build_id",
"type": "formula",
@@ -160,6 +162,11 @@
"as": "metric_error",
"expr": "0"
},
{
"type": "formula",
"as": "timestamp",
"expr": "timeFormat(toDate(datum._source['build.timestamp']), '%Y-%m-%d %H:%M')"
},
{
"comment": "create `url` value that points to TC build",
"type": "formula",
@@ -186,7 +193,7 @@
"orient": "bottom",
"labelAngle": -20,
"labelAlign": "right",
"title": "build_id",
"title": {"signal": "timestamp ? 'timestamp' : 'build_id'"},
"titlePadding": 10,
"tickCount": 5,
"encode": {
@@ -212,7 +219,7 @@
"name": "x",
"type": "point",
"range": "width",
"domain": {"data": "table", "field": "build_id"}
"domain": {"data": "table", "field": {"signal": "timestamp ? 'timestamp' : 'build_id'"}}
},
{
"name": "y",
@@ -294,7 +301,7 @@
"encode": {
"hover": {"opacity": {"value": 1}, "strokeWidth": {"value": 4}},
"update": {
"x": {"scale": "x", "field": "build_id"},
"x": {"scale": "x", "field": {"signal": "timestamp ? 'timestamp' : 'build_id'"}},
"y": {"scale": "y", "field": "metric_value"},
"strokeWidth": {"value": 2},
"opacity": [
@@ -326,7 +333,7 @@
"href": {"field": "url"},
"cursor": {"value": "pointer"},
"size": {"scale": "size", "field": "metric_error"},
"x": {"scale": "x", "field": "build_id"},
"x": {"scale": "x", "field": {"signal": "timestamp ? 'timestamp' : 'build_id'"}},
"y": {"scale": "y", "field": "metric_value"},
"strokeWidth": {"value": 1},
"fill": {"scale": "color", "field": "metric_name"}
@@ -87,13 +87,14 @@
"update": "span(brush) ? invert('x', brush) : null"
}
]
}
},
{"name": "timestamp", "value": true, "bind": {"input": "checkbox"}}
],
"data": [
{
"name": "table",
"comment": "Uncomment `values` and comment `url` to test chart in VEGA editor https://vega.github.io/editor/#/",
/*"values" : {
"comment": "To test chart in VEGA editor https://vega.github.io/editor/#/ change `_values` to `values` and rename `url` property",
"_values" : {
"hits" : {
"hits" : [
{
@@ -153,12 +154,12 @@
}
]
}
},*/
},
"url": {
"comment": "source index pattern",
"index": "kotlin_ide_benchmarks*",
"comment": "it's a body of ES _search query to check query place it into `POST /kotlin_ide_benchmarks*/_search`",
"comment": "it uses Kibana specific %timefilter% for time frame selection"
"comment": "it uses Kibana specific %timefilter% for time frame selection",
"body": {
"size": 1000,
"query": {
@@ -183,16 +184,23 @@
"comment": "we need to have follow data: \"build_id\", \"metric_name\", \"metric_value\" and \"metric_error\"",
"comment": "so it has to be array of {\"build_id\": \"...\", \"metric_name\": \"...\", \"metric_value\": ..., \"metric_error\": ...}",
"transform": [
{"type": "collect","sort": {"field": "_source.build\\.timestamp"}},
{"type": "flatten", "fields": ["_source.metrics"], "as": ["metrics"]},
{
"type": "project",
"fields": [
"_source.build_id",
"_source.build\\.timestamp",
"metrics.metric_name",
"metrics.metric_value",
"metrics.metric_error"
],
"as": ["build_id", "metric_name", "metric_value", "metric_error"]
"as": ["build_id", "build_timestamp", "metric_name", "metric_value", "metric_error"]
},
{
"type": "formula",
"as": "timestamp",
"expr": "timeFormat(toDate(datum.build_timestamp), '%Y-%m-%d %H:%M')"
},
{
"comment": "create `url` value that points to TC build",
@@ -220,7 +228,7 @@
"orient": "bottom",
"labelAngle": -20,
"labelAlign": "right",
"title": "build_id",
"title": {"signal": "timestamp ? 'timestamp' : 'build_id'"},
"titlePadding": 10,
"tickCount": 5,
"encode": {
@@ -246,7 +254,7 @@
"name": "x",
"type": "point",
"range": "width",
"domain": {"data": "table", "field": "build_id"}
"domain": {"data": "table", "field": {"signal": "timestamp ? 'timestamp' : 'build_id'"}}
},
{
"name": "y",
@@ -328,7 +336,7 @@
"encode": {
"hover": {"opacity": {"value": 1}, "strokeWidth": {"value": 4}},
"update": {
"x": {"scale": "x", "field": "build_id"},
"x": {"scale": "x", "field": {"signal": "timestamp ? 'timestamp' : 'build_id'"}},
"y": {"scale": "y", "field": "metric_value"},
"strokeWidth": {"value": 2},
"opacity": [
@@ -360,7 +368,7 @@
"href": {"field": "url"},
"cursor": {"value": "pointer"},
"size": {"scale": "size", "field": "metric_error"},
"x": {"scale": "x", "field": "build_id"},
"x": {"scale": "x", "field": {"signal": "timestamp ? 'timestamp' : 'build_id'"}},
"y": {"scale": "y", "field": "metric_value"},
"strokeWidth": {"value": 1},
"fill": {"scale": "color", "field": "metric_name"}