Skip to content

Commit

Permalink
Update some PerformanceMonitor limits
Browse files Browse the repository at this point in the history
  • Loading branch information
jouniso committed Apr 3, 2024
1 parent 746f5f1 commit 2c3f3bf
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public LotjuCameraStationMetadataClient(@Qualifier("kameraMetadataJaxb2Marshalle
super(kameraMetadataJaxb2Marshaller, lotjuMetadataProperties, lotjuMetadataProperties.getPath().camera);
}

@PerformanceMonitor(maxWarnExcecutionTime = 20000)
@Retryable(maxAttempts = 5)
public List<KameraVO> getKameras() {
final HaeKaikkiKamerat request = new HaeKaikkiKamerat();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public LotjuTmsStationMetadataClient(@Qualifier("lamMetadataJaxb2Marshaller")
super(lamMetadataJaxb2Marshaller, lotjuMetadataProperties, lotjuMetadataProperties.getPath().tms);
}

@PerformanceMonitor(maxWarnExcecutionTime = 10000)
@PerformanceMonitor(maxWarnExcecutionTime = 20000) // Normally takes around 10s
@Retryable(maxAttempts = 5)
@NotTransactionalServiceMethod
public List<LamAsemaVO> getLamAsemas() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public LotjuTmsStationMetadataClientWrapper(final LotjuTmsStationMetadataClient
this.lotjuTmsStationMetadataClient = lotjuTmsStationMetadataClient;
}

@PerformanceMonitor(maxWarnExcecutionTime = 20000) // Normally takes around 10s
public List<LamAsemaVO> getLamAsemas() {
return lotjuTmsStationMetadataClient.getLamAsemas();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public LotjuWeatherStationMetadataClient(@Qualifier("tiesaaMetadataJaxb2Marshall
super(tiesaaMetadataJaxb2Marshaller, lotjuMetadataProperties, lotjuMetadataProperties.getPath().weather);
}

@PerformanceMonitor(maxWarnExcecutionTime = 20000)
@PerformanceMonitor(maxWarnExcecutionTime = 30000) // Normally takes around 20s
@Retryable(maxAttempts = 5)
public List<TiesaaAsemaVO> getTiesaaAsemas() {
log.info("Fetching TiesaaAsemas from " + getDefaultUri());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public LotjuWeatherStationMetadataClientWrapper(final LotjuWeatherStationMetadat
this.lotjuWeatherStationClient = lotjuWeatherStationClient;
}

@PerformanceMonitor(maxWarnExcecutionTime = 20000)
@PerformanceMonitor(maxWarnExcecutionTime = 30000) // Normally takes around 20s
public List<TiesaaAsemaVO> getTiesaaAsemas() {
return lotjuWeatherStationClient.getTiesaaAsemas();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import fi.livi.digitraffic.common.annotation.PerformanceMonitor;
import fi.livi.digitraffic.tie.annotation.NotTransactionalServiceMethod;
import fi.livi.digitraffic.tie.dao.roadstation.RoadStationDao;
import fi.livi.digitraffic.tie.dao.roadstation.SensorValueDao;
Expand Down Expand Up @@ -268,6 +269,7 @@ private void updateDataMeasuredTime(final RoadStationType roadStationType, final
dataStatusService.updateDataUpdated(DataType.getSensorValueMeasuredDataType(roadStationType), maxMeasuredTime.toInstant());
}

@PerformanceMonitor(maxWarnExcecutionTime = 10000) // Normally takes around 7s
@Transactional
public int cleanWeatherHistoryData(final ZonedDateTime before) {
final StopWatch stopWatch = StopWatch.createStarted();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public boolean updateTmsStations() {
return false;
}

@PerformanceMonitor(maxWarnExcecutionTime = 10000)
@PerformanceMonitor(maxWarnExcecutionTime = 20000) // Fetching data takes normally around 10s and updating few seconds
public int updateTmsStationsStatuses() {
final List<LamAsemaVO> allLams = lotjuTmsStationMetadataClientWrapper.getLamAsemas();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public boolean updateWeatherStations() {
return updateWeatherStationsMetadata(tiesaaAsemas);
}

@PerformanceMonitor(maxWarnExcecutionTime = 10000)
@PerformanceMonitor(maxWarnExcecutionTime = 30000) // Normally takes around 20s to fetch data and few seconds to update
public int updateWeatherStationsStatuses() {
final List<TiesaaAsemaVO> allTiesaaAsemas = lotjuWeatherStationMetadataClientWrapper.getTiesaaAsemas();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import fi.livi.digitraffic.common.annotation.PerformanceMonitor;
import fi.livi.digitraffic.tie.dao.weather.forecast.ForecastSectionRepository;
import fi.livi.digitraffic.tie.dto.weather.forecast.ForecastSectionApiVersion;
import fi.livi.digitraffic.tie.dto.weather.forecast.client.ForecastSectionDataDto;
Expand Down Expand Up @@ -50,6 +51,7 @@ public ForecastSectionDataUpdater(final ForecastSectionClient forecastSectionCli
this.dataStatusService = dataStatusService;
}

@PerformanceMonitor(maxWarnExcecutionTime = 20000) // normally takes around 12s
@Transactional
public Instant updateForecastSectionWeatherData(final ForecastSectionApiVersion version) {
final ForecastSectionDataDto data = forecastSectionClient.getRoadConditions(version.getVersion());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public boolean updateCameras() {
return updatedCameras;
}

@PerformanceMonitor(maxWarnExcecutionTime = 50000, maxErrorExcecutionTime = 80000) // FIXME: DPO-2248 This is taking too long
@PerformanceMonitor(maxWarnExcecutionTime = 70000, maxErrorExcecutionTime = 100000) // FIXME: DPO-2248 This is taking too long
public int updateCameraStationsStatuses() {
log.info("method=updateCameraStationsStatuses start");
final List<KameraVO> kameras = lotjuCameraStationMetadataClientWrapper.getKameras();
Expand Down

0 comments on commit 2c3f3bf

Please sign in to comment.