"rawSql":"SELECT \n b.id, \n b.url, \n b.created_at * 1000 as created,\n b.finished_at * 1000 as finished,\n (SELECT COUNT(id) FROM build_tasks AS bt WHERE bt.build_id = b.id) AS task_count,\n b.finished_at - b.created_at as duration\nFROM builds as b \nWHERE id = $build_id ",
"rawSql":"SELECT COUNT(id) AS idle FROM build_tasks \nWHERE build_id = $build_id AND status_id = 0;",
"refId":"idle",
"sql":{
"columns":[
{
"parameters":[],
"type":"function"
}
],
"groupBy":[
{
"property":{
"type":"string"
},
"type":"groupBy"
}
],
"limit":50
}
},
{
"datasource":{
"type":"postgres",
"uid":"${DS_POSTGRESQL}"
},
"editorMode":"code",
"format":"table",
"hide":false,
"rawQuery":true,
"rawSql":"SELECT COUNT(id) AS started FROM build_tasks \nWHERE build_id = $build_id AND status_id = 1;",
"refId":"started",
"sql":{
"columns":[
{
"parameters":[],
"type":"function"
}
],
"groupBy":[
{
"property":{
"type":"string"
},
"type":"groupBy"
}
],
"limit":50
}
},
{
"datasource":{
"type":"postgres",
"uid":"${DS_POSTGRESQL}"
},
"editorMode":"code",
"format":"table",
"hide":false,
"rawQuery":true,
"rawSql":"SELECT COUNT(id) AS completed FROM build_tasks \nWHERE build_id = $build_id AND status_id = 2;",
"refId":"completed",
"sql":{
"columns":[
{
"parameters":[],
"type":"function"
}
],
"groupBy":[
{
"property":{
"type":"string"
},
"type":"groupBy"
}
],
"limit":50
}
},
{
"datasource":{
"type":"postgres",
"uid":"${DS_POSTGRESQL}"
},
"editorMode":"code",
"format":"table",
"hide":false,
"rawQuery":true,
"rawSql":"SELECT COUNT(id) AS failed FROM build_tasks \nWHERE build_id = $build_id AND status_id = 3;",
"refId":"failed",
"sql":{
"columns":[
{
"parameters":[],
"type":"function"
}
],
"groupBy":[
{
"property":{
"type":"string"
},
"type":"groupBy"
}
],
"limit":50
}
},
{
"datasource":{
"type":"postgres",
"uid":"${DS_POSTGRESQL}"
},
"editorMode":"code",
"format":"table",
"hide":false,
"rawQuery":true,
"rawSql":"SELECT COUNT(id) AS excluded FROM build_tasks \nWHERE build_id = $build_id AND status_id = 4;",
"refId":"excluded",
"sql":{
"columns":[
{
"parameters":[],
"type":"function"
}
],
"groupBy":[
{
"property":{
"type":"string"
},
"type":"groupBy"
}
],
"limit":50
}
}
],
"title":"Build tasks by status",
"type":"piechart"
},
{
"datasource":{
"type":"postgres",
"uid":"${DS_POSTGRESQL}"
},
"description":"",
"fieldConfig":{
"defaults":{
"color":{
"fixedColor":"blue",
"mode":"fixed"
},
"custom":{
"hideFrom":{
"legend":false,
"tooltip":false,
"viz":false
}
},
"mappings":[]
},
"overrides":[
{
"matcher":{
"id":"byName",
"options":"running"
},
"properties":[
{
"id":"color",
"value":{
"fixedColor":"semi-dark-blue",
"mode":"fixed"
}
}
]
},
{
"matcher":{
"id":"byName",
"options":"completed"
},
"properties":[
{
"id":"color",
"value":{
"fixedColor":"green",
"mode":"fixed"
}
}
]
},
{
"matcher":{
"id":"byName",
"options":"idle"
},
"properties":[
{
"id":"color",
"value":{
"fixedColor":"purple",
"mode":"fixed"
}
}
]
},
{
"matcher":{
"id":"byName",
"options":"failed"
},
"properties":[
{
"id":"color",
"value":{
"fixedColor":"red",
"mode":"fixed"
}
}
]
},
{
"matcher":{
"id":"byName",
"options":"excluded"
},
"properties":[
{
"id":"color",
"value":{
"fixedColor":"text",
"mode":"fixed"
}
}
]
},
{
"matcher":{
"id":"byName",
"options":"x86_64"
},
"properties":[
{
"id":"color",
"value":{
"fixedColor":"purple",
"mode":"fixed"
}
}
]
},
{
"matcher":{
"id":"byName",
"options":"i686"
},
"properties":[
{
"id":"color",
"value":{
"fixedColor":"dark-orange",
"mode":"fixed"
}
}
]
},
{
"matcher":{
"id":"byName",
"options":"aarch64"
},
"properties":[
{
"id":"color",
"value":{
"fixedColor":"yellow",
"mode":"fixed"
}
}
]
},
{
"matcher":{
"id":"byName",
"options":"ppc64le"
},
"properties":[
{
"id":"color",
"value":{
"fixedColor":"green",
"mode":"fixed"
}
}
]
}
]
},
"gridPos":{
"h":8,
"w":7,
"x":7,
"y":4
},
"id":6,
"options":{
"legend":{
"displayMode":"table",
"placement":"right",
"showLegend":true,
"values":[
"value"
]
},
"pieType":"donut",
"reduceOptions":{
"calcs":[
"lastNotNull"
],
"fields":"",
"values":false
},
"tooltip":{
"mode":"single",
"sort":"none"
}
},
"pluginVersion":"9.3.2",
"targets":[
{
"datasource":{
"type":"postgres",
"uid":"${DS_POSTGRESQL}"
},
"editorMode":"code",
"format":"table",
"hide":false,
"rawQuery":true,
"rawSql":"SELECT COUNT(id) AS i686 FROM build_tasks \nWHERE build_id = $build_id AND arch_id = 0;",
"refId":"i686",
"sql":{
"columns":[
{
"parameters":[],
"type":"function"
}
],
"groupBy":[
{
"property":{
"type":"string"
},
"type":"groupBy"
}
],
"limit":50
}
},
{
"datasource":{
"type":"postgres",
"uid":"${DS_POSTGRESQL}"
},
"editorMode":"code",
"format":"table",
"hide":false,
"rawQuery":true,
"rawSql":"SELECT COUNT(id) AS x86_64 FROM build_tasks \nWHERE build_id = $build_id AND arch_id = 1;",
"refId":"x86_64",
"sql":{
"columns":[
{
"parameters":[],
"type":"function"
}
],
"groupBy":[
{
"property":{
"type":"string"
},
"type":"groupBy"
}
],
"limit":50
}
},
{
"datasource":{
"type":"postgres",
"uid":"${DS_POSTGRESQL}"
},
"editorMode":"code",
"format":"table",
"hide":false,
"rawQuery":true,
"rawSql":"SELECT COUNT(id) AS aarch64 FROM build_tasks \nWHERE build_id = $build_id AND arch_id = 2;",
"refId":"aarch64",
"sql":{
"columns":[
{
"parameters":[],
"type":"function"
}
],
"groupBy":[
{
"property":{
"type":"string"
},
"type":"groupBy"
}
],
"limit":50
}
},
{
"datasource":{
"type":"postgres",
"uid":"${DS_POSTGRESQL}"
},
"editorMode":"code",
"format":"table",
"hide":false,
"rawQuery":true,
"rawSql":"SELECT COUNT(id) AS ppc64le FROM build_tasks \nWHERE build_id = $build_id AND arch_id = 3;",
"refId":"ppc64le",
"sql":{
"columns":[
{
"parameters":[],
"type":"function"
}
],
"groupBy":[
{
"property":{
"type":"string"
},
"type":"groupBy"
}
],
"limit":50
}
},
{
"datasource":{
"type":"postgres",
"uid":"${DS_POSTGRESQL}"
},
"editorMode":"code",
"format":"table",
"hide":false,
"rawQuery":true,
"rawSql":"SELECT COUNT(id) AS s390x FROM build_tasks \nWHERE build_id = $build_id AND arch_id = 4;",
"refId":"s390x",
"sql":{
"columns":[
{
"parameters":[],
"type":"function"
}
],
"groupBy":[
{
"property":{
"type":"string"
},
"type":"groupBy"
}
],
"limit":50
}
}
],
"title":"Build tasks by arch",
"type":"piechart"
},
{
"datasource":{
"type":"postgres",
"uid":"${DS_POSTGRESQL}"
},
"description":"Averages for build tasks with \"completed\"\nstatus",
"fieldConfig":{
"defaults":{
"color":{
"fixedColor":"blue",
"mode":"fixed"
},
"mappings":[],
"thresholds":{
"mode":"absolute",
"steps":[
{
"color":"green",
"value":null
}
]
},
"unit":"s"
},
"overrides":[]
},
"gridPos":{
"h":4,
"w":10,
"x":14,
"y":4
},
"id":12,
"options":{
"colorMode":"value",
"graphMode":"area",
"justifyMode":"auto",
"orientation":"auto",
"reduceOptions":{
"calcs":[
"lastNotNull"
],
"fields":"",
"values":false
},
"textMode":"auto"
},
"pluginVersion":"9.3.2",
"targets":[
{
"cacheDurationSeconds":300,
"datasource":{
"type":"postgres",
"uid":"${DS_POSTGRESQL}"
},
"editorMode":"code",
"fields":[
{
"jsonPath":""
}
],
"format":"table",
"method":"GET",
"queryParams":"",
"rawQuery":true,
"rawSql":"SELECT MAX(finished_at - started_at) AS MAX\nFROM build_tasks\nWHERE build_id = $build_id AND status_id = 2",
"refId":"max",
"sql":{
"columns":[
{
"parameters":[],
"type":"function"
}
],
"groupBy":[
{
"property":{
"type":"string"
},
"type":"groupBy"
}
],
"limit":50
},
"urlPath":""
},
{
"cacheDurationSeconds":300,
"datasource":{
"type":"postgres",
"uid":"${DS_POSTGRESQL}"
},
"editorMode":"code",
"fields":[
{
"jsonPath":""
}
],
"format":"table",
"hide":false,
"method":"GET",
"queryParams":"",
"rawQuery":true,
"rawSql":"SELECT MIN(finished_at - started_at) AS MIN\nFROM build_tasks\nWHERE build_id = $build_id AND status_id = 2",
"refId":"min",
"sql":{
"columns":[
{
"parameters":[],
"type":"function"
}
],
"groupBy":[
{
"property":{
"type":"string"
},
"type":"groupBy"
}
],
"limit":50
},
"urlPath":""
},
{
"cacheDurationSeconds":300,
"datasource":{
"type":"postgres",
"uid":"${DS_POSTGRESQL}"
},
"editorMode":"code",
"fields":[
{
"jsonPath":""
}
],
"format":"table",
"hide":false,
"method":"GET",
"queryParams":"",
"rawQuery":true,
"rawSql":"SELECT PERCENTILE_CONT(0.5) WITHIN GROUP(ORDER BY durations.duration) as median FROM \n(SELECT (finished_at - started_at) AS duration\nFROM build_tasks\nWHERE build_id = $build_id AND status_id = 2) as durations\n\n\n",
"refId":"median",
"sql":{
"columns":[
{
"parameters":[],
"type":"function"
}
],
"groupBy":[
{
"property":{
"type":"string"
},
"type":"groupBy"
}
],
"limit":50
},
"urlPath":""
},
{
"datasource":{
"type":"postgres",
"uid":"${DS_POSTGRESQL}"
},
"editorMode":"code",
"format":"table",
"hide":false,
"rawQuery":true,
"rawSql":"SELECT PERCENTILE_CONT(0.95) WITHIN GROUP(ORDER BY durations.duration) as \"95th percentile\" FROM \n(SELECT (finished_at - started_at) AS duration\nFROM build_tasks\nWHERE build_id = $build_id AND status_id = 2) as durations",
"refId":"95th percentile",
"sql":{
"columns":[
{
"parameters":[],
"type":"function"
}
],
"groupBy":[
{
"property":{
"type":"string"
},
"type":"groupBy"
}
],
"limit":50
}
}
],
"title":"Build tasks duration (completed)",
"type":"stat"
},
{
"datasource":{
"type":"postgres",
"uid":"${DS_POSTGRESQL}"
},
"description":"How much time were spent in queue. \n\nStats for \"completed\" build tasks only",
"rawSql":"SELECT\n bt.id, \n SUM(bt.finished_at - bt.started_at) AS task_duration,\n (SELECT SUM(end_ts - start_ts) \n FROM web_node_stats AS ws \n WHERE ws.build_task_id = bt.id AND stat_name_id=0) AS web_node_duration,\n (SELECT SUM(end_ts - start_ts) \n FROM build_node_stats AS bs \n WHERE bs.build_task_id = bt.id AND stat_name_id=6) AS build_node_duration\nFROM build_tasks AS bt\nWHERE build_id = $build_id AND status_id = 2\nGROUP BY bt.id;",
"rawSql":"SELECT\n bt.id,\n bt.name,\n arch_enum.value AS arch,\n status_enum.value AS status,\n bt.started_at * 1000 AS started,\n bt.finished_at * 1000 AS finished,\n bt.finished_at - bt.started_at AS duration \nFROM build_tasks AS bt\nJOIN build_task_status_enum AS status_enum ON bt.status_id = status_enum.id\nJOIN arch_enum on bt.arch_id = arch_enum.id\nWHERE bt.build_id = $build_id;",
"rawSql":"SELECT\n bt.id,\n bt.name,\n arch_enum.value AS arch,\n bt.started_at * 1000 AS started,\n bt.finished_at * 1000 AS finished,\n task_duration AS \"task duration\",\n web_node_duration AS \"web node duration\",\n build_node_duration AS \"build node duration\",\n task_duration - web_node_duration - build_node_duration as \"wait time\"\n FROM build_tasks AS bt\n JOIN arch_enum on bt.arch_id = arch_enum.id \n LEFT JOIN \n (\n SELECT\n bt.id,\n bt.finished_at - bt.started_at AS task_duration,\n (SELECT SUM(end_ts - start_ts) \n FROM web_node_stats AS ws \n WHERE ws.build_task_id = bt.id AND stat_name_id=0) AS web_node_duration,\n (SELECT SUM(end_ts - start_ts) \n FROM build_node_stats AS bs \n WHERE bs.build_task_id = bt.id AND stat_name_id=6) AS build_node_duration\n FROM build_tasks AS bt\n WHERE bt.build_id = $build_id AND status_id = 2\n GROUP BY bt.id\n ) as d\n ON bt.id = d.id\n WHERE bt.build_id = $build_id AND status_id = 2",