/** * /api/v1/topology/:id/metrics -> metrics. */ @GET @Path("/topology/{id}/metrics") @AuthNimbusOp(value = "getTopology", needsTopoId = true) @Produces("application/json") public Response getTopologyMetrics(@PathParam("id") String id, @DefaultValue(":all-time") @QueryParam("window") String window, @QueryParam("sys") boolean sys, @QueryParam(callbackParameterName) String callback) throws TException { topologyMetricRequestMeter.mark(); String user = servletRequest.getRemoteUser(); try (NimbusClient nimbusClient = NimbusClient.getConfiguredClient(config)) { return UIHelpers.makeStandardResponse( UIHelpers.getTopologySummary( nimbusClient.getClient().getTopologyPageInfo(id, window, sys), window, config, user ), callback ); } }
/** * /api/v1/topology -> topo. */ @GET @Path("/topology/{id}") @AuthNimbusOp(value = "getTopology", needsTopoId = true) @Produces("application/json") public Response getTopology(@PathParam("id") String id, @DefaultValue(":all-time") @QueryParam("window") String window, @QueryParam("sys") boolean sys, @QueryParam(callbackParameterName) String callback) throws TException { topologyPageRequestMeter.mark(); try (NimbusClient nimbusClient = NimbusClient.getConfiguredClient(config)) { return UIHelpers.makeStandardResponse( UIHelpers.getTopologySummary( nimbusClient.getClient().getTopologyPageInfo(id, window, sys), window, config, servletRequest.getRemoteUser() ), callback ); } }
TopologyInfo info = client.getTopologyInfo(id); @SuppressWarnings("checkstyle:VariableDeclarationUsageDistance") TopologyPageInfo tpi = client.getTopologyPageInfo(id, ":all-time", false); uptime = Math.max(uptime, info.get_uptime_secs()); for (ExecutorSummary exec : info.get_executors()) {
String topologyId = topologySummary.get_id(); TopologyInfo info = client.getTopologyInfo(topologyId); TopologyPageInfo tpinfo = client.getTopologyPageInfo(topologyId, ":all-time", false); @SuppressWarnings("checkstyle:VariableDeclarationUsageDistance") StormTopology topo = client.getUserTopology(topologyId);