change metric save interval
Some checks failed
Deploy App / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Has been cancelled
Some checks failed
Deploy App / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Has been cancelled
This commit is contained in:
parent
05d0aa500c
commit
6cea5a1f29
@ -25,12 +25,7 @@ public class MetricService {
|
||||
/**
|
||||
* The interval in which the metrics are saved.
|
||||
*/
|
||||
private final long saveInterval = TimeUnit.MINUTES.toMillis(1);
|
||||
|
||||
/**
|
||||
* The interval in which the metrics are written to InfluxDB.
|
||||
*/
|
||||
private final long writeInfluxInterval = TimeUnit.SECONDS.toMillis(30);
|
||||
private final long saveInterval = TimeUnit.SECONDS.toMillis(15);
|
||||
|
||||
private final WriteApiBlocking influxWriteApi;
|
||||
private final MetricsRepository metricsRepository;
|
||||
@ -49,8 +44,10 @@ public class MetricService {
|
||||
// Load the metrics from Redis
|
||||
loadMetrics();
|
||||
|
||||
Timer.scheduleRepeating(this::saveMetrics, saveInterval, saveInterval);
|
||||
Timer.scheduleRepeating(this::writeToInflux, writeInfluxInterval, writeInfluxInterval);
|
||||
Timer.scheduleRepeating(() -> {
|
||||
saveMetrics();
|
||||
writeToInflux();
|
||||
}, saveInterval, saveInterval);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user