Support hasError in ide perf tests vega charts

This commit is contained in:
Vladimir Dolzhenko
2020-10-15 00:09:48 +02:00
parent 051d914996
commit d9b3f91d73
3 changed files with 185 additions and 6 deletions
@@ -93,6 +93,75 @@
"data": [
{
"name": "table",
"comment": "To test chart in VEGA editor https://vega.github.io/editor/#/ change `_values` to `values` and rename `url` property",
"_values": {
"hits" : {
"hits" : [
{
"_source" : {
"buildTimestamp" : "2020-10-14T15:12:14+0000",
"buildId" : 90615916,
"metrics" : [
{
"hasError" : true
}
],
"geomMean" : 157,
"benchmark" : "completion-basic"
}
},
{
"_source" : {
"buildTimestamp" : "2020-10-14T13:15:31+0000",
"buildId" : 90615916,
"geomMean" : 80,
"benchmark" : "completion-basic-charFilter"
}
},
{
"_source" : {
"buildTimestamp" : "2020-10-14T10:53:52+0000",
"buildId" : 90597868,
"geomMean" : 160,
"benchmark" : "completion-basic"
}
},
{
"_source" : {
"buildTimestamp" : "2020-10-14T08:57:05+0000",
"buildId" : 90597868,
"geomMean" : 79,
"benchmark" : "completion-basic-charFilter"
}
},
{
"_source" : {
"buildTimestamp" : "2020-10-14T03:04:10+0000",
"buildId" : 90570192,
"geomMean" : 79,
"benchmark" : "completion-basic-charFilter"
}
},
{
"_source" : {
"buildTimestamp" : "2020-10-14T03:04:09+0000",
"buildId" : 90570192,
"geomMean" : 60,
"benchmark" : "completion-basic"
}
},
{
"_source" : {
"buildTimestamp" : "2020-10-14T00:42:58+0000",
"buildId" : 90546466,
"geomMean" : 158,
"benchmark" : "completion-basic"
}
}
]
}
},
"url": {
//"comment": "source index pattern",
"index": "kotlin_ide_benchmarks*",
@@ -126,7 +195,7 @@
]
}
},
"_source": ["buildId", "benchmark", "buildTimestamp", "geomMean"],
"_source": ["buildId", "benchmark", "buildTimestamp", "metrics.hasError", "geomMean"],
"sort": [{"buildTimestamp": {"order": "asc"}}]
}
},
@@ -159,6 +228,12 @@
"as": "metricError",
"expr": "1"
},
{
"comment": "make alias: _source.metrics[0].hasError -> hasError",
"type": "formula",
"as": "hasError",
"expr": "datum._source.metrics ? datum._source.metrics[0].hasError : false"
},
{
"type": "formula",
"as": "timestamp",
@@ -319,6 +394,38 @@
}
}
},
{
"type": "symbol",
"from": {"data": "series"},
"encode": {
"enter": {
"fill": {"value": "#B00"},
"size": [{ "test": "datum.hasError", "value": 250 }, {"value": 0}],
"shape": {"value": "cross"},
"angle": {"value": 45},
"x": {"scale": "x", "field": {"signal": "timestamp ? 'timestamp' : 'buildId'"}},
"y": {"scale": "y", "field": "metricValue"},
"strokeWidth": {"value": 1},
"opacity": [
{
"test": "(!domain || inrange(datum.buildId, domain)) && datum.hasError && (!length(data('selected')) || indata('selected', 'value', datum.metricName))",
"value": 1
},
{"value": 0.15}
]
},
"update": {
"opacity": [
{
"test": "(!domain || inrange(datum.buildId, domain)) && datum.hasError && (!length(data('selected')) || indata('selected', 'value', datum.metricName))",
"value": 1
},
{"value": 0.15}
]
}
},
"zindex": 1
},
{
"type": "symbol",
"from": {"data": "series"},
@@ -94,7 +94,7 @@
{
"name": "table",
"comment": "To test chart in VEGA editor https://vega.github.io/editor/#/ change `_values` to `values` and rename `url` property",
"_values" : {
"_values": {
"hits" : {
"hits" : [
{
@@ -130,7 +130,7 @@
]
}
},
"_source": ["buildId", "benchmark", "buildTimestamp", "geomMean"],
"_source": ["buildId", "benchmark", "buildTimestamp", "metrics.hasError", "geomMean"],
"sort": [{"buildTimestamp": {"order": "asc"}}]
}
},
@@ -161,7 +161,13 @@
"comment": "define metricError",
"type": "formula",
"as": "metricError",
"expr": "0"
"expr": "1"
},
{
"comment": "make alias: _source.metrics[0].hasError -> hasError",
"type": "formula",
"as": "hasError",
"expr": "datum._source.metrics ? datum._source.metrics[0].hasError : false"
},
{
"type": "formula",
@@ -323,6 +329,38 @@
}
}
},
{
"type": "symbol",
"from": {"data": "series"},
"encode": {
"enter": {
"fill": {"value": "#B00"},
"size": [{ "test": "datum.hasError", "value": 250 }, {"value": 0}],
"shape": {"value": "cross"},
"angle": {"value": 45},
"x": {"scale": "x", "field": {"signal": "timestamp ? 'timestamp' : 'buildId'"}},
"y": {"scale": "y", "field": "metricValue"},
"strokeWidth": {"value": 1},
"opacity": [
{
"test": "(!domain || inrange(datum.buildId, domain)) && datum.hasError && (!length(data('selected')) || indata('selected', 'value', datum.metricName))",
"value": 1
},
{"value": 0.15}
]
},
"update": {
"opacity": [
{
"test": "(!domain || inrange(datum.buildId, domain)) && datum.hasError && (!length(data('selected')) || indata('selected', 'value', datum.metricName))",
"value": 1
},
{"value": 0.15}
]
}
},
"zindex": 1
},
{
"type": "symbol",
"from": {"data": "series"},
@@ -94,7 +94,7 @@
{
"name": "table",
"comment": "To test chart in VEGA editor https://vega.github.io/editor/#/ change `_values` to `values` and rename `url` property",
"_values" : {
"_values": {
"hits" : {
"hits" : [
{
@@ -174,6 +174,7 @@
"buildId",
"benchmark",
"buildTimestamp",
"metrics.hasError",
"metrics.metricName",
"metrics.metricValue",
"metrics.metricError"
@@ -192,11 +193,12 @@
"fields": [
"_source.buildId",
"_source.buildTimestamp",
"metrics.hasError",
"metrics.metricName",
"metrics.metricValue",
"metrics.metricError"
],
"as": ["buildId", "buildTimestamp", "metricName", "metricValue", "metricError"]
"as": ["buildId", "buildTimestamp", "hasError", "metricName", "metricValue", "metricError"]
},
{
"type": "formula",
@@ -358,6 +360,38 @@
}
}
},
{
"type": "symbol",
"from": {"data": "series"},
"encode": {
"enter": {
"fill": {"value": "#B00"},
"size": [{ "test": "datum.hasError", "value": 250 }, {"value": 0}],
"shape": {"value": "cross"},
"angle": {"value": 45},
"x": {"scale": "x", "field": {"signal": "timestamp ? 'timestamp' : 'buildId'"}},
"y": {"scale": "y", "field": "metricValue"},
"strokeWidth": {"value": 1},
"opacity": [
{
"test": "(!domain || inrange(datum.buildId, domain)) && datum.hasError && (!length(data('selected')) || indata('selected', 'value', datum.metricName))",
"value": 1
},
{"value": 0.15}
]
},
"update": {
"opacity": [
{
"test": "(!domain || inrange(datum.buildId, domain)) && datum.hasError && (!length(data('selected')) || indata('selected', 'value', datum.metricName))",
"value": 1
},
{"value": 0.15}
]
}
},
"zindex": 1
},
{
"type": "symbol",
"from": {"data": "series"},