Skip to content

Commit

Permalink
Track Enclave API metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-j-h committed May 12, 2019
1 parent e19e49a commit bd4d42d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import com.quorum.tessera.server.monitoring.InfluxDbClient;
import com.quorum.tessera.server.monitoring.InfluxDbPublisher;
import com.quorum.tessera.server.monitoring.MetricsResource;
import com.quorum.tessera.server.monitoring.MonitoringNotSupportedException;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.glassfish.jersey.server.ResourceConfig;
Expand Down Expand Up @@ -109,10 +108,6 @@ public void start() throws Exception {
}

private void startInfluxMonitoring() {
if(!supportsMonitoring(type)) {
throw new MonitoringNotSupportedException(type);
}

InfluxDbClient influxDbClient = new InfluxDbClient(uri, influxConfig, type);
Runnable publisher = new InfluxDbPublisher(influxDbClient);

Expand All @@ -129,13 +124,6 @@ private void startInfluxMonitoring() {
this.executor.scheduleWithFixedDelay(exceptionSafePublisher, delayInSecs, delayInSecs, TimeUnit.SECONDS);
}

private boolean supportsMonitoring(AppType appType) {
return AppType.P2P.equals(appType) ||
AppType.Q2T.equals(appType) ||
AppType.ADMIN.equals(appType) ||
AppType.THIRD_PARTY.equals(appType);
}

@Override
public void stop() {
LOGGER.info("Stopping Jersey server at {}", uri);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ private Set<ObjectName> getTesseraResourceMBeanNames(AppType appType) throws Mal
case THIRD_PARTY:
type = "ThirdPartyRestApp";
break;
case ENCLAVE:
type = "EnclaveApplication";
break;
default:
throw new MonitoringNotSupportedException(appType);
}
Expand Down

0 comments on commit bd4d42d

Please sign in to comment.