proxy progress - I am getting tired :(
This commit is contained in:
parent
2fdbf01a5d
commit
badac39e87
|
@ -110,6 +110,7 @@ public class Backend implements Closeable {
|
|||
|
||||
new Thread(() -> {
|
||||
while (true) {
|
||||
logger.info(getApplicationsCount() + " applications, " + getControllersCount() + " controllers");
|
||||
runApplicationConnectionsCleanup();
|
||||
BinaryProtocol.sleep(applicationTimeout);
|
||||
}
|
||||
|
@ -129,7 +130,7 @@ public class Backend implements Closeable {
|
|||
if (System.currentTimeMillis() - controller.getStream().getStreamStats().getPreviousPacketArrivalTime() > 20 * SECOND) {
|
||||
if (controller.getTwoKindSemaphore().acquireForShortTermUsage()) {
|
||||
try {
|
||||
controller.grabOutputs();
|
||||
controller.grabOutputs(this);
|
||||
} finally {
|
||||
controller.getTwoKindSemaphore().releaseFromShortTermUsage();
|
||||
}
|
||||
|
@ -348,4 +349,9 @@ public class Backend implements Closeable {
|
|||
}
|
||||
}
|
||||
|
||||
public int getApplicationsCount() {
|
||||
synchronized (lock) {
|
||||
return applications.size();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -111,11 +111,12 @@ public class ControllerConnectionState {
|
|||
return sensorsHolder;
|
||||
}
|
||||
|
||||
public void grabOutputs() {
|
||||
public void grabOutputs(Backend backend) {
|
||||
try {
|
||||
getOutputs();
|
||||
} catch (IOException e) {
|
||||
close();
|
||||
// todo: this is currently not covered by a unit test
|
||||
backend.close(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,6 +37,8 @@ public class Monitoring {
|
|||
builder.add("sessions", Backend.totalSessions.get());
|
||||
builder.add("serverPortForApplications", backend.serverPortForApplications);
|
||||
builder.add("serverPortForControllers", backend.serverPortForControllers);
|
||||
builder.add("applicationsCount", backend.getApplicationsCount());
|
||||
builder.add("controllersCount", backend.getControllersCount());
|
||||
|
||||
return new RsJson(builder.build());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue