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": [ "data": [
{ {
"name": "table", "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": { "url": {
//"comment": "source index pattern", //"comment": "source index pattern",
"index": "kotlin_ide_benchmarks*", "index": "kotlin_ide_benchmarks*",
@@ -126,7 +195,7 @@
] ]
} }
}, },
"_source": ["buildId", "benchmark", "buildTimestamp", "geomMean"], "_source": ["buildId", "benchmark", "buildTimestamp", "metrics.hasError", "geomMean"],
"sort": [{"buildTimestamp": {"order": "asc"}}] "sort": [{"buildTimestamp": {"order": "asc"}}]
} }
}, },
@@ -159,6 +228,12 @@
"as": "metricError", "as": "metricError",
"expr": "1" "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", "type": "formula",
"as": "timestamp", "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", "type": "symbol",
"from": {"data": "series"}, "from": {"data": "series"},
@@ -94,7 +94,7 @@
{ {
"name": "table", "name": "table",
"comment": "To test chart in VEGA editor https://vega.github.io/editor/#/ change `_values` to `values` and rename `url` property", "comment": "To test chart in VEGA editor https://vega.github.io/editor/#/ change `_values` to `values` and rename `url` property",
"_values" : { "_values": {
"hits" : { "hits" : {
"hits" : [ "hits" : [
{ {
@@ -130,7 +130,7 @@
] ]
} }
}, },
"_source": ["buildId", "benchmark", "buildTimestamp", "geomMean"], "_source": ["buildId", "benchmark", "buildTimestamp", "metrics.hasError", "geomMean"],
"sort": [{"buildTimestamp": {"order": "asc"}}] "sort": [{"buildTimestamp": {"order": "asc"}}]
} }
}, },
@@ -161,7 +161,13 @@
"comment": "define metricError", "comment": "define metricError",
"type": "formula", "type": "formula",
"as": "metricError", "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", "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", "type": "symbol",
"from": {"data": "series"}, "from": {"data": "series"},
@@ -94,7 +94,7 @@
{ {
"name": "table", "name": "table",
"comment": "To test chart in VEGA editor https://vega.github.io/editor/#/ change `_values` to `values` and rename `url` property", "comment": "To test chart in VEGA editor https://vega.github.io/editor/#/ change `_values` to `values` and rename `url` property",
"_values" : { "_values": {
"hits" : { "hits" : {
"hits" : [ "hits" : [
{ {
@@ -174,6 +174,7 @@
"buildId", "buildId",
"benchmark", "benchmark",
"buildTimestamp", "buildTimestamp",
"metrics.hasError",
"metrics.metricName", "metrics.metricName",
"metrics.metricValue", "metrics.metricValue",
"metrics.metricError" "metrics.metricError"
@@ -192,11 +193,12 @@
"fields": [ "fields": [
"_source.buildId", "_source.buildId",
"_source.buildTimestamp", "_source.buildTimestamp",
"metrics.hasError",
"metrics.metricName", "metrics.metricName",
"metrics.metricValue", "metrics.metricValue",
"metrics.metricError" "metrics.metricError"
], ],
"as": ["buildId", "buildTimestamp", "metricName", "metricValue", "metricError"] "as": ["buildId", "buildTimestamp", "hasError", "metricName", "metricValue", "metricError"]
}, },
{ {
"type": "formula", "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", "type": "symbol",
"from": {"data": "series"}, "from": {"data": "series"},