diff --git a/src/main/kotlin/cambio/monitoring/mosim/api/SearchRunningService.kt b/src/main/kotlin/cambio/monitoring/mosim/api/SearchRunningService.kt index fdd8ddc..5571243 100644 --- a/src/main/kotlin/cambio/monitoring/mosim/api/SearchRunningService.kt +++ b/src/main/kotlin/cambio/monitoring/mosim/api/SearchRunningService.kt @@ -18,7 +18,7 @@ import org.springframework.stereotype.Service @Service class SearchRunningService { - fun runSearch(inputFiles: Multimap, id: String) { + fun runSearch(inputFiles: Multimap, id: String, searchWindowSize: Double) { val monitoringDataPathCollection = inputFiles["monitoring-data"] val mtlPathCollection = inputFiles["mtl"] if (monitoringDataPathCollection.isEmpty()) { @@ -29,7 +29,7 @@ class SearchRunningService { val mtlPath = mtlPathCollection.iterator().next() val monitoringDataPath = monitoringDataPathCollection.iterator().next() - val config = SearchConfiguration(id = id) + val config = SearchConfiguration(id = id, searchWindowSize = searchWindowSize) val orchestrator = StimuliSearchOrchestrator( DefaultMetricsAnalyzer(), diff --git a/src/main/kotlin/cambio/monitoring/mosim/api/SimulationRunningController.kt b/src/main/kotlin/cambio/monitoring/mosim/api/SimulationRunningController.kt index 05d586e..196b7af 100644 --- a/src/main/kotlin/cambio/monitoring/mosim/api/SimulationRunningController.kt +++ b/src/main/kotlin/cambio/monitoring/mosim/api/SimulationRunningController.kt @@ -28,16 +28,17 @@ class SimulationRunningController @Autowired constructor(private var simulationR fun handleMultipleFilesUpload( @RequestParam("mtls") mtls: Array, @RequestParam("monitoring_data") monitoringData: Array, - @RequestParam("simulation_id") id: String + @RequestParam("simulation_id") id: String, + @RequestParam("search_window_size") searchWindowSize: Double ): ResponseEntity { - return runSearch(mtls, monitoringData, id) + return runSearch(mtls, monitoringData, id, searchWindowSize) } // TODO: Handle this call in a non-blocking manner, taking into account that this implementation is not // client friendly as it can time-out the request due to the long processing time. @Throws(IOException::class) private fun runSearch( - mtls: Array, monitoringData: Array, id: String + mtls: Array, monitoringData: Array, id: String, searchWindowSize: Double ): ResponseEntity { return try { if (TempFileUtils.existsSimulationId(id)) { @@ -52,7 +53,7 @@ class SimulationRunningController @Autowired constructor(private var simulationR prepareOutputFolder(id) val savedFiles = prepareFiles(mtls, monitoringData, tmpFolder) - simulationRunningService.runSearch(savedFiles, id) + simulationRunningService.runSearch(savedFiles, id, searchWindowSize) if (!TempFileUtils.existsSimulationId(id)) { return ResponseEntity( String.format(