@golemio/rush-hour-aggregation 1.0.1-dev.532695480 → 1.0.1-dev.540776399
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -1,27 +1,65 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<p>
|
|
3
|
+
<a href="https://operatorict.cz">
|
|
4
|
+
<img src="https://gitlab.com/operator-ict/golemio/code/modules/core/-/raw/development/.assets/oict_logo.png" alt="oict" width="100px" height="100px" />
|
|
5
|
+
</a>
|
|
6
|
+
<a href="https://golemio.cz">
|
|
7
|
+
<img src="https://gitlab.com/operator-ict/golemio/code/modules/core/-/raw/development/.assets/golemio_logo.png" alt="golemio" width="100px" height="100px" />
|
|
8
|
+
</a>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<h1>@golemio/rush-hour-aggregation</h1>
|
|
12
|
+
|
|
13
|
+
<p>
|
|
14
|
+
<a href="https://gitlab.com/operator-ict/golemio/code/modules/rush-hour-aggregation/commits/master">
|
|
15
|
+
<img src="https://gitlab.com/operator-ict/golemio/code/modules/rush-hour-aggregation/badges/master/pipeline.svg" alt="pipeline">
|
|
16
|
+
</a>
|
|
17
|
+
<a href="https://gitlab.com/operator-ict/golemio/code/modules/rush-hour-aggregation/commits/master">
|
|
18
|
+
<img src="https://gitlab.com/operator-ict/golemio/code/modules/rush-hour-aggregation/badges/master/coverage.svg" alt="coverage">
|
|
19
|
+
</a>
|
|
20
|
+
<a href="./LICENSE">
|
|
21
|
+
<img src="https://img.shields.io/npm/l/@golemio/rush-hour-aggregation" alt="license">
|
|
22
|
+
</a>
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
<p>
|
|
26
|
+
<a href="#installation">Installation</a> · <a href="./docs">Documentation</a> · <a href="https://operator-ict.gitlab.io/golemio/code/modules/rush-hour-aggregation">TypeDoc</a>
|
|
27
|
+
</p>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
This module is intended for use with Golemio services. Refer [here](https://gitlab.com/operator-ict/golemio/code/modules/core/-/blob/development/README.md) for further information on usage, local development and more.
|
|
31
|
+
|
|
32
|
+
## Installation
|
|
33
|
+
|
|
34
|
+
The APIs may be unstable. Therefore, we recommend to install this module as an exact version.
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# Latest version
|
|
38
|
+
yarn add --exact @golemio/rush-hour-aggregation@latest
|
|
39
|
+
|
|
40
|
+
# Development version
|
|
41
|
+
yarn add --exact @golemio/rush-hour-aggregation@dev
|
|
42
|
+
```
|
|
3
43
|
|
|
4
|
-
|
|
44
|
+
## Description
|
|
5
45
|
|
|
6
|
-
|
|
46
|
+
This module aggregates traffic data for Praha Zasekana project. It takes different traffic dataset avaiable in a golemio dataplatform and creates time series data for traffic jams, incidents or reconstructions.
|
|
7
47
|
|
|
8
|
-
[Rabin Praha Zasekana](https://praha-zasekana-backend.rabin.golemio.cz/app)
|
|
48
|
+
[Rabin Praha Zasekana](https://praha-zasekana-backend.rabin.golemio.cz/app)
|
|
9
49
|
[Backend repo Praha Zasekana](https://gitlab.com/operator-ict/golemio/code/praha-zasekana)
|
|
10
50
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
# Datasources
|
|
51
|
+
## Datasources
|
|
14
52
|
|
|
15
53
|
- Waze
|
|
16
54
|
- SDDŘ
|
|
17
55
|
- FCD
|
|
18
56
|
- NDIC
|
|
19
57
|
|
|
20
|
-
|
|
58
|
+
## Current setup
|
|
21
59
|
|
|
22
60
|
Every 5 minutes worker starts and for each of the datasource aggregation is run and timeseries data are updated.
|
|
23
61
|
|
|
24
|
-
|
|
62
|
+
## Aggregation of older data
|
|
25
63
|
|
|
26
64
|
It is possible to insert or update historic data by creation of manual message in RabbitMQ.
|
|
27
65
|
E.g. to insert data for Fcd for first month in 2022 use following message:
|
|
@@ -34,7 +72,7 @@ E.g. to insert data for Fcd for first month in 2022 use following message:
|
|
|
34
72
|
}
|
|
35
73
|
```
|
|
36
74
|
|
|
37
|
-
|
|
75
|
+
## Message building blocks
|
|
38
76
|
|
|
39
77
|
Message has to be in json format and supports following fields:
|
|
40
78
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
CREATE MATERIALIZED VIEW waze_reconstructions_snapshots_history AS WITH config AS (
|
|
6
6
|
SELECT 120000 AS max_period,
|
|
7
|
-
date_part('epoch'::text, date_trunc('day',now())) * 1000::double precision AS max_measured_at
|
|
7
|
+
date_part('epoch'::text, date_trunc('day',now(), 'Europe/Prague')) * 1000::double precision AS max_measured_at
|
|
8
8
|
)
|
|
9
9
|
SELECT s.start_measured_at,
|
|
10
10
|
s.end_measured_at,
|
|
@@ -59,7 +59,7 @@ CREATE UNIQUE INDEX waze_reconstructions_snapshots_history_start_measured_at_idx
|
|
|
59
59
|
|
|
60
60
|
CREATE MATERIALIZED VIEW waze_reconstructions_snapshots_latest AS WITH config AS (
|
|
61
61
|
SELECT 120000 AS max_period,
|
|
62
|
-
date_part('epoch'::text, date_trunc('day',now())) * 1000::double precision AS min_measured_at
|
|
62
|
+
date_part('epoch'::text, date_trunc('day',now(), 'Europe/Prague')) * 1000::double precision AS min_measured_at
|
|
63
63
|
)
|
|
64
64
|
SELECT s.start_measured_at,
|
|
65
65
|
s.end_measured_at,
|
|
@@ -116,7 +116,7 @@ CREATE UNIQUE INDEX waze_reconstructions_snapshots_latest_start_measured_at_idx
|
|
|
116
116
|
|
|
117
117
|
CREATE MATERIALIZED VIEW waze_jams_snapshots_history AS WITH config AS (
|
|
118
118
|
SELECT 120000 AS max_period,
|
|
119
|
-
date_part('epoch'::text, date_trunc('day',now())) * 1000::double precision AS max_measured_at
|
|
119
|
+
date_part('epoch'::text, date_trunc('day',now(), 'Europe/Prague')) * 1000::double precision AS max_measured_at
|
|
120
120
|
)
|
|
121
121
|
SELECT s.start_measured_at,
|
|
122
122
|
s.end_measured_at,
|
|
@@ -170,7 +170,7 @@ CREATE UNIQUE INDEX waze_jams_snapshots_history_start_measured_at_idx ON waze_ja
|
|
|
170
170
|
|
|
171
171
|
CREATE MATERIALIZED VIEW waze_jams_snapshots_latest AS WITH config AS (
|
|
172
172
|
SELECT 120000 AS max_period,
|
|
173
|
-
date_part('epoch'::text, date_trunc('day',now())) * 1000::double precision AS min_measured_at
|
|
173
|
+
date_part('epoch'::text, date_trunc('day',now(), 'Europe/Prague')) * 1000::double precision AS min_measured_at
|
|
174
174
|
)
|
|
175
175
|
SELECT s.start_measured_at,
|
|
176
176
|
s.end_measured_at,
|
|
@@ -231,7 +231,7 @@ CREATE UNIQUE INDEX waze_jams_snapshots_latest_start_measured_at_idx ON waze_jam
|
|
|
231
231
|
|
|
232
232
|
CREATE MATERIALIZED VIEW tsk_std_last_30min_snapshots_history AS WITH config AS (
|
|
233
233
|
SELECT 300000 AS max_period,
|
|
234
|
-
date_part('epoch'::text, date_trunc('day',now())) * 1000::double precision AS max_measured_at
|
|
234
|
+
date_part('epoch'::text, date_trunc('day',now(), 'Europe/Prague')) * 1000::double precision AS max_measured_at
|
|
235
235
|
)
|
|
236
236
|
SELECT s.start_measured_at,
|
|
237
237
|
s.end_measured_at,
|
|
@@ -284,7 +284,7 @@ CREATE UNIQUE INDEX tsk_std_last_30min_snapshots_history_start_measured_at_idx O
|
|
|
284
284
|
|
|
285
285
|
CREATE MATERIALIZED VIEW tsk_std_last_30min_snapshots_latest AS WITH config AS (
|
|
286
286
|
SELECT 300000 AS max_period,
|
|
287
|
-
date_part('epoch'::text, date_trunc('day',now())) * 1000::double precision AS min_measured_at
|
|
287
|
+
date_part('epoch'::text, date_trunc('day',now(), 'Europe/Prague')) * 1000::double precision AS min_measured_at
|
|
288
288
|
)
|
|
289
289
|
SELECT s.start_measured_at,
|
|
290
290
|
s.end_measured_at,
|
|
@@ -347,7 +347,7 @@ CREATE UNIQUE INDEX tsk_std_last_30min_snapshots_latest_start_measured_at_idx ON
|
|
|
347
347
|
|
|
348
348
|
CREATE MATERIALIZED VIEW ndic_events_full_snapshots_history AS WITH config AS (
|
|
349
349
|
SELECT 1800000 AS max_period,
|
|
350
|
-
date_part('epoch'::text, date_trunc('day',now())) * 1000::double precision AS max_measured_at
|
|
350
|
+
date_part('epoch'::text, date_trunc('day',now(), 'Europe/Prague')) * 1000::double precision AS max_measured_at
|
|
351
351
|
)
|
|
352
352
|
SELECT s.start_measured_at,
|
|
353
353
|
s.end_measured_at,
|
|
@@ -400,7 +400,7 @@ CREATE UNIQUE INDEX ndic_events_full_snapshots_history_start_measured_at_idx ON
|
|
|
400
400
|
|
|
401
401
|
CREATE MATERIALIZED VIEW ndic_events_full_snapshots_latest AS WITH config AS (
|
|
402
402
|
SELECT 1800000 AS max_period,
|
|
403
|
-
date_part('epoch'::text, date_trunc('day',now())) * 1000::double precision AS min_measured_at
|
|
403
|
+
date_part('epoch'::text, date_trunc('day',now(), 'Europe/Prague')) * 1000::double precision AS min_measured_at
|
|
404
404
|
)
|
|
405
405
|
SELECT s.start_measured_at,
|
|
406
406
|
s.end_measured_at,
|
|
@@ -462,7 +462,7 @@ CREATE UNIQUE INDEX ndic_events_full_snapshots_latest_start_measured_at_idx ON n
|
|
|
462
462
|
|
|
463
463
|
CREATE MATERIALIZED VIEW fcd_events_snapshots_history AS WITH config AS (
|
|
464
464
|
SELECT 60000 AS max_period,
|
|
465
|
-
(date_part('epoch'::text, date_trunc('day',now())) * 1000)::int8 AS max_measured_at
|
|
465
|
+
(date_part('epoch'::text, date_trunc('day',now(), 'Europe/Prague')) * 1000)::int8 AS max_measured_at
|
|
466
466
|
)
|
|
467
467
|
SELECT s.start_measured_at,
|
|
468
468
|
s.end_measured_at,
|
|
@@ -516,7 +516,7 @@ CREATE UNIQUE INDEX fcd_events_snapshots_history_start_measured_at_idx ON fcd_ev
|
|
|
516
516
|
|
|
517
517
|
CREATE MATERIALIZED VIEW fcd_events_snapshots_latest AS WITH config AS (
|
|
518
518
|
SELECT 60000 AS max_period,
|
|
519
|
-
(date_part('epoch'::text, date_trunc('day',now())) * 1000)::int8 AS min_measured_at
|
|
519
|
+
(date_part('epoch'::text, date_trunc('day',now(), 'Europe/Prague')) * 1000)::int8 AS min_measured_at
|
|
520
520
|
)
|
|
521
521
|
SELECT s.start_measured_at,
|
|
522
522
|
s.end_measured_at,
|
package/package.json
CHANGED