Align ide perf tests vega charts with json reports camelCase propNames

fix handling test errors
This commit is contained in:
Vladimir Dolzhenko
2020-10-14 21:29:44 +02:00
parent 98efdaa523
commit 051d914996
4 changed files with 143 additions and 143 deletions
@@ -5,7 +5,7 @@
{ {
"note": "May https://vega.github.io/vega/docs/ be with you", "note": "May https://vega.github.io/vega/docs/ be with you",
"$schema": "https://vega.github.io/schema/vega/v5.json", "$schema": "https://vega.github.io/schema/vega/v4.3.0.json",
"description": "TestData completion geomMean", "description": "TestData completion geomMean",
"title": "TestData completion geomMean", "title": "TestData completion geomMean",
"width": 800, "width": 800,
@@ -94,16 +94,16 @@
{ {
"name": "table", "name": "table",
"url": { "url": {
"comment": "source index pattern", //"comment": "source index pattern",
"index": "kotlin_ide_benchmarks*", "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'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": { "body": {
"size": 1000, "size": 1000,
"query": { "query": {
"bool": { "bool": {
"must": [ "must": [
{"range": {"build.timestamp": {"%timefilter%": true}}}, {"range": {"buildTimestamp": {"%timefilter%": true}}},
{ {
"bool": { "bool": {
"should": [ "should": [
@@ -126,49 +126,49 @@
] ]
} }
}, },
"_source": ["build_id", "benchmark", "build.timestamp", "geomMean"], "_source": ["buildId", "benchmark", "buildTimestamp", "geomMean"],
"sort": [{"build.timestamp": {"order": "asc"}}] "sort": [{"buildTimestamp": {"order": "asc"}}]
} }
}, },
"format": {"property": "hits.hits"}, "format": {"property": "hits.hits"},
"comment": "we need to have follow data: \"build_id\", \"metric_name\", \"metric_value\" and \"metric_error\"", "comment": "we need to have follow data: \"buildId\", \"metricName\", \"metricValue\" and \"metricError\"",
"comment": "so it has to be array of {\"build_id\": \"...\", \"metric_name\": \"...\", \"metric_value\": ..., \"metric_error\": ...}", "comment": "so it has to be array of {\"buildId\": \"...\", \"metricName\": \"...\", \"metricValue\": ..., \"metricError\": ...}",
"transform": [ "transform": [
{"type": "collect","sort": {"field": "_source.build\\.timestamp"}}, {"type": "collect","sort": {"field": "_source.buildTimestamp"}},
{ {
"comment": "make alias: _source.build_id -> build_id", "comment": "make alias: _source.buildId -> buildId",
"type": "formula", "type": "formula",
"as": "build_id", "as": "buildId",
"expr": "datum._source.build_id" "expr": "datum._source.buildId"
}, },
{ {
"comment": "make alias: _source.benchmark -> metric_name", "comment": "make alias: _source.benchmark -> metricName",
"type": "formula", "type": "formula",
"as": "metric_name", "as": "metricName",
"expr": "datum._source.benchmark" "expr": "datum._source.benchmark"
}, },
{ {
"comment": "make alias: _source.geomMean -> metric_value", "comment": "make alias: _source.geomMean -> metricValue",
"type": "formula", "type": "formula",
"as": "metric_value", "as": "metricValue",
"expr": "datum._source.geomMean" "expr": "datum._source.geomMean"
}, },
{ {
"comment": "define metric_error", "comment": "define metricError",
"type": "formula", "type": "formula",
"as": "metric_error", "as": "metricError",
"expr": "0" "expr": "1"
}, },
{ {
"type": "formula", "type": "formula",
"as": "timestamp", "as": "timestamp",
"expr": "timeFormat(toDate(datum._source['build.timestamp']), '%Y-%m-%d %H:%M')" "expr": "timeFormat(toDate(datum._source.buildTimestamp), '%Y-%m-%d %H:%M')"
}, },
{ {
"comment": "create `url` value that points to TC build", "comment": "create `url` value that points to TC build",
"type": "formula", "type": "formula",
"as": "url", "as": "url",
"expr": "'https://buildserver.labs.intellij.net/buildConfiguration/Kotlin_Benchmarks_PluginPerformanceTests_IdeaPluginPerformanceTests/' + datum._source.build_id" "expr": "'https://buildserver.labs.intellij.net/buildConfiguration/Kotlin_Benchmarks_PluginPerformanceTests_IdeaPluginPerformanceTests/' + datum._source.buildId"
} }
] ]
}, },
@@ -190,7 +190,7 @@
"orient": "bottom", "orient": "bottom",
"labelAngle": -20, "labelAngle": -20,
"labelAlign": "right", "labelAlign": "right",
"title": {"signal": "timestamp ? 'timestamp' : 'build_id'"}, "title": {"signal": "timestamp ? 'timestamp' : 'buildId'"},
"titlePadding": 10, "titlePadding": 10,
"tickCount": 5, "tickCount": 5,
"encode": { "encode": {
@@ -216,7 +216,7 @@
"name": "x", "name": "x",
"type": "point", "type": "point",
"range": "width", "range": "width",
"domain": {"data": "table", "field": {"signal": "timestamp ? 'timestamp' : 'build_id'"}} "domain": {"data": "table", "field": {"signal": "timestamp ? 'timestamp' : 'buildId'"}}
}, },
{ {
"name": "y", "name": "y",
@@ -224,13 +224,13 @@
"range": "height", "range": "height",
"nice": true, "nice": true,
"zero": true, "zero": true,
"domain": {"data": "table", "field": "metric_value"} "domain": {"data": "table", "field": "metricValue"}
}, },
{ {
"name": "color", "name": "color",
"type": "ordinal", "type": "ordinal",
"range": "category", "range": "category",
"domain": {"data": "table", "field": "metric_name"} "domain": {"data": "table", "field": "metricName"}
}, },
{ {
"name": "size", "name": "size",
@@ -238,8 +238,8 @@
"round": true, "round": true,
"nice": false, "nice": false,
"zero": true, "zero": true,
"domain": {"data": "table", "field": "metric_error"}, "domain": {"data": "table", "field": "metricError"},
"range": [1, 100] "range": [0, 100]
} }
], ],
"legends": [ "legends": [
@@ -289,7 +289,7 @@
{ {
"type": "group", "type": "group",
"from": { "from": {
"facet": {"name": "series", "data": "table", "groupby": "metric_name"} "facet": {"name": "series", "data": "table", "groupby": "metricName"}
}, },
"marks": [ "marks": [
{ {
@@ -298,21 +298,21 @@
"encode": { "encode": {
"hover": {"opacity": {"value": 1}, "strokeWidth": {"value": 4}}, "hover": {"opacity": {"value": 1}, "strokeWidth": {"value": 4}},
"update": { "update": {
"x": {"scale": "x", "field": {"signal": "timestamp ? 'timestamp' : 'build_id'"}}, "x": {"scale": "x", "field": {"signal": "timestamp ? 'timestamp' : 'buildId'"}},
"y": {"scale": "y", "field": "metric_value"}, "y": {"scale": "y", "field": "metricValue"},
"strokeWidth": {"value": 2}, "strokeWidth": {"value": 2},
"opacity": [ "opacity": [
{ {
"test": "(!domain || inrange(datum.build_id, domain)) && (!length(data('selected')) || indata('selected', 'value', datum.metric_name))", "test": "(!domain || inrange(datum.buildId, domain)) && (!length(data('selected')) || indata('selected', 'value', datum.metricName))",
"value": 0.7 "value": 0.7
}, },
{"value": 0.15} {"value": 0.15}
], ],
"stroke": [ "stroke": [
{ {
"test": "(!domain || inrange(datum.build_id, domain)) && (!length(data('selected')) || indata('selected', 'value', datum.metric_name))", "test": "(!domain || inrange(datum.buildId, domain)) && (!length(data('selected')) || indata('selected', 'value', datum.metricName))",
"scale": "color", "scale": "color",
"field": "metric_name" "field": "metricName"
}, },
{"value": "#ccc"} {"value": "#ccc"}
] ]
@@ -325,20 +325,20 @@
"encode": { "encode": {
"enter": { "enter": {
"tooltip": { "tooltip": {
"signal": "datum.metric_name + ': ' + datum.metric_value + ' ms'" "signal": "datum.metricName + ': ' + datum.metricValue + ' ms'"
}, },
"href": {"field": "url"}, "href": {"field": "url"},
"cursor": {"value": "pointer"}, "cursor": {"value": "pointer"},
"size": {"scale": "size", "field": "metric_error"}, "size": {"scale": "size", "field": "metricError"},
"x": {"scale": "x", "field": {"signal": "timestamp ? 'timestamp' : 'build_id'"}}, "x": {"scale": "x", "field": {"signal": "timestamp ? 'timestamp' : 'buildId'"}},
"y": {"scale": "y", "field": "metric_value"}, "y": {"scale": "y", "field": "metricValue"},
"strokeWidth": {"value": 1}, "strokeWidth": {"value": 1},
"fill": {"scale": "color", "field": "metric_name"} "fill": {"scale": "color", "field": "metricName"}
}, },
"update": { "update": {
"opacity": [ "opacity": [
{ {
"test": "(!domain || inrange(datum.build_id, domain)) && (!length(data('selected')) || indata('selected', 'value', datum.metric_name))", "test": "(!domain || inrange(datum.buildId, domain)) && (!length(data('selected')) || indata('selected', 'value', datum.metricName))",
"value": 1 "value": 1
}, },
{"value": 0.15} {"value": 0.15}
@@ -5,7 +5,7 @@
{ {
"note": "May https://vega.github.io/vega/docs/ be with you", "note": "May https://vega.github.io/vega/docs/ be with you",
"$schema": "https://vega.github.io/schema/vega/v5.json", "$schema": "https://vega.github.io/schema/vega/v4.3.0.json",
"description": "TestData geomMean", "description": "TestData geomMean",
"title": "TestData geomMean", "title": "TestData geomMean",
"width": 800, "width": 800,
@@ -98,81 +98,81 @@
"hits" : { "hits" : {
"hits" : [ "hits" : [
{ {
"_source" : {"build_id" : 87834896, "build.timestamp" : "2020-09-21T21:00:31+0000", "geomMean" : 37, "benchmark" : "highlight"} "_source" : {"buildId" : 87834896, "buildTimestamp" : "2020-09-21T21:00:31+0000", "geomMean" : 37, "benchmark" : "highlight"}
}, },
{ {
"_source" : {"build_id" : 87783396, "build.timestamp" : "2020-09-21T12:34:19+0000", "geomMean" : 37, "benchmark" : "highlight"} "_source" : {"buildId" : 87783396, "buildTimestamp" : "2020-09-21T12:34:19+0000", "geomMean" : 37, "benchmark" : "highlight"}
}, },
{ {
"_source" : {"build_id" : 87809918, "build.timestamp" : "2020-09-21T16:47:11+0000", "geomMean" : 37, "benchmark" : "highlight"} "_source" : {"buildId" : 87809918, "buildTimestamp" : "2020-09-21T16:47:11+0000", "geomMean" : 37, "benchmark" : "highlight"}
}, },
{ {
"_source" : {"build_id" : 87905203, "build.timestamp" : "2020-09-22T13:23:44+0000", "geomMean" : 37, "benchmark" : "highlight"} "_source" : {"buildId" : 87905203, "buildTimestamp" : "2020-09-22T13:23:44+0000", "geomMean" : 37, "benchmark" : "highlight"}
}, },
{ {
"_source" : {"build_id" : 87894638, "build.timestamp" : "2020-09-22T09:12:16+0000", "geomMean" : 37, "benchmark" : "highlight"} "_source" : {"buildId" : 87894638, "buildTimestamp" : "2020-09-22T09:12:16+0000", "geomMean" : 37, "benchmark" : "highlight"}
} }
] ]
} }
}, },
"url": { "url": {
"comment": "source index pattern", //"comment": "source index pattern",
"index": "kotlin_ide_benchmarks*", "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'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": { "body": {
"size": 1000, "size": 1000,
"query": { "query": {
"bool": { "bool": {
"must": [ "must": [
{"term": {"benchmark.keyword": "highlight"}}, {"term": {"benchmark.keyword": "highlight"}},
{"range": {"build.timestamp": {"%timefilter%": true}}} {"range": {"buildTimestamp": {"%timefilter%": true}}}
] ]
} }
}, },
"_source": ["build_id", "benchmark", "build.timestamp", "geomMean"], "_source": ["buildId", "benchmark", "buildTimestamp", "geomMean"],
"sort": [{"build.timestamp": {"order": "asc"}}] "sort": [{"buildTimestamp": {"order": "asc"}}]
} }
}, },
"format": {"property": "hits.hits"}, "format": {"property": "hits.hits"},
"comment": "we need to have follow data: \"build_id\", \"metric_name\", \"metric_value\" and \"metric_error\"", "comment": "we need to have follow data: \"buildId\", \"metricName\", \"metricValue\" and \"metricError\"",
"comment": "so it has to be array of {\"build_id\": \"...\", \"metric_name\": \"...\", \"metric_value\": ..., \"metric_error\": ...}", "comment": "so it has to be array of {\"buildId\": \"...\", \"metricName\": \"...\", \"metricValue\": ..., \"metricError\": ...}",
"transform": [ "transform": [
{"type": "collect","sort": {"field": "_source.build\\.timestamp"}}, {"type": "collect","sort": {"field": "_source.buildTimestamp"}},
{ {
"comment": "make alias: _source.build_id -> build_id", "comment": "make alias: _source.buildId -> buildId",
"type": "formula", "type": "formula",
"as": "build_id", "as": "buildId",
"expr": "datum._source.build_id" "expr": "datum._source.buildId"
}, },
{ {
"comment": "make alias: _source.benchmark -> metric_name", "comment": "make alias: _source.benchmark -> metricName",
"type": "formula", "type": "formula",
"as": "metric_name", "as": "metricName",
"expr": "datum._source.benchmark" "expr": "datum._source.benchmark"
}, },
{ {
"comment": "make alias: _source.geomMean -> metric_value", "comment": "make alias: _source.geomMean -> metricValue",
"type": "formula", "type": "formula",
"as": "metric_value", "as": "metricValue",
"expr": "datum._source.geomMean" "expr": "datum._source.geomMean"
}, },
{ {
"comment": "define metric_error", "comment": "define metricError",
"type": "formula", "type": "formula",
"as": "metric_error", "as": "metricError",
"expr": "0" "expr": "0"
}, },
{ {
"type": "formula", "type": "formula",
"as": "timestamp", "as": "timestamp",
"expr": "timeFormat(toDate(datum._source['build.timestamp']), '%Y-%m-%d %H:%M')" "expr": "timeFormat(toDate(datum._source.buildTimestamp), '%Y-%m-%d %H:%M')"
}, },
{ {
"comment": "create `url` value that points to TC build", "comment": "create `url` value that points to TC build",
"type": "formula", "type": "formula",
"as": "url", "as": "url",
"expr": "'https://buildserver.labs.intellij.net/buildConfiguration/Kotlin_Benchmarks_PluginPerformanceTests_IdeaPluginPerformanceTests/' + datum._source.build_id" "expr": "'https://buildserver.labs.intellij.net/buildConfiguration/Kotlin_Benchmarks_PluginPerformanceTests_IdeaPluginPerformanceTests/' + datum._source.buildId"
} }
] ]
}, },
@@ -194,7 +194,7 @@
"orient": "bottom", "orient": "bottom",
"labelAngle": -20, "labelAngle": -20,
"labelAlign": "right", "labelAlign": "right",
"title": {"signal": "timestamp ? 'timestamp' : 'build_id'"}, "title": {"signal": "timestamp ? 'timestamp' : 'buildId'"},
"titlePadding": 10, "titlePadding": 10,
"tickCount": 5, "tickCount": 5,
"encode": { "encode": {
@@ -220,7 +220,7 @@
"name": "x", "name": "x",
"type": "point", "type": "point",
"range": "width", "range": "width",
"domain": {"data": "table", "field": {"signal": "timestamp ? 'timestamp' : 'build_id'"}} "domain": {"data": "table", "field": {"signal": "timestamp ? 'timestamp' : 'buildId'"}}
}, },
{ {
"name": "y", "name": "y",
@@ -228,13 +228,13 @@
"range": "height", "range": "height",
"nice": true, "nice": true,
"zero": true, "zero": true,
"domain": {"data": "table", "field": "metric_value"} "domain": {"data": "table", "field": "metricValue"}
}, },
{ {
"name": "color", "name": "color",
"type": "ordinal", "type": "ordinal",
"range": "category", "range": "category",
"domain": {"data": "table", "field": "metric_name"} "domain": {"data": "table", "field": "metricName"}
}, },
{ {
"name": "size", "name": "size",
@@ -242,7 +242,7 @@
"round": true, "round": true,
"nice": false, "nice": false,
"zero": true, "zero": true,
"domain": {"data": "table", "field": "metric_error"}, "domain": {"data": "table", "field": "metricError"},
"range": [1, 100] "range": [1, 100]
} }
], ],
@@ -293,7 +293,7 @@
{ {
"type": "group", "type": "group",
"from": { "from": {
"facet": {"name": "series", "data": "table", "groupby": "metric_name"} "facet": {"name": "series", "data": "table", "groupby": "metricName"}
}, },
"marks": [ "marks": [
{ {
@@ -302,21 +302,21 @@
"encode": { "encode": {
"hover": {"opacity": {"value": 1}, "strokeWidth": {"value": 4}}, "hover": {"opacity": {"value": 1}, "strokeWidth": {"value": 4}},
"update": { "update": {
"x": {"scale": "x", "field": {"signal": "timestamp ? 'timestamp' : 'build_id'"}}, "x": {"scale": "x", "field": {"signal": "timestamp ? 'timestamp' : 'buildId'"}},
"y": {"scale": "y", "field": "metric_value"}, "y": {"scale": "y", "field": "metricValue"},
"strokeWidth": {"value": 2}, "strokeWidth": {"value": 2},
"opacity": [ "opacity": [
{ {
"test": "(!domain || inrange(datum.build_id, domain)) && (!length(data('selected')) || indata('selected', 'value', datum.metric_name))", "test": "(!domain || inrange(datum.buildId, domain)) && (!length(data('selected')) || indata('selected', 'value', datum.metricName))",
"value": 0.7 "value": 0.7
}, },
{"value": 0.15} {"value": 0.15}
], ],
"stroke": [ "stroke": [
{ {
"test": "(!domain || inrange(datum.build_id, domain)) && (!length(data('selected')) || indata('selected', 'value', datum.metric_name))", "test": "(!domain || inrange(datum.buildId, domain)) && (!length(data('selected')) || indata('selected', 'value', datum.metricName))",
"scale": "color", "scale": "color",
"field": "metric_name" "field": "metricName"
}, },
{"value": "#ccc"} {"value": "#ccc"}
] ]
@@ -329,20 +329,20 @@
"encode": { "encode": {
"enter": { "enter": {
"tooltip": { "tooltip": {
"signal": "datum.metric_name + ': ' + datum.metric_value + ' ms'" "signal": "datum.metricName + ': ' + datum.metricValue + ' ms'"
}, },
"href": {"field": "url"}, "href": {"field": "url"},
"cursor": {"value": "pointer"}, "cursor": {"value": "pointer"},
"size": {"scale": "size", "field": "metric_error"}, "size": {"scale": "size", "field": "metricError"},
"x": {"scale": "x", "field": {"signal": "timestamp ? 'timestamp' : 'build_id'"}}, "x": {"scale": "x", "field": {"signal": "timestamp ? 'timestamp' : 'buildId'"}},
"y": {"scale": "y", "field": "metric_value"}, "y": {"scale": "y", "field": "metricValue"},
"strokeWidth": {"value": 1}, "strokeWidth": {"value": 1},
"fill": {"scale": "color", "field": "metric_name"} "fill": {"scale": "color", "field": "metricName"}
}, },
"update": { "update": {
"opacity": [ "opacity": [
{ {
"test": "(!domain || inrange(datum.build_id, domain)) && (!length(data('selected')) || indata('selected', 'value', datum.metric_name))", "test": "(!domain || inrange(datum.buildId, domain)) && (!length(data('selected')) || indata('selected', 'value', datum.metricName))",
"value": 1 "value": 1
}, },
{"value": 0.15} {"value": 0.15}
@@ -5,7 +5,7 @@
{ {
"note": "May https://vega.github.io/vega/docs/ be with you", "note": "May https://vega.github.io/vega/docs/ be with you",
"$schema": "https://vega.github.io/schema/vega/v5.json", "$schema": "https://vega.github.io/schema/vega/v4.3.0.json",
"description": "TestData highlight", "description": "TestData highlight",
"title": "TestData highlight", "title": "TestData highlight",
"width": 800, "width": 800,
@@ -99,55 +99,55 @@
"hits" : [ "hits" : [
{ {
"_source" : { "_source" : {
"build_id" : 87834896, "buildId" : 87834896,
"build.timestamp" : "2020-09-21T21:00:31+0000", "buildTimestamp" : "2020-09-21T21:00:31+0000",
"metrics" : [ "metrics" : [
{"metric_name" : "NonNullAssertion", "metric_value" : 31, "metric_error" : 1 }, {"metricName" : "NonNullAssertion", "metricValue" : 31, "metricError" : 1 },
{"metric_name" : "PropertiesWithPropertyDeclarations", "metric_value" : 191, "metric_error" : 4 } {"metricName" : "PropertiesWithPropertyDeclarations", "metricValue" : 191, "metricError" : 4 }
], ],
"benchmark" : "highlight" "benchmark" : "highlight"
} }
}, },
{ {
"_source" : { "_source" : {
"build_id" : 87783396, "buildId" : 87783396,
"build.timestamp" : "2020-09-21T12:34:19+0000", "buildTimestamp" : "2020-09-21T12:34:19+0000",
"metrics" : [ "metrics" : [
{"metric_name" : "NonNullAssertion", "metric_value" : 32, "metric_error" : 1 }, {"metricName" : "NonNullAssertion", "metricValue" : 32, "metricError" : 1 },
{"metric_name" : "PropertiesWithPropertyDeclarations", "metric_value" : 189, "metric_error" : 4 } {"metricName" : "PropertiesWithPropertyDeclarations", "metricValue" : 189, "metricError" : 4 }
], ],
"benchmark" : "highlight" "benchmark" : "highlight"
} }
}, },
{ {
"_source" : { "_source" : {
"build_id" : 87809918, "buildId" : 87809918,
"build.timestamp" : "2020-09-21T16:47:11+0000", "buildTimestamp" : "2020-09-21T16:47:11+0000",
"metrics" : [ "metrics" : [
{"metric_name" : "NonNullAssertion", "metric_value" : 30, "metric_error" : 1 }, {"metricName" : "NonNullAssertion", "metricValue" : 30, "metricError" : 1 },
{"metric_name" : "PropertiesWithPropertyDeclarations", "metric_value" : 188, "metric_error" : 4 } {"metricName" : "PropertiesWithPropertyDeclarations", "metricValue" : 188, "metricError" : 4 }
], ],
"benchmark" : "highlight" "benchmark" : "highlight"
} }
}, },
{ {
"_source" : { "_source" : {
"build_id" : 87905203, "buildId" : 87905203,
"build.timestamp" : "2020-09-22T13:23:44+0000", "buildTimestamp" : "2020-09-22T13:23:44+0000",
"metrics" : [ "metrics" : [
{"metric_name" : "NonNullAssertion", "metric_value" : 30, "metric_error" : 1 }, {"metricName" : "NonNullAssertion", "metricValue" : 30, "metricError" : 1 },
{"metric_name" : "PropertiesWithPropertyDeclarations", "metric_value" : 180, "metric_error" : 4 } {"metricName" : "PropertiesWithPropertyDeclarations", "metricValue" : 180, "metricError" : 4 }
], ],
"benchmark" : "highlight" "benchmark" : "highlight"
} }
}, },
{ {
"_source" : { "_source" : {
"build_id" : 87894638, "buildId" : 87894638,
"build.timestamp" : "2020-09-22T09:12:16+0000", "buildTimestamp" : "2020-09-22T09:12:16+0000",
"metrics" : [ "metrics" : [
{"metric_name" : "NonNullAssertion", "metric_value" : 32, "metric_error" : 1 }, {"metricName" : "NonNullAssertion", "metricValue" : 32, "metricError" : 1 },
{"metric_name" : "PropertiesWithPropertyDeclarations", "metric_value" : 193, "metric_error" : 4 } {"metricName" : "PropertiesWithPropertyDeclarations", "metricValue" : 193, "metricError" : 4 }
], ],
"benchmark" : "highlight" "benchmark" : "highlight"
} }
@@ -156,58 +156,58 @@
} }
}, },
"url": { "url": {
"comment": "source index pattern", //"comment": "source index pattern",
"index": "kotlin_ide_benchmarks*", "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'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": { "body": {
"size": 1000, "size": 1000,
"query": { "query": {
"bool": { "bool": {
"must": [ "must": [
{"term": {"benchmark.keyword": "highlight"}}, {"term": {"benchmark.keyword": "highlight"}},
{"range": {"build.timestamp": {"%timefilter%": true}}} {"range": {"buildTimestamp": {"%timefilter%": true}}}
] ]
} }
}, },
"_source": [ "_source": [
"build_id", "buildId",
"benchmark", "benchmark",
"build.timestamp", "buildTimestamp",
"metrics.metric_name", "metrics.metricName",
"metrics.metric_value", "metrics.metricValue",
"metrics.metric_error" "metrics.metricError"
], ],
"sort": [{"build.timestamp": {"order": "asc"}}] "sort": [{"buildTimestamp": {"order": "asc"}}]
} }
}, },
"format": {"property": "hits.hits"}, "format": {"property": "hits.hits"},
"comment": "we need to have follow data: \"build_id\", \"metric_name\", \"metric_value\" and \"metric_error\"", "comment": "we need to have follow data: \"buildId\", \"metricName\", \"metricValue\" and \"metricError\"",
"comment": "so it has to be array of {\"build_id\": \"...\", \"metric_name\": \"...\", \"metric_value\": ..., \"metric_error\": ...}", "comment": "so it has to be array of {\"buildId\": \"...\", \"metricName\": \"...\", \"metricValue\": ..., \"metricError\": ...}",
"transform": [ "transform": [
{"type": "collect","sort": {"field": "_source.build\\.timestamp"}}, {"type": "collect","sort": {"field": "_source.buildTimestamp"}},
{"type": "flatten", "fields": ["_source.metrics"], "as": ["metrics"]}, {"type": "flatten", "fields": ["_source.metrics"], "as": ["metrics"]},
{ {
"type": "project", "type": "project",
"fields": [ "fields": [
"_source.build_id", "_source.buildId",
"_source.build\\.timestamp", "_source.buildTimestamp",
"metrics.metric_name", "metrics.metricName",
"metrics.metric_value", "metrics.metricValue",
"metrics.metric_error" "metrics.metricError"
], ],
"as": ["build_id", "build_timestamp", "metric_name", "metric_value", "metric_error"] "as": ["buildId", "buildTimestamp", "metricName", "metricValue", "metricError"]
}, },
{ {
"type": "formula", "type": "formula",
"as": "timestamp", "as": "timestamp",
"expr": "timeFormat(toDate(datum.build_timestamp), '%Y-%m-%d %H:%M')" "expr": "timeFormat(toDate(datum.buildTimestamp), '%Y-%m-%d %H:%M')"
}, },
{ {
"comment": "create `url` value that points to TC build", "comment": "create `url` value that points to TC build",
"type": "formula", "type": "formula",
"as": "url", "as": "url",
"expr": "'https://buildserver.labs.intellij.net/buildConfiguration/Kotlin_Benchmarks_PluginPerformanceTests_IdeaPluginPerformanceTests/' + datum.build_id" "expr": "'https://buildserver.labs.intellij.net/buildConfiguration/Kotlin_Benchmarks_PluginPerformanceTests_IdeaPluginPerformanceTests/' + datum.buildId"
} }
] ]
}, },
@@ -229,7 +229,7 @@
"orient": "bottom", "orient": "bottom",
"labelAngle": -20, "labelAngle": -20,
"labelAlign": "right", "labelAlign": "right",
"title": {"signal": "timestamp ? 'timestamp' : 'build_id'"}, "title": {"signal": "timestamp ? 'timestamp' : 'buildId'"},
"titlePadding": 10, "titlePadding": 10,
"tickCount": 5, "tickCount": 5,
"encode": { "encode": {
@@ -255,7 +255,7 @@
"name": "x", "name": "x",
"type": "point", "type": "point",
"range": "width", "range": "width",
"domain": {"data": "table", "field": {"signal": "timestamp ? 'timestamp' : 'build_id'"}} "domain": {"data": "table", "field": {"signal": "timestamp ? 'timestamp' : 'buildId'"}}
}, },
{ {
"name": "y", "name": "y",
@@ -263,13 +263,13 @@
"range": "height", "range": "height",
"nice": true, "nice": true,
"zero": true, "zero": true,
"domain": {"data": "table", "field": "metric_value"} "domain": {"data": "table", "field": "metricValue"}
}, },
{ {
"name": "color", "name": "color",
"type": "ordinal", "type": "ordinal",
"range": "category", "range": "category",
"domain": {"data": "table", "field": "metric_name"} "domain": {"data": "table", "field": "metricName"}
}, },
{ {
"name": "size", "name": "size",
@@ -277,7 +277,7 @@
"round": true, "round": true,
"nice": false, "nice": false,
"zero": true, "zero": true,
"domain": {"data": "table", "field": "metric_error"}, "domain": {"data": "table", "field": "metricError"},
"range": [1, 100] "range": [1, 100]
} }
], ],
@@ -328,7 +328,7 @@
{ {
"type": "group", "type": "group",
"from": { "from": {
"facet": {"name": "series", "data": "table", "groupby": "metric_name"} "facet": {"name": "series", "data": "table", "groupby": "metricName"}
}, },
"marks": [ "marks": [
{ {
@@ -337,21 +337,21 @@
"encode": { "encode": {
"hover": {"opacity": {"value": 1}, "strokeWidth": {"value": 4}}, "hover": {"opacity": {"value": 1}, "strokeWidth": {"value": 4}},
"update": { "update": {
"x": {"scale": "x", "field": {"signal": "timestamp ? 'timestamp' : 'build_id'"}}, "x": {"scale": "x", "field": {"signal": "timestamp ? 'timestamp' : 'buildId'"}},
"y": {"scale": "y", "field": "metric_value"}, "y": {"scale": "y", "field": "metricValue"},
"strokeWidth": {"value": 2}, "strokeWidth": {"value": 2},
"opacity": [ "opacity": [
{ {
"test": "(!domain || inrange(datum.build_id, domain)) && (!length(data('selected')) || indata('selected', 'value', datum.metric_name))", "test": "(!domain || inrange(datum.buildId, domain)) && (!length(data('selected')) || indata('selected', 'value', datum.metricName))",
"value": 0.7 "value": 0.7
}, },
{"value": 0.15} {"value": 0.15}
], ],
"stroke": [ "stroke": [
{ {
"test": "(!domain || inrange(datum.build_id, domain)) && (!length(data('selected')) || indata('selected', 'value', datum.metric_name))", "test": "(!domain || inrange(datum.buildId, domain)) && (!length(data('selected')) || indata('selected', 'value', datum.metricName))",
"scale": "color", "scale": "color",
"field": "metric_name" "field": "metricName"
}, },
{"value": "#ccc"} {"value": "#ccc"}
] ]
@@ -364,20 +364,20 @@
"encode": { "encode": {
"enter": { "enter": {
"tooltip": { "tooltip": {
"signal": "datum.metric_name + ': ' + datum.metric_value + ' ms'" "signal": "datum.metricName + ': ' + datum.metricValue + ' ms'"
}, },
"href": {"field": "url"}, "href": {"field": "url"},
"cursor": {"value": "pointer"}, "cursor": {"value": "pointer"},
"size": {"scale": "size", "field": "metric_error"}, "size": {"scale": "size", "field": "metricError"},
"x": {"scale": "x", "field": {"signal": "timestamp ? 'timestamp' : 'build_id'"}}, "x": {"scale": "x", "field": {"signal": "timestamp ? 'timestamp' : 'buildId'"}},
"y": {"scale": "y", "field": "metric_value"}, "y": {"scale": "y", "field": "metricValue"},
"strokeWidth": {"value": 1}, "strokeWidth": {"value": 1},
"fill": {"scale": "color", "field": "metric_name"} "fill": {"scale": "color", "field": "metricName"}
}, },
"update": { "update": {
"opacity": [ "opacity": [
{ {
"test": "(!domain || inrange(datum.build_id, domain)) && (!length(data('selected')) || indata('selected', 'value', datum.metric_name))", "test": "(!domain || inrange(datum.buildId, domain)) && (!length(data('selected')) || indata('selected', 'value', datum.metricName))",
"value": 1 "value": 1
}, },
{"value": 0.15} {"value": 0.15}
@@ -168,7 +168,7 @@ class Stats(
metricChildren = metricChildren metricChildren = metricChildren
) )
} }
} catch (e: Exception) { } catch (e: Throwable) {
processTimings(testName, emptyArray(), metricChildren) processTimings(testName, emptyArray(), metricChildren)
} }
} }