Commit e8ad448d authored by Jonathan Haas's avatar Jonathan Haas

Merge branch 'bugfix/debug-timer' into 'develop'

Die periodische Debug-Ausgabe wird zur besseren Vergleichbarkeit nun wieder am…

See merge request ERZ/SWE_de.bsvrz.ars.ars!13
parents f9d66fcc 489b20d9
......@@ -39,6 +39,8 @@ import de.bsvrz.dav.daf.main.*;
import de.bsvrz.dav.daf.main.archive.ArchiveData;
import de.bsvrz.dav.daf.main.archive.ArchiveQueryPriority;
import de.bsvrz.dav.daf.main.config.SystemObject;
import de.bsvrz.dav.daf.util.cron.CronDefinition;
import de.bsvrz.dav.daf.util.cron.CronScheduler;
import de.bsvrz.sys.funclib.dataSerializer.Deserializer;
import de.bsvrz.sys.funclib.dataSerializer.NoSuchVersionException;
import de.bsvrz.sys.funclib.dataSerializer.SerializingFactory;
......@@ -57,10 +59,7 @@ import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.*;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.locks.LockSupport;
......@@ -652,7 +651,7 @@ public final class InQueuesMgr {
}
// Keine weiteren Ausgaben
archiveDataReceiver._statisticsTimer.cancel();
archiveDataReceiver._cronScheduler.shutdownNow();
Thread.sleep(100);
int debugCounter = 0;
......@@ -1303,8 +1302,6 @@ public final class InQueuesMgr {
/** max. Archivzeitsprung vorwärts (siehe TAnfArS 5.1.2.4.3.3) */
private long tMaxATimeForwardStep = 3600 * 1000; // Defaultwert 1 Stunde gemäß DatK
private static final long STATISTIC_PRINT_TIME_INTERVAL = 60000;
private volatile long _statisticLastTotalReceivedDataSetCount = 0;
private volatile long _statisticLastTotalQueuedDataSetCount = 0;
......@@ -1320,17 +1317,16 @@ public final class InQueuesMgr {
private volatile long _statisticLastTotalFailedDataSetCountRequested = 0;
private long[] _statisticLastCacheCounts = {0, 0, 0, 0};
private final Timer _statisticsTimer = new Timer("Statistics", true);
private CronScheduler _cronScheduler;
public ArchiveDataReceiver() {
logger.info("Ausgabe statistischer Informationen alle " + STATISTIC_PRINT_TIME_INTERVAL + " ms");
_statisticsTimer.schedule(new TimerTask() {
@Override
public void run() {
printStatistics();
}
}, STATISTIC_PRINT_TIME_INTERVAL, STATISTIC_PRINT_TIME_INTERVAL);
_cronScheduler = new CronScheduler(1, r -> {
Thread statistics = new Thread(r, "Statistics");
statistics.setDaemon(true);
return statistics;
});
_cronScheduler.schedule(this::printStatistics, CronDefinition.EVERY_MINUTE);
}
@Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment