|
|
@ -28,6 +28,8 @@ let alertService: AlertService = undefined; |
|
|
|
let grafanaAvailableWebhok: Function = undefined; |
|
|
|
let grafanaAvailableWebhok: Function = undefined; |
|
|
|
let dataPuller: DataPuller; |
|
|
|
let dataPuller: DataPuller; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let detectionsCount: number = 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function onTaskResult(taskResult: TaskResult) { |
|
|
|
function onTaskResult(taskResult: TaskResult) { |
|
|
|
let id = taskResult._id; |
|
|
|
let id = taskResult._id; |
|
|
@ -47,6 +49,7 @@ function onTaskResult(taskResult: TaskResult) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async function onDetect(detectionResult: DetectionResult) { |
|
|
|
async function onDetect(detectionResult: DetectionResult) { |
|
|
|
|
|
|
|
detectionsCount++; |
|
|
|
let id = detectionResult.analyticUnitId; |
|
|
|
let id = detectionResult.analyticUnitId; |
|
|
|
let payload = await processDetectionResult(id, detectionResult); |
|
|
|
let payload = await processDetectionResult(id, detectionResult); |
|
|
|
await Promise.all([ |
|
|
|
await Promise.all([ |
|
|
@ -365,6 +368,10 @@ export function getTaskResolversLength(): number { |
|
|
|
return taskResolvers.size; |
|
|
|
return taskResolvers.size; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export function getDetectionsCount(): number { |
|
|
|
|
|
|
|
return detectionsCount; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export function isAnalyticReady(): boolean { |
|
|
|
export function isAnalyticReady(): boolean { |
|
|
|
return analyticsService.ready; |
|
|
|
return analyticsService.ready; |
|
|
|
} |
|
|
|
} |
|
|
|