Skip to content

Commit 762258b

Browse files
committed
docs: add requests table to dashboard
1 parent fefe096 commit 762258b

File tree

2 files changed

+169
-43
lines changed

2 files changed

+169
-43
lines changed

examples/dashboard.png

-43.3 KB
Loading

examples/influxdb/web_app_access.json

Lines changed: 169 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,23 @@
2020
"data": [
2121
{
2222
"type": "cell",
23-
"id": "051559b2aa2a2000"
23+
"id": "0541daaaa9471000"
2424
},
2525
{
2626
"type": "cell",
27-
"id": "051559b2ae2a2000"
27+
"id": "0541daaaaac71000"
2828
},
2929
{
3030
"type": "cell",
31-
"id": "051559b2af6a2000"
31+
"id": "0541daaaab071000"
3232
},
3333
{
3434
"type": "cell",
35-
"id": "05155aef3daa2000"
35+
"id": "0541daaaabc71000"
36+
},
37+
{
38+
"type": "cell",
39+
"id": "0541db0ef0871000"
3640
}
3741
]
3842
},
@@ -43,7 +47,7 @@
4347
},
4448
"included": [
4549
{
46-
"id": "051559b2aa2a2000",
50+
"id": "0541daaaa9471000",
4751
"type": "cell",
4852
"attributes": {
4953
"x": 0,
@@ -55,49 +59,49 @@
5559
"view": {
5660
"data": {
5761
"type": "view",
58-
"id": "051559b2aa2a2000"
62+
"id": "0541daaaa9471000"
5963
}
6064
}
6165
}
6266
},
6367
{
64-
"id": "051559b2ae2a2000",
68+
"id": "0541daaaaac71000",
6569
"type": "cell",
6670
"attributes": {
67-
"x": 0,
68-
"y": 4,
69-
"w": 12,
71+
"x": 4,
72+
"y": 0,
73+
"w": 4,
7074
"h": 4
7175
},
7276
"relationships": {
7377
"view": {
7478
"data": {
7579
"type": "view",
76-
"id": "051559b2ae2a2000"
80+
"id": "0541daaaaac71000"
7781
}
7882
}
7983
}
8084
},
8185
{
82-
"id": "051559b2af6a2000",
86+
"id": "0541daaaab071000",
8387
"type": "cell",
8488
"attributes": {
85-
"x": 4,
86-
"y": 0,
87-
"w": 4,
89+
"x": 6,
90+
"y": 4,
91+
"w": 6,
8892
"h": 4
8993
},
9094
"relationships": {
9195
"view": {
9296
"data": {
9397
"type": "view",
94-
"id": "051559b2af6a2000"
98+
"id": "0541daaaab071000"
9599
}
96100
}
97101
}
98102
},
99103
{
100-
"id": "05155aef3daa2000",
104+
"id": "0541daaaabc71000",
101105
"type": "cell",
102106
"attributes": {
103107
"x": 8,
@@ -109,14 +113,32 @@
109113
"view": {
110114
"data": {
111115
"type": "view",
112-
"id": "05155aef3daa2000"
116+
"id": "0541daaaabc71000"
117+
}
118+
}
119+
}
120+
},
121+
{
122+
"id": "0541db0ef0871000",
123+
"type": "cell",
124+
"attributes": {
125+
"x": 0,
126+
"y": 4,
127+
"w": 6,
128+
"h": 4
129+
},
130+
"relationships": {
131+
"view": {
132+
"data": {
133+
"type": "view",
134+
"id": "0541db0ef0871000"
113135
}
114136
}
115137
}
116138
},
117139
{
118140
"type": "view",
119-
"id": "051559b2aa2a2000",
141+
"id": "0541daaaa9471000",
120142
"attributes": {
121143
"name": "Requests Count",
122144
"properties": {
@@ -164,9 +186,57 @@
164186
},
165187
{
166188
"type": "view",
167-
"id": "051559b2ae2a2000",
189+
"id": "0541daaaaac71000",
168190
"attributes": {
169-
"name": "Requests",
191+
"name": "Request Size",
192+
"properties": {
193+
"shape": "chronograf-v2",
194+
"type": "single-stat",
195+
"queries": [
196+
{
197+
"text": "from(bucket: \"my-bucket\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r._measurement == \"httpd.access\")\n |> filter(fn: (r) => r.method == \"GET\")\n |> filter(fn: (r) => r._field == \"size\")\n |> drop(columns: [\"path\"])\n |> toInt()\n |> sum(column: \"_value\")\n |> map(fn: (r) => ({\n r with\n _value: r._value / 1024\n })\n )",
198+
"editMode": "advanced",
199+
"name": "",
200+
"builderConfig": {
201+
"buckets": [],
202+
"tags": [
203+
{
204+
"key": "_measurement",
205+
"values": []
206+
}
207+
],
208+
"functions": [],
209+
"aggregateWindow": {
210+
"period": "auto"
211+
}
212+
}
213+
}
214+
],
215+
"prefix": "",
216+
"suffix": " KiB",
217+
"colors": [
218+
{
219+
"id": "base",
220+
"type": "text",
221+
"hex": "#F48D38",
222+
"name": "tiger",
223+
"value": 0
224+
}
225+
],
226+
"decimalPlaces": {
227+
"isEnforced": true,
228+
"digits": 2
229+
},
230+
"note": "",
231+
"showNoteWhenEmpty": false
232+
}
233+
}
234+
},
235+
{
236+
"type": "view",
237+
"id": "0541daaaab071000",
238+
"attributes": {
239+
"name": "Requests Count",
170240
"properties": {
171241
"shape": "chronograf-v2",
172242
"queries": [
@@ -251,15 +321,15 @@
251321
},
252322
{
253323
"type": "view",
254-
"id": "051559b2af6a2000",
324+
"id": "0541daaaabc71000",
255325
"attributes": {
256-
"name": "Request Size",
326+
"name": "Success rate",
257327
"properties": {
258328
"shape": "chronograf-v2",
259329
"type": "single-stat",
260330
"queries": [
261331
{
262-
"text": "from(bucket: \"my-bucket\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r._measurement == \"httpd.access\")\n |> filter(fn: (r) => r.method == \"GET\")\n |> filter(fn: (r) => r._field == \"size\")\n |> drop(columns: [\"path\"])\n |> toInt()\n |> sum(column: \"_value\")\n |> map(fn: (r) => ({\n r with\n _value: r._value / 1024\n })\n )",
332+
"text": "from(bucket: \"my-bucket\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r._measurement == \"httpd.access\")\n |> filter(fn: (r) => r._field == \"code\")\n |> drop(columns: [\"path\", \"method\", \"host\"])\n |> toInt()\n |> map(fn: (r) => ({ \n _time: r._start,\n _success:\n if r._value < 300 then 1\n else 0,\n _failure:\n if r._value >= 300 then 1\n else 0\n })\n )\n |> cumulativeSum(columns: [\"_failure\", \"_success\"])\n |> drop(columns: [\"_time\"])\n |> map(fn: (r) => ({\n r with\n _value: (float(v: r._success) / (float(v: r._success) + float(v: r._failure))) * 100.0\n })\n)\n |> last()",
263333
"editMode": "advanced",
264334
"name": "",
265335
"builderConfig": {
@@ -278,14 +348,28 @@
278348
}
279349
],
280350
"prefix": "",
281-
"suffix": " KiB",
351+
"suffix": "%",
282352
"colors": [
283353
{
284354
"id": "base",
285355
"type": "text",
356+
"hex": "#00C9FF",
357+
"name": "laser",
358+
"value": 0
359+
},
360+
{
361+
"id": "5e50c5ba-51cc-4139-870f-663050d6e79d",
362+
"type": "text",
286363
"hex": "#F48D38",
287364
"name": "tiger",
288-
"value": 0
365+
"value": 80
366+
},
367+
{
368+
"id": "305d340f-09e5-4137-b88b-0a6599209dc0",
369+
"type": "text",
370+
"hex": "#7CE490",
371+
"name": "honeydew",
372+
"value": 90
289373
}
290374
],
291375
"decimalPlaces": {
@@ -299,15 +383,15 @@
299383
},
300384
{
301385
"type": "view",
302-
"id": "05155aef3daa2000",
386+
"id": "0541db0ef0871000",
303387
"attributes": {
304-
"name": "Success rate",
388+
"name": "Requests",
305389
"properties": {
306390
"shape": "chronograf-v2",
307-
"type": "single-stat",
391+
"type": "table",
308392
"queries": [
309393
{
310-
"text": "from(bucket: \"my-bucket\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r._measurement == \"httpd.access\")\n |> filter(fn: (r) => r._field == \"code\")\n |> drop(columns: [\"path\", \"method\", \"host\"])\n |> toInt()\n |> map(fn: (r) => ({ \n _time: r._start,\n _success:\n if r._value < 300 then 1\n else 0,\n _failure:\n if r._value >= 300 then 1\n else 0\n })\n )\n |> cumulativeSum(columns: [\"_failure\", \"_success\"])\n |> drop(columns: [\"_time\"])\n |> map(fn: (r) => ({\n r with\n _value: (float(v: r._success) / (float(v: r._success) + float(v: r._failure))) * 100.0\n })\n)\n |> last()",
394+
"text": "from(bucket: \"my-bucket\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r._measurement == \"httpd.access\")",
311395
"editMode": "advanced",
312396
"name": "",
313397
"builderConfig": {
@@ -325,33 +409,75 @@
325409
}
326410
}
327411
],
328-
"prefix": "",
329-
"suffix": "%",
330412
"colors": [
331413
{
332414
"id": "base",
333415
"type": "text",
334416
"hex": "#00C9FF",
335417
"name": "laser",
336418
"value": 0
419+
}
420+
],
421+
"tableOptions": {
422+
"verticalTimeAxis": true,
423+
"sortBy": {
424+
"internalName": "",
425+
"displayName": "",
426+
"visible": false
337427
},
428+
"wrapping": "",
429+
"fixFirstColumn": false
430+
},
431+
"fieldOptions": [
338432
{
339-
"id": "5e50c5ba-51cc-4139-870f-663050d6e79d",
340-
"type": "text",
341-
"hex": "#F48D38",
342-
"name": "tiger",
343-
"value": 80
433+
"internalName": "_start",
434+
"displayName": "_start",
435+
"visible": false
344436
},
345437
{
346-
"id": "305d340f-09e5-4137-b88b-0a6599209dc0",
347-
"type": "text",
348-
"hex": "#7CE490",
349-
"name": "honeydew",
350-
"value": 90
438+
"internalName": "_stop",
439+
"displayName": "_stop",
440+
"visible": false
441+
},
442+
{
443+
"internalName": "_time",
444+
"displayName": "Time",
445+
"visible": true
446+
},
447+
{
448+
"internalName": "host",
449+
"displayName": "Host",
450+
"visible": true
451+
},
452+
{
453+
"internalName": "path",
454+
"displayName": "Path",
455+
"visible": true
456+
},
457+
{
458+
"internalName": "method",
459+
"displayName": "Method",
460+
"visible": true
461+
},
462+
{
463+
"internalName": "_field",
464+
"displayName": "Field",
465+
"visible": true
466+
},
467+
{
468+
"internalName": "_value",
469+
"displayName": "Value",
470+
"visible": true
471+
},
472+
{
473+
"internalName": "_measurement",
474+
"displayName": "_measurement",
475+
"visible": false
351476
}
352477
],
478+
"timeFormat": "YYYY-MM-DD HH:mm:ss",
353479
"decimalPlaces": {
354-
"isEnforced": true,
480+
"isEnforced": false,
355481
"digits": 2
356482
},
357483
"note": "",

0 commit comments

Comments
 (0)