-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsuperQuery.txt
More file actions
34 lines (31 loc) · 1.04 KB
/
superQuery.txt
File metadata and controls
34 lines (31 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
path: /api/stats/graphdata
body:
[
{
"name":'Nexus One',
"suiteid":1,
"reslimit":50,
"os":[1,2],
"devices":[1,2],
"browsers":[1,2],
"classes":[2],
"testcases":[3]
},
{
"name":'iPhone 6',
"suiteid":1,
"reslimit":50,
"os":[1,2],
"devices":[1,2],
"browsers":[1,2],
"classes":[2],
"testcases":[3]
}
]
data[0].data[50].timestamp
data[1].data[50].timestamp
data[0].name
query:
SELECT timestamp, time, result, report.class_id FROM report WHERE timestamp >= (SELECT MIN(timestamp) FROM (SELECT DISTINCT timestamp FROM report WHERE suite_id = {suiteid} ORDER BY timestamp DESC LIMIT {reslimit})) AND suite_id = {suiteid} {conditions} ORDER BY timestamp;
new query?
SELECT timestamp, SUM(time) AS time, SUM(result = 'passed') AS passed, SUM(result = 'failure') AS failure, SUM(result = 'error') AS error, report.class_id FROM report WHERE timestamp >= (SELECT MIN(timestamp) FROM (SELECT DISTINCT timestamp FROM report WHERE suite_id = 1 ORDER BY timestamp DESC LIMIT 50)) AND suite_id = 1 GROUP BY timestamp ORDER BY timestamp;