From 9c3a64b0d0c7707ebcb8e380a337a3b1453b944c Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Sat, 22 Apr 2023 12:58:12 +0400 Subject: [PATCH] #91 -- Fix smoothing --- .../ru/ulstu/extractor/ts/service/TimeSeriesService.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/ru/ulstu/extractor/ts/service/TimeSeriesService.java b/src/main/java/ru/ulstu/extractor/ts/service/TimeSeriesService.java index 038a3c0..2279b0d 100644 --- a/src/main/java/ru/ulstu/extractor/ts/service/TimeSeriesService.java +++ b/src/main/java/ru/ulstu/extractor/ts/service/TimeSeriesService.java @@ -8,7 +8,6 @@ import org.springframework.stereotype.Service; import ru.ulstu.extractor.branch.model.Branch; import ru.ulstu.extractor.http.HttpService; import ru.ulstu.extractor.http.JsonTimeSeries; -import ru.ulstu.extractor.http.SmoothingTimeSeries; import ru.ulstu.extractor.ts.model.TimeSeries; import ru.ulstu.extractor.ts.model.TimeSeriesType; import ru.ulstu.extractor.ts.model.TimeSeriesValue; @@ -35,7 +34,7 @@ public class TimeSeriesService { private final TimeSeriesDateMapper.TimeSeriesInterval timeSeriesInterval = TimeSeriesDateMapper.TimeSeriesInterval.HOUR; private final HttpService httpService; private final static String TIME_SERIES_SAVE_SERVICE_URL = "http://time-series.athene.tech/api/1.0/add-time-series?setKey=git-extractor"; - private final static String TIME_SERIES_TENDENCY_URL = "http://time-series.athene.tech/api/1.0/getSpecificMethodSmoothed"; + private final static String TIME_SERIES_TENDENCY_URL = "http://time-series.athene.tech/api/1.0/getMaxSmoothing"; private final static String TIME_SERIES_GROUPED_TENDENCIES_URL = "http://time-series.athene.tech/api/1.0/getGroupedTendencies"; public TimeSeriesService(TimeSeriesRepository timeSeriesRepository, @@ -127,7 +126,7 @@ public class TimeSeriesService { public double getLastTimeSeriesTendency(TimeSeries ts) { if (ts != null && ts.getValues().size() > MIN_TIME_SERIES_LENGTH) { - JSONObject response = httpService.post(TIME_SERIES_TENDENCY_URL, new JSONObject(new SmoothingTimeSeries(normalizeTimeSeries(ts)))); + JSONObject response = httpService.post(TIME_SERIES_TENDENCY_URL, new JSONObject(new JsonTimeSeries(normalizeTimeSeries(ts)))); LOG.debug("Успешно отправлен на сервис сглаживания"); if (response.has("response") && response.getString("response").equals("empty")) { return DEFAULT_TIME_SERIES_TENDENCY;