private void registerResources(final JerseyEnvironment environment) { environment.register(new AggregateTickerResource()); environment.register(new ExchangeResource()); environment.register(new ExchangesResource()); environment.register(new AssetsResource()); environment.register(new MarketsResource()); environment.register(DeploymentResource.getResource()); }
private void registerHealthChecks(final Environment environment) throws MalformedURLException, IOException { final String baseApiUrl = "http://" + HostUtils.getWanIp() + ":" + MarketstemConfiguration.PORT + "/api/"; final RunscopeClient runscope = RunscopeClients.MARKETSTEM.create(t -> t.query("URL", baseApiUrl)); final RateLimiter runTestsRateLimiter = RateLimiter.create(1 / (double) Duration.ofHours(6).getSeconds()); environment .healthChecks() .register( "runscope", RunscopeHealthCheck.startBuilding(runscope, runTestsRateLimiter).build()); environment.healthChecks().register("deployment", DeploymentResource.getResource()); environment.healthChecks().register("ignoreNewRelic", new IgnoreNewRelicHealthCheck()); }