@golemio/rush-hour-aggregation 1.0.3 → 1.0.5-dev.620292234
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 +4 -0
- package/dist/integration-engine/AggregationWorker.d.ts +1 -2
- package/dist/integration-engine/AggregationWorker.js +8 -9
- package/dist/integration-engine/AggregationWorker.js.map +1 -1
- package/dist/integration-engine/WorkerHelper.d.ts +5 -1
- package/dist/integration-engine/WorkerHelper.js +27 -15
- package/dist/integration-engine/WorkerHelper.js.map +1 -1
- package/dist/integration-engine/business/AggregationTask.d.ts +2 -1
- package/dist/integration-engine/business/AggregationTask.js +2 -1
- package/dist/integration-engine/business/AggregationTask.js.map +1 -1
- package/dist/integration-engine/dataAccess/AbstractEventsRepository.js +1 -1
- package/dist/integration-engine/dataAccess/AbstractEventsRepository.js.map +1 -1
- package/dist/integration-engine/service/aggregators/AbstractAggregator.d.ts +2 -2
- package/dist/integration-engine/service/aggregators/AbstractAggregator.js +6 -4
- package/dist/integration-engine/service/aggregators/AbstractAggregator.js.map +1 -1
- package/dist/integration-engine/service/aggregators/WazeJamsAggregator.d.ts +0 -1
- package/dist/integration-engine/service/aggregators/WazeJamsAggregator.js +0 -1
- package/dist/integration-engine/service/aggregators/WazeJamsAggregator.js.map +1 -1
- package/dist/integration-engine/service/aggregators/WazeReconstructionsAggregator.d.ts +0 -1
- package/dist/integration-engine/service/aggregators/WazeReconstructionsAggregator.js +0 -1
- package/dist/integration-engine/service/aggregators/WazeReconstructionsAggregator.js.map +1 -1
- package/dist/integration-engine/service/aggregators/interfaces/IAbstractAggregator.d.ts +1 -1
- package/package.json +61 -61
- package/templates/sqlQueries/FcdEvents.sql +1 -1
package/README.md
CHANGED
|
@@ -72,6 +72,8 @@ E.g. to insert data for Fcd for first month in 2022 use following message:
|
|
|
72
72
|
}
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
+
As of version 1.0.5 for FCD put maximum one month in one message. If whole year needs to be updated send 12 messages. For NDIC and SDDR use max 3 months and for waze 6 months.
|
|
76
|
+
|
|
75
77
|
## Message building blocks
|
|
76
78
|
|
|
77
79
|
Message has to be in json format and supports following fields:
|
|
@@ -84,4 +86,6 @@ _type_ - Required setting which aggregation should be run. Possible values: WAZE
|
|
|
84
86
|
|
|
85
87
|
_updateOnDuplicate_ - Optional setting for situation when upgrade of already aggregated data is required. Possible values "true", "false". Default value is false. (Note: automatic 5 minute updates have the setting to true)
|
|
86
88
|
|
|
89
|
+
_refreshView_ - Optional setting to refresh latest materialized view. Possible values "true", "false". Default value is false. (Note: automatic 5 minute updates have the setting to true)
|
|
90
|
+
|
|
87
91
|
To initiate automatic 5 minute aggregation manually it is possible to send empty message.
|
|
@@ -2,14 +2,13 @@ import { BaseWorker } from "@golemio/core/dist/integration-engine";
|
|
|
2
2
|
import { Message } from "amqplib";
|
|
3
3
|
export declare class AggregationWorker extends BaseWorker {
|
|
4
4
|
static queuePrefix: string;
|
|
5
|
-
static queueName: string;
|
|
6
5
|
static aggregationMethodName: string;
|
|
7
6
|
static refreshHistoricViewsMethodName: string;
|
|
8
7
|
private aggregationFactory;
|
|
9
8
|
private refreshIntervalInMinutes;
|
|
10
9
|
constructor();
|
|
11
10
|
aggregateData: (message: Message) => Promise<void>;
|
|
12
|
-
refreshHistoricViews: (
|
|
11
|
+
refreshHistoricViews: () => Promise<void>;
|
|
13
12
|
private isTaskEmpty;
|
|
14
13
|
private isDateRangeBig;
|
|
15
14
|
private handleEmptyTask;
|
|
@@ -26,7 +26,7 @@ class AggregationWorker extends integration_engine_1.BaseWorker {
|
|
|
26
26
|
this.refreshIntervalInMinutes = 10;
|
|
27
27
|
this.aggregateData = (message) => __awaiter(this, void 0, void 0, function* () {
|
|
28
28
|
const task = WorkerHelper_1.default.parseMessage(message);
|
|
29
|
-
integration_engine_1.log.debug(`
|
|
29
|
+
integration_engine_1.log.debug(`Received new task: ${JSON.stringify(task)}`);
|
|
30
30
|
if (this.isTaskEmpty(task)) {
|
|
31
31
|
yield this.handleEmptyTask();
|
|
32
32
|
}
|
|
@@ -34,13 +34,13 @@ class AggregationWorker extends integration_engine_1.BaseWorker {
|
|
|
34
34
|
yield this.generateSubTasks(task);
|
|
35
35
|
}
|
|
36
36
|
else if (task.type && task.from && task.to) {
|
|
37
|
-
yield this.processTask(task.type, task.from, task.to, task.updateOnDuplicate);
|
|
37
|
+
yield this.processTask(task.type, task.from, task.to, task.updateOnDuplicate, task.refreshView);
|
|
38
38
|
}
|
|
39
39
|
else {
|
|
40
40
|
throw new errors_1.CustomError(`Unable to process task: ${JSON.stringify(task)}.`, true, this.constructor.name);
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
|
-
this.refreshHistoricViews = (
|
|
43
|
+
this.refreshHistoricViews = () => __awaiter(this, void 0, void 0, function* () {
|
|
44
44
|
for (const type in AggregationTaskType_1.AggregationTaskType) {
|
|
45
45
|
try {
|
|
46
46
|
const aggregator = this.aggregationFactory.get(type.toUpperCase());
|
|
@@ -55,20 +55,20 @@ class AggregationWorker extends integration_engine_1.BaseWorker {
|
|
|
55
55
|
const to = new Date();
|
|
56
56
|
const from = luxon_1.DateTime.fromJSDate(to).minus({ minutes: this.refreshIntervalInMinutes }).toJSDate();
|
|
57
57
|
for (const type in AggregationTaskType_1.AggregationTaskType) {
|
|
58
|
-
yield this.processTask(type, from, to, true);
|
|
58
|
+
yield this.processTask(type, from, to, true, true);
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
|
-
this.processTask = (type, from, to, updateOnDuplicate) => __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
this.processTask = (type, from, to, updateOnDuplicate, refreshView) => __awaiter(this, void 0, void 0, function* () {
|
|
62
62
|
try {
|
|
63
63
|
const aggregator = this.aggregationFactory.get(type.toUpperCase());
|
|
64
|
-
yield aggregator.aggregateAndSave(from, to, updateOnDuplicate);
|
|
64
|
+
yield aggregator.aggregateAndSave(from, to, updateOnDuplicate, refreshView);
|
|
65
65
|
}
|
|
66
66
|
catch (err) {
|
|
67
|
-
integration_engine_1.log.error(`Unable to process task: ${type} from: ${from} to: ${to}. Error stack: ${err.stack}`);
|
|
67
|
+
integration_engine_1.log.error(`Unable to process task: ${type} from: ${from} to: ${to}. (${err.toString()}) Error stack: ${err.stack}`);
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
70
|
this.generateSubTasks = (task) => __awaiter(this, void 0, void 0, function* () {
|
|
71
|
-
const subtasks = WorkerHelper_1.default.
|
|
71
|
+
const subtasks = WorkerHelper_1.default.generateSubTasksDefinitions(luxon_1.DateTime.fromJSDate(task.from), luxon_1.DateTime.fromJSDate(task.to), this.aggregationFactory.get(task.type).getMaxDuration(), task.type, task.updateOnDuplicate, task.refreshView);
|
|
72
72
|
for (const subtask of subtasks) {
|
|
73
73
|
yield this.sendMessageToExchange("workers." + AggregationWorker.queuePrefix + "." + AggregationWorker.aggregationMethodName, JSON.stringify(subtask));
|
|
74
74
|
}
|
|
@@ -89,7 +89,6 @@ class AggregationWorker extends integration_engine_1.BaseWorker {
|
|
|
89
89
|
}
|
|
90
90
|
exports.AggregationWorker = AggregationWorker;
|
|
91
91
|
AggregationWorker.queuePrefix = config_1.config.RABBIT_EXCHANGE_NAME + "." + "rush-hour-aggregation";
|
|
92
|
-
AggregationWorker.queueName = "rush-hour-aggregation";
|
|
93
92
|
AggregationWorker.aggregationMethodName = "aggregateData";
|
|
94
93
|
AggregationWorker.refreshHistoricViewsMethodName = "refreshHistoricViews";
|
|
95
94
|
//# sourceMappingURL=AggregationWorker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AggregationWorker.js","sourceRoot":"","sources":["../../src/integration-engine/AggregationWorker.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,8EAAwE;AACxE,yEAAsE;AACtE,2DAAqE;AACrE,4CAA8C;AAE9C,
|
|
1
|
+
{"version":3,"file":"AggregationWorker.js","sourceRoot":"","sources":["../../src/integration-engine/AggregationWorker.ts"],"names":[],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IAAI,UAAU,GAAG,WAAW,CAAC;SACjD;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;;AAlDL,8CA4FC;AA3FiB,6BAAW,GAAG,eAAM,CAAC,oBAAoB,GAAG,GAAG,GAAG,uBAAuB,CAAC;AAC1E,uCAAqB,GAAG,eAAe,CAAC;AACxC,gDAA8B,GAAG,sBAAsB,CAAC"}
|
|
@@ -4,6 +4,10 @@ import { Message } from "amqplib";
|
|
|
4
4
|
import AggregationTask from "./business/AggregationTask";
|
|
5
5
|
export default class WorkerHelper {
|
|
6
6
|
static parseMessage(message: Message): AggregationTask;
|
|
7
|
-
static
|
|
7
|
+
static generateIntervals: (from: DateTime, to: DateTime, maxDuration: DurationLike) => Array<{
|
|
8
|
+
start: Date;
|
|
9
|
+
end: Date;
|
|
10
|
+
}>;
|
|
11
|
+
static generateSubTasksDefinitions: (from: DateTime, to: DateTime, maxDuration: DurationLike, taskType: AggregationTaskType, updateOnDuplicate: boolean, refreshView: boolean) => AggregationTask[];
|
|
8
12
|
private static parseContent;
|
|
9
13
|
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
|
-
var _a;
|
|
6
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
6
|
const AggregationTaskType_1 = require("../schema-definitions/helpers/AggregationTaskType");
|
|
8
7
|
const helpers_1 = require("@golemio/core/dist/integration-engine/helpers");
|
|
@@ -11,16 +10,16 @@ const errors_1 = require("@golemio/errors");
|
|
|
11
10
|
const AggregationTask_1 = __importDefault(require("./business/AggregationTask"));
|
|
12
11
|
class WorkerHelper {
|
|
13
12
|
static parseMessage(message) {
|
|
14
|
-
var
|
|
13
|
+
var _a;
|
|
15
14
|
const task = WorkerHelper.parseContent(message.content.toString());
|
|
16
15
|
if (!task)
|
|
17
16
|
return {};
|
|
18
|
-
const type = AggregationTaskType_1.AggregationTaskType[(
|
|
17
|
+
const type = AggregationTaskType_1.AggregationTaskType[(_a = task.type) === null || _a === void 0 ? void 0 : _a.toUpperCase()];
|
|
19
18
|
if (!type)
|
|
20
19
|
throw new errors_1.CustomError(`Unknown aggregation task type ${JSON.stringify(task)}`, true, this.constructor.name);
|
|
21
20
|
if (!task.from || !task.to)
|
|
22
21
|
throw new errors_1.CustomError(`Unsupported aggregation task ${JSON.stringify(task)}`, true, this.constructor.name);
|
|
23
|
-
const result = new AggregationTask_1.default(luxon_1.DateTime.fromISO(task.from).toJSDate(), luxon_1.DateTime.fromISO(task.to).toJSDate(), type, task.updateOnDuplicate ? task.updateOnDuplicate.toString().toLowerCase() == "true" : undefined);
|
|
22
|
+
const result = new AggregationTask_1.default(luxon_1.DateTime.fromISO(task.from).toJSDate(), luxon_1.DateTime.fromISO(task.to).toJSDate(), type, task.updateOnDuplicate ? task.updateOnDuplicate.toString().toLowerCase() == "true" : undefined, task.refreshView ? task.refreshView.toString().toLowerCase() == "true" : undefined);
|
|
24
23
|
if (result.from > result.to)
|
|
25
24
|
throw new errors_1.CustomError(`Unsupported task date range ${JSON.stringify(task)}`, true, this.constructor.name);
|
|
26
25
|
return result;
|
|
@@ -35,18 +34,31 @@ class WorkerHelper {
|
|
|
35
34
|
}
|
|
36
35
|
}
|
|
37
36
|
exports.default = WorkerHelper;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
WorkerHelper.generateIntervals = (from, to, maxDuration) => {
|
|
38
|
+
const breakpoints = [from];
|
|
39
|
+
let tmpFrom = from.plus(maxDuration);
|
|
40
|
+
while (tmpFrom.diff(to, "milliseconds").milliseconds < 0) {
|
|
41
|
+
breakpoints.push(tmpFrom);
|
|
42
|
+
tmpFrom = tmpFrom.plus(maxDuration);
|
|
43
|
+
}
|
|
44
|
+
if (tmpFrom.diff(to, "milliseconds").milliseconds >= 0) {
|
|
45
|
+
breakpoints.push(to);
|
|
45
46
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
const intervalsOutput = [];
|
|
48
|
+
for (let i = 0; i < breakpoints.length - 1; i++) {
|
|
49
|
+
const current = breakpoints[i];
|
|
50
|
+
const next = breakpoints[i + 1];
|
|
51
|
+
intervalsOutput.push({ start: current.toJSDate(), end: next.toJSDate() });
|
|
52
|
+
}
|
|
53
|
+
return intervalsOutput;
|
|
54
|
+
};
|
|
55
|
+
WorkerHelper.generateSubTasksDefinitions = (from, to, maxDuration, taskType, updateOnDuplicate, refreshView) => {
|
|
56
|
+
const result = [];
|
|
57
|
+
const intervals = WorkerHelper.generateIntervals(from, to, maxDuration);
|
|
58
|
+
for (const item of intervals) {
|
|
59
|
+
helpers_1.log.silly(`generating task from:${item.start.toISOString()}, to:${item.end.toISOString()}`);
|
|
60
|
+
result.push(new AggregationTask_1.default(item.start, item.end, taskType, updateOnDuplicate, refreshView));
|
|
50
61
|
}
|
|
62
|
+
return result;
|
|
51
63
|
};
|
|
52
64
|
//# sourceMappingURL=WorkerHelper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkerHelper.js","sourceRoot":"","sources":["../../src/integration-engine/WorkerHelper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WorkerHelper.js","sourceRoot":"","sources":["../../src/integration-engine/WorkerHelper.ts"],"names":[],"mappings":";;;;;AAAA,2FAAuE;AACvE,2EAAoE;AACpE,2DAAyE;AACzE,4CAA8C;AAE9C,iFAAyD;AAEzD,MAAqB,YAAY;IACtB,MAAM,CAAC,YAAY,CAAC,OAAgB;;QACvC,MAAM,IAAI,GAAG,YAAY,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;QAEnE,IAAI,CAAC,IAAI;YAAE,OAAO,EAAqB,CAAC;QAExC,MAAM,IAAI,GAAS,yCAAoB,CAAC,M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C7E;IAED,OAAO,eAAe,CAAC;AAC3B,CAAC,CAAC;AAEY,wCAA2B,GAAG,CACxC,IAAc,EACd,EAAY,EACZ,WAAyB,EACzB,QAA6B,EAC7B,iBAA0B,EAC1B,WAAoB,EACH,EAAE;IACnB,MAAM,MAAM,GAAsB,EAAE,CAAC;IACrC,MAAM,SAAS,GAAG,YAAY,CAAC,iBAAiB,CAAC,IAAI,EAAE,EAAE,EAAE,WAAW,CAAC,CAAC;IACxE,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE;QAC1B,aAAG,CAAC,KAAK,CAAC,wBAAwB,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,QAAQ,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QAC5F,MAAM,CAAC,IAAI,CAAC,IAAI,yBAAe,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,iBAAiB,EAAE,WAAW,CAAC,CAAC,CAAC;KACpG;IAED,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC"}
|
|
@@ -5,7 +5,8 @@ export default class AggregationTask implements IAggregationTask {
|
|
|
5
5
|
to?: Date;
|
|
6
6
|
type?: AggregationTaskType;
|
|
7
7
|
updateOnDuplicate: boolean;
|
|
8
|
+
refreshView: boolean;
|
|
8
9
|
get fromUnixTimestamp(): Number | undefined;
|
|
9
10
|
get toUnixTimestamp(): Number | undefined;
|
|
10
|
-
constructor(from: Date, to: Date, type: AggregationTaskType, updateOnDuplicate?: boolean);
|
|
11
|
+
constructor(from: Date, to: Date, type: AggregationTaskType, updateOnDuplicate?: boolean, refreshView?: boolean);
|
|
11
12
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
class AggregationTask {
|
|
4
|
-
constructor(from, to, type, updateOnDuplicate) {
|
|
4
|
+
constructor(from, to, type, updateOnDuplicate, refreshView) {
|
|
5
5
|
this.from = from;
|
|
6
6
|
this.to = to;
|
|
7
7
|
this.type = type;
|
|
8
8
|
this.updateOnDuplicate = updateOnDuplicate || false;
|
|
9
|
+
this.refreshView = refreshView || false;
|
|
9
10
|
}
|
|
10
11
|
get fromUnixTimestamp() {
|
|
11
12
|
return this.from ? this.from.getTime() : undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AggregationTask.js","sourceRoot":"","sources":["../../../src/integration-engine/business/AggregationTask.ts"],"names":[],"mappings":";;AAGA,MAAqB,eAAe;
|
|
1
|
+
{"version":3,"file":"AggregationTask.js","sourceRoot":"","sources":["../../../src/integration-engine/business/AggregationTask.ts"],"names":[],"mappings":";;AAGA,MAAqB,eAAe;IAehC,YAAY,IAAU,EAAE,EAAQ,EAAE,IAAyB,EAAE,iBAA2B,EAAE,WAAqB;QAC3G,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,IAAI,KAAK,CAAC;QACpD,IAAI,CAAC,WAAW,GAAG,WAAW,IAAI,KAAK,CAAC;IAC5C,CAAC;IAdD,IAAW,iBAAiB;QACxB,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IACvD,CAAC;IAED,IAAW,eAAe;QACtB,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IACnD,CAAC;CASJ;AAtBD,kCAsBC"}
|
|
@@ -26,7 +26,7 @@ class EventsRepository extends integration_engine_1.PostgresModel {
|
|
|
26
26
|
});
|
|
27
27
|
this.refreshMaterializedView = (viewName) => __awaiter(this, void 0, void 0, function* () {
|
|
28
28
|
helpers_1.log.debug(`Refreshing materialized view: ${viewName}`);
|
|
29
|
-
const sql =
|
|
29
|
+
const sql = `REFRESH MATERIALIZED VIEW CONCURRENTLY ${PrahaDopravniInfo_1.default.SCHEMA}.${viewName}`;
|
|
30
30
|
yield this.query(sql);
|
|
31
31
|
});
|
|
32
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractEventsRepository.js","sourceRoot":"","sources":["../../../src/integration-engine/dataAccess/AbstractEventsRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,oHAAwE;AACxE,8EAA8E;AAC9E,2EAAoE;AAEpE,MAA8B,gBAAoB,SAAQ,kCAAa;IAAvE;;QAMW,kCAA6B,GAAG,GAAwB,EAAE;YAC7D,MAAM,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;QACxE,CAAC,CAAA,CAAC;QAEK,oCAA+B,GAAG,GAAwB,EAAE;YAC/D,MAAM,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;QAC1E,CAAC,CAAA,CAAC;QAEM,4BAAuB,GAAG,CAAO,QAAgB,EAAiB,EAAE;YACxE,aAAG,CAAC,KAAK,CAAC,iCAAiC,QAAQ,EAAE,CAAC,CAAC;YACvD,MAAM,GAAG,GAAG,
|
|
1
|
+
{"version":3,"file":"AbstractEventsRepository.js","sourceRoot":"","sources":["../../../src/integration-engine/dataAccess/AbstractEventsRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,oHAAwE;AACxE,8EAA8E;AAC9E,2EAAoE;AAEpE,MAA8B,gBAAoB,SAAQ,kCAAa;IAAvE;;QAMW,kCAA6B,GAAG,GAAwB,EAAE;YAC7D,MAAM,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;QACxE,CAAC,CAAA,CAAC;QAEK,oCAA+B,GAAG,GAAwB,EAAE;YAC/D,MAAM,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;QAC1E,CAAC,CAAA,CAAC;QAEM,4BAAuB,GAAG,CAAO,QAAgB,EAAiB,EAAE;YACxE,aAAG,CAAC,KAAK,CAAC,iCAAiC,QAAQ,EAAE,CAAC,CAAC;YACvD,MAAM,GAAG,GAAG,0CAA0C,2BAAiB,CAAC,MAAM,IAAI,QAAQ,EAAE,CAAC;YAE7F,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC1B,CAAC,CAAA,CAAC;IACN,CAAC;CAAA;AApBD,mCAoBC"}
|
|
@@ -4,9 +4,9 @@ import IAbstractAggregator from "./interfaces/IAbstractAggregator";
|
|
|
4
4
|
export default abstract class AbstractAggregator<T> implements IAbstractAggregator {
|
|
5
5
|
protected maxAggregationDuration: DurationLike;
|
|
6
6
|
protected abstract repository: AbstractEventsRepository<T>;
|
|
7
|
-
aggregateAndSave: (from: Date, to: Date, updateOnDuplicate: boolean) => Promise<void>;
|
|
7
|
+
aggregateAndSave: (from: Date, to: Date, updateOnDuplicate: boolean, refreshView: boolean) => Promise<void>;
|
|
8
8
|
getMaxDuration(): DurationLike;
|
|
9
9
|
refreshHistoricMaterialView: () => Promise<void>;
|
|
10
10
|
protected abstract aggregate(from: Date, to: Date): Promise<T[]>;
|
|
11
|
-
protected save: (data: T[], updateOnDuplicate: boolean) => Promise<void>;
|
|
11
|
+
protected save: (data: T[], updateOnDuplicate: boolean, refreshView: boolean) => Promise<void>;
|
|
12
12
|
}
|
|
@@ -13,18 +13,20 @@ const helpers_1 = require("@golemio/core/dist/integration-engine/helpers");
|
|
|
13
13
|
class AbstractAggregator {
|
|
14
14
|
constructor() {
|
|
15
15
|
this.maxAggregationDuration = { hours: 6 };
|
|
16
|
-
this.aggregateAndSave = (from, to, updateOnDuplicate) => __awaiter(this, void 0, void 0, function* () {
|
|
16
|
+
this.aggregateAndSave = (from, to, updateOnDuplicate, refreshView) => __awaiter(this, void 0, void 0, function* () {
|
|
17
17
|
const aggregationResult = yield this.aggregate(from, to);
|
|
18
18
|
helpers_1.log.debug(`Saving aggregate ${this.constructor.name} from: ${from.toISOString()} to: ${to.toISOString()} count: ${aggregationResult.length}`);
|
|
19
|
-
yield this.save(aggregationResult, updateOnDuplicate);
|
|
19
|
+
yield this.save(aggregationResult, updateOnDuplicate, refreshView);
|
|
20
20
|
});
|
|
21
21
|
this.refreshHistoricMaterialView = () => __awaiter(this, void 0, void 0, function* () {
|
|
22
22
|
yield this.repository.refreshHistoricMaterializedView();
|
|
23
23
|
});
|
|
24
|
-
this.save = (data, updateOnDuplicate) => __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
this.save = (data, updateOnDuplicate, refreshView) => __awaiter(this, void 0, void 0, function* () {
|
|
25
25
|
yield this.repository.validate(data);
|
|
26
26
|
yield this.repository.saveData(data, updateOnDuplicate);
|
|
27
|
-
|
|
27
|
+
if (refreshView) {
|
|
28
|
+
yield this.repository.refreshLatestMaterializedView();
|
|
29
|
+
}
|
|
28
30
|
});
|
|
29
31
|
}
|
|
30
32
|
getMaxDuration() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractAggregator.js","sourceRoot":"","sources":["../../../../src/integration-engine/service/aggregators/AbstractAggregator.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,2EAAoE;AAIpE,MAA8B,kBAAkB;IAAhD;QACc,2BAAsB,GAAiB,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;QAGvD,qBAAgB,GAAG,CAAO,IAAU,EAAE,EAAQ,EAAE,iBAA0B,EAAiB,EAAE;
|
|
1
|
+
{"version":3,"file":"AbstractAggregator.js","sourceRoot":"","sources":["../../../../src/integration-engine/service/aggregators/AbstractAggregator.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,2EAAoE;AAIpE,MAA8B,kBAAkB;IAAhD;QACc,2BAAsB,GAAiB,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;QAGvD,qBAAgB,GAAG,CAAO,IAAU,EAAE,EAAQ,EAAE,iBAA0B,EAAE,WAAoB,EAAiB,EAAE;YACtH,MAAM,iBAAiB,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YACzD,aAAG,CAAC,KAAK,CACL,oBAAoB,IAAI,CAAC,WAAW,CAAC,IAAI,UAAU,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,CAAC,WAAW,EAAE,WACzF,iBAAiB,CAAC,MACtB,EAAE,CACL,CAAC;YACF,MAAM,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,iBAAiB,EAAE,WAAW,CAAC,CAAC;QACvE,CAAC,CAAA,CAAC;QAMK,gCAA2B,GAAG,GAAS,EAAE;YAC5C,MAAM,IAAI,CAAC,UAAU,CAAC,+BAA+B,EAAE,CAAC;QAC5D,CAAC,CAAA,CAAC;QAIQ,SAAI,GAAG,CAAO,IAAS,EAAE,iBAA0B,EAAE,WAAoB,EAAiB,EAAE;YAClG,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACrC,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;YACxD,IAAI,WAAW,EAAE;gBACb,MAAM,IAAI,CAAC,UAAU,CAAC,6BAA6B,EAAE,CAAC;aACzD;QACL,CAAC,CAAA,CAAC;IACN,CAAC;IAjBU,cAAc;QACjB,OAAO,IAAI,CAAC,sBAAsB,CAAC;IACvC,CAAC;CAeJ;AA/BD,qCA+BC"}
|
|
@@ -2,7 +2,6 @@ import WazeJamsRepository from "../../dataAccess/WazeJamsRepository";
|
|
|
2
2
|
import WazeJams from "../../../schema-definitions/sequelize-models/WazeJams";
|
|
3
3
|
import AbstractAggregator from "./AbstractAggregator";
|
|
4
4
|
export default class WazeAggregator extends AbstractAggregator<WazeJams> {
|
|
5
|
-
protected sqlQueryScriptName: string;
|
|
6
5
|
protected repository: WazeJamsRepository;
|
|
7
6
|
constructor();
|
|
8
7
|
protected aggregate: (from: Date, to: Date) => Promise<WazeJams[]>;
|
|
@@ -19,7 +19,6 @@ const AbstractAggregator_1 = __importDefault(require("./AbstractAggregator"));
|
|
|
19
19
|
class WazeAggregator extends AbstractAggregator_1.default {
|
|
20
20
|
constructor() {
|
|
21
21
|
super();
|
|
22
|
-
this.sqlQueryScriptName = "WazeJamsAggregation.sql";
|
|
23
22
|
this.aggregate = (from, to) => __awaiter(this, void 0, void 0, function* () {
|
|
24
23
|
const result = yield AggregationRepository_1.default.getInstance().aggregationQuery(AggregationTaskType_1.AggregationTaskType.WAZEJ, {
|
|
25
24
|
from: from.getTime(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WazeJamsAggregator.js","sourceRoot":"","sources":["../../../../src/integration-engine/service/aggregators/WazeJamsAggregator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,mGAAyE;AACzE,6FAAmE;AACnE,iGAAuE;AAGvE,8EAAsD;AAEtD,MAAqB,cAAe,SAAQ,4BAA4B;
|
|
1
|
+
{"version":3,"file":"WazeJamsAggregator.js","sourceRoot":"","sources":["../../../../src/integration-engine/service/aggregators/WazeJamsAggregator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,mGAAyE;AACzE,6FAAmE;AACnE,iGAAuE;AAGvE,8EAAsD;AAEtD,MAAqB,cAAe,SAAQ,4BAA4B;IAGpE;QACI,KAAK,EAAE,CAAC;QAIF,cAAS,GAAG,CAAO,IAAU,EAAE,EAAQ,EAAuB,EAAE;YACtE,MAAM,MAAM,GAAG,MAAM,+BAAqB,CAAC,WAAW,EAAE,CAAC,gBAAgB,CAAY,yCAAmB,CAAC,KAAK,EAAE;gBAC5G,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE;gBACpB,EAAE,EAAE,EAAE,CAAC,OAAO,EAAE;aACnB,CAAC,CAAC;YAEH,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QACjC,CAAC,CAAA,CAAC;QAVE,IAAI,CAAC,UAAU,GAAG,IAAI,4BAAkB,EAAE,CAAC;IAC/C,CAAC;IAWS,QAAQ,CAAC,IAAW;QAC1B,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;YACxB,OAAO;gBACH,EAAE,EAAE,OAAO,CAAC,EAAE;gBACd,WAAW,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC;gBACjD,WAAW,EAAE,OAAO,CAAC,WAAW;gBAChC,eAAe,EAAE,OAAO,CAAC,eAAe;gBACxC,aAAa,EAAE,OAAO,CAAC,aAAa;gBACpC,UAAU,EAAE,OAAO,CAAC,UAAU;aACrB,CAAC;QAClB,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AA7BD,iCA6BC"}
|
|
@@ -2,7 +2,6 @@ import WazeReconstructionsRepository from "../../dataAccess/WazeReconstructionsR
|
|
|
2
2
|
import WazeReconstructions from "../../../schema-definitions/sequelize-models/WazeReconstructions";
|
|
3
3
|
import AbstractAggregator from "./AbstractAggregator";
|
|
4
4
|
export default class WazeReconstructionsAggregator extends AbstractAggregator<WazeReconstructions> {
|
|
5
|
-
protected sqlQueryScriptName: string;
|
|
6
5
|
protected repository: WazeReconstructionsRepository;
|
|
7
6
|
constructor();
|
|
8
7
|
protected aggregate: (from: Date, to: Date) => Promise<WazeReconstructions[]>;
|
|
@@ -19,7 +19,6 @@ const AbstractAggregator_1 = __importDefault(require("./AbstractAggregator"));
|
|
|
19
19
|
class WazeReconstructionsAggregator extends AbstractAggregator_1.default {
|
|
20
20
|
constructor() {
|
|
21
21
|
super();
|
|
22
|
-
this.sqlQueryScriptName = "WazeReconstructionsAggregation.sql";
|
|
23
22
|
this.aggregate = (from, to) => __awaiter(this, void 0, void 0, function* () {
|
|
24
23
|
const result = yield AggregationRepository_1.default.getInstance().aggregationQuery(AggregationTaskType_1.AggregationTaskType.WAZER, {
|
|
25
24
|
from: from.getTime(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WazeReconstructionsAggregator.js","sourceRoot":"","sources":["../../../../src/integration-engine/service/aggregators/WazeReconstructionsAggregator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,mGAAyE;AACzE,mHAAyF;AACzF,iGAAuE;AAGvE,8EAAsD;AAEtD,MAAqB,6BAA8B,SAAQ,4BAAuC;
|
|
1
|
+
{"version":3,"file":"WazeReconstructionsAggregator.js","sourceRoot":"","sources":["../../../../src/integration-engine/service/aggregators/WazeReconstructionsAggregator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,mGAAyE;AACzE,mHAAyF;AACzF,iGAAuE;AAGvE,8EAAsD;AAEtD,MAAqB,6BAA8B,SAAQ,4BAAuC;IAG9F;QACI,KAAK,EAAE,CAAC;QAIF,cAAS,GAAG,CAAO,IAAU,EAAE,EAAQ,EAAkC,EAAE;YACjF,MAAM,MAAM,GAAG,MAAM,+BAAqB,CAAC,WAAW,EAAE,CAAC,gBAAgB,CACrE,yCAAmB,CAAC,KAAK,EACzB;gBACI,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE;gBACpB,EAAE,EAAE,EAAE,CAAC,OAAO,EAAE;aACnB,CACJ,CAAC;YAEF,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QACjC,CAAC,CAAA,CAAC;QAbE,IAAI,CAAC,UAAU,GAAG,IAAI,uCAA6B,EAAE,CAAC;IAC1D,CAAC;IAcS,QAAQ,CAAC,IAAW;QAC1B,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;YACxB,OAAO;gBACH,EAAE,EAAE,OAAO,CAAC,EAAE;gBACd,WAAW,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC;gBACjD,WAAW,EAAE,OAAO,CAAC,WAAW;gBAChC,eAAe,EAAE,OAAO,CAAC,eAAe;gBACxC,UAAU,EAAE,OAAO,CAAC,UAAU;aACV,CAAC;QAC7B,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AA/BD,gDA+BC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DurationLike } from "@golemio/core/dist/shared/luxon";
|
|
2
2
|
export default interface IAbstractAggregator {
|
|
3
|
-
aggregateAndSave(from: Date, to: Date, updateOnDuplicate: boolean): Promise<void>;
|
|
3
|
+
aggregateAndSave(from: Date, to: Date, updateOnDuplicate: boolean, refreshView: boolean): Promise<void>;
|
|
4
4
|
getMaxDuration(): DurationLike;
|
|
5
5
|
refreshHistoricMaterialView(): Promise<void>;
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
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
|
-
|
|
2
|
+
"name": "@golemio/rush-hour-aggregation",
|
|
3
|
+
"version": "1.0.5-dev.620292234",
|
|
4
|
+
"description": "Rush hour data agregation for Praha dopravní project",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "rimraf ./dist && ttsc -p ./tsconfig.build.json",
|
|
9
|
+
"build-minimal": "run-s 'build --sourceMap false --declaration false'",
|
|
10
|
+
"build-watch": "run-s 'build --watch --preserveWatchOutput'",
|
|
11
|
+
"test": "cross-env NODE_ENV=test TS_NODE_COMPILER='ttypescript' mocha --exit --check-leaks --timeout 120000 -r ts-node/register -r dotenv/config 'test/**/*.test.ts'",
|
|
12
|
+
"test-debug": "run-s 'test --inspect-brk=9230'",
|
|
13
|
+
"code-coverage": "nyc run-s 'test -r source-map-support/register'",
|
|
14
|
+
"generate-docs": "typedoc --out docs/typedoc src",
|
|
15
|
+
"lint": "eslint \"{src,test}/**/*.ts\""
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"golemio"
|
|
19
|
+
],
|
|
20
|
+
"author": "Operator ICT, a.s.",
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "https://gitlab.com/operator-ict/golemio/code/modules/rush-hour-aggregation"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@commitlint/cli": "^11.0.0",
|
|
28
|
+
"@commitlint/config-conventional": "^11.0.0",
|
|
29
|
+
"@golemio/cli": "1.3.0",
|
|
30
|
+
"@golemio/core": "1.2.14",
|
|
31
|
+
"@golemio/eslint-config": "^1.1.0",
|
|
32
|
+
"@ovos-media/ts-transform-paths": "^1.7.18-1",
|
|
33
|
+
"@types/amqplib": "^0.5.17",
|
|
34
|
+
"@types/chai": "4.2.3",
|
|
35
|
+
"@types/chai-as-promised": "7.1.2",
|
|
36
|
+
"@types/geojson": "^7946.0.8",
|
|
37
|
+
"@types/mocha": "^9.1.0",
|
|
38
|
+
"@types/node": "^16.11.35",
|
|
39
|
+
"@types/sinon": "^9.0.10",
|
|
40
|
+
"chai": "4.2.0",
|
|
41
|
+
"chai-as-promised": "7.1.1",
|
|
42
|
+
"cross-env": "^7.0.3",
|
|
43
|
+
"dotenv": "^16.0.0",
|
|
44
|
+
"eslint": "^8.1.1",
|
|
45
|
+
"husky": "^7.0.4",
|
|
46
|
+
"mocha": "^9.1.2",
|
|
47
|
+
"npm-run-all": "^4.1.5",
|
|
48
|
+
"nyc": "^15.1.0",
|
|
49
|
+
"prettier": "^2.5.1",
|
|
50
|
+
"pretty-quick": "^3.1.3",
|
|
51
|
+
"rimraf": "^3.0.2",
|
|
52
|
+
"sinon": "^9.2.3",
|
|
53
|
+
"source-map-support": "0.5.19",
|
|
54
|
+
"ts-node": "^10.7.0",
|
|
55
|
+
"ttypescript": "^1.5.13",
|
|
56
|
+
"typedoc": "^0.22.15",
|
|
57
|
+
"typescript": "4.6.4"
|
|
58
|
+
},
|
|
59
|
+
"peerDependencies": {
|
|
60
|
+
"@golemio/core": "^1.0.0"
|
|
61
|
+
},
|
|
62
|
+
"dependencies": {}
|
|
63
63
|
}
|
|
@@ -13,7 +13,7 @@ select
|
|
|
13
13
|
) as properties
|
|
14
14
|
from
|
|
15
15
|
fcd.fcd_traff_params_part a
|
|
16
|
-
join
|
|
16
|
+
join fcd.fcd_geos_90 g on
|
|
17
17
|
a.source_identification::text = g.source_identification::text
|
|
18
18
|
where
|
|
19
19
|
a.measurement_or_calculation_time between $from and $to
|