Search in sources :

Example 11 with PingStats

use of com.inceptai.dobby.model.PingStats in project dobby-android by InceptAi.

the class FakePingAnalyzer method scheduleGatewayDownloadLatencyTest.

@Override
protected ListenableFuture<PingStats> scheduleGatewayDownloadLatencyTest(int maxAgeToRetriggerTest) throws IllegalStateException {
    fakeGatewayDownloadTestFuture = dobbyThreadpool.getListeningScheduledExecutorService().schedule(new Callable<PingStats>() {

        @Override
        public PingStats call() {
            PingStats pingStats = generateFakeGatewayStats();
            gatewayDownloadLatencyTestStats = pingStats;
            DobbyLog.v("FAKE GW server latency is : " + gatewayDownloadLatencyTestStats.toString());
            return pingStats;
        }
    }, PING_LATENCY_MS, TimeUnit.MILLISECONDS);
    return fakeGatewayDownloadTestFuture;
}
Also used : PingStats(com.inceptai.dobby.model.PingStats) Callable(java.util.concurrent.Callable)

Example 12 with PingStats

use of com.inceptai.dobby.model.PingStats in project dobby-android by InceptAi.

the class FakePingAnalyzer method initializePingStats.

private void initializePingStats(IPLayerInfo ipLayerInfo) {
    ipLayerPingStats.put(ipLayerInfo.gateway, new PingStats(ipLayerInfo.gateway));
    ipLayerPingStats.put(ipLayerInfo.dns1, new PingStats(ipLayerInfo.dns1));
    ipLayerPingStats.put(ipLayerInfo.dns2, new PingStats(ipLayerInfo.dns2));
    ipLayerPingStats.put(ipLayerInfo.referenceExternalAddress1, new PingStats(ipLayerInfo.referenceExternalAddress1));
    ipLayerPingStats.put(ipLayerInfo.referenceExternalAddress2, new PingStats(ipLayerInfo.referenceExternalAddress2));
    ipLayerPingStats.put(ipLayerInfo.publicDns1, new PingStats(ipLayerInfo.publicDns1));
    ipLayerPingStats.put(ipLayerInfo.publicDns2, new PingStats(ipLayerInfo.publicDns2));
}
Also used : PingStats(com.inceptai.dobby.model.PingStats)

Aggregations

PingStats (com.inceptai.dobby.model.PingStats)12 HashMap (java.util.HashMap)3 ArrayList (java.util.ArrayList)2 Callable (java.util.concurrent.Callable)2 DobbyEvent (com.inceptai.dobby.eventbus.DobbyEvent)1 Utils (com.inceptai.dobby.utils.Utils)1 IOException (java.io.IOException)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 Matcher (java.util.regex.Matcher)1 Pattern (java.util.regex.Pattern)1