org.nustaq.utils.TrafficMonitorUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kontraktor-http Show documentation
Show all versions of kontraktor-http Show documentation
http connectivity for kontraktor
package org.nustaq.utils;
import org.nustaq.kontraktor.remoting.base.TrafficMonitor;
public class TrafficMonitorUtil {
public final static String IN = "in";
public final static String OUT = "out";
public static void monitorTraffic(TrafficMonitor trafficMonitor, String sid, String direction, String path, int length) {
if( trafficMonitor == null ) {
return;
}
switch (direction) {
case IN:
trafficMonitor.requestReceived(length, sid, path);
break;
case OUT:
trafficMonitor.responseSend(length, sid, path);
break;
default:
throw new IllegalArgumentException("direction must be 'in' or 'out'");
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy