-
Notifications
You must be signed in to change notification settings - Fork 0
/
util.ts
66 lines (57 loc) · 1.21 KB
/
util.ts
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import { QueryResult } from "../charts/utilities/types";
import { LineData } from "../charts/utilities/types";
/* Unformatted Data Structure
[
{
dimensions: [timestamp],
measures: [
app_cache
dns
tcp
request
response
processing
load
]
}
]
*/
/* Chart Data Structure
[
{
id: 'app_cache',
text: 'app_cache',
values: [
[timestamp, value],
[timestamp, value],
[timestamp, value],
[timestamp, value],
...,
]
}
]
*/
// ANSWERS
const metricColumnNames = [
"app_cache",
"dns",
"tcp",
"request",
"response",
"processing",
"load",
];
const someLongUrls = [
"anextremelylongurl.com?someSortOfQueryParam=definitely",
"reallycoolwebsite.com/catalog/product/1234?isLong=true",
"shorturlname.com",
"quantumcookies.com/checkout/payment",
"prettycoolwebsite.com/1/2/3",
"startingtorunoutofideasforlongwebsitenames.com/folder/path/thing",
"thiswillwithoutadoubtbethelongesturlthatwillbeinthischallenge.com/a/b/c/d/e?param1=cool¶m2=something-else¶m3=some-final-thing",
];
// CHALLENGE SECTION
const shapeChartData = (unformattedData: QueryResult[]): LineData[] => {
return [];
};
export { shapeChartData };