From 141282f2412833a09425703f7cad2a7a696ed9db Mon Sep 17 00:00:00 2001 From: rozetko Date: Wed, 18 Jul 2018 20:30:03 +0300 Subject: [PATCH] Basic creation of analytic unit fails #79 (#86) * Fix * Convert to int --- analytics/detectors/general_detector.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/analytics/detectors/general_detector.py b/analytics/detectors/general_detector.py index 10caea1..2e382bc 100644 --- a/analytics/detectors/general_detector.py +++ b/analytics/detectors/general_detector.py @@ -7,6 +7,7 @@ import config import os.path import json +NANOSECONDS_IN_MS = 1000000 logger = logging.getLogger('analytic_toolset') @@ -91,8 +92,7 @@ class GeneralDetector: start_index = self.data_prov.get_upper_bound(last_prediction_time) stop_index = self.data_prov.size() - - last_prediction_time = int(last_prediction_time.timestamp() * 1000) + last_prediction_time = int(last_prediction_time.value / NANOSECONDS_IN_MS) predicted_anomalies = [] if start_index < stop_index: