@Override public Observable<String> call(HystrixDashboardStream.DashboardData dashboardData) { return Observable.from(SerialHystrixDashboardData.toMultipleJsonStrings(dashboardData)); } }), pausePollerThreadDelayInMs);
public static List<String> toMultipleJsonStrings(HystrixDashboardStream.DashboardData dashboardData) { List<String> jsonStrings = new ArrayList<String>(); for (HystrixCommandMetrics commandMetrics : dashboardData.getCommandMetrics()) { jsonStrings.add(toJsonString(commandMetrics)); } for (HystrixThreadPoolMetrics threadPoolMetrics : dashboardData.getThreadPoolMetrics()) { jsonStrings.add(toJsonString(threadPoolMetrics)); } for (HystrixCollapserMetrics collapserMetrics : dashboardData.getCollapserMetrics()) { jsonStrings.add(toJsonString(collapserMetrics)); } return jsonStrings; }
private static void writeDashboardData(JsonGenerator json, HystrixDashboardStream.DashboardData dashboardData) { try { json.writeStartArray(); for (HystrixCommandMetrics commandMetrics : dashboardData.getCommandMetrics()) { writeCommandMetrics(commandMetrics, json); } for (HystrixThreadPoolMetrics threadPoolMetrics : dashboardData.getThreadPoolMetrics()) { writeThreadPoolMetrics(threadPoolMetrics, json); } for (HystrixCollapserMetrics collapserMetrics : dashboardData.getCollapserMetrics()) { writeCollapserMetrics(collapserMetrics, json); } json.writeEndArray(); json.close(); } catch (Exception e) { throw new RuntimeException(e); } }
json.writeNumberField("currentQueueSize", threadPoolMetrics.getCurrentQueueSize().intValue()); json.writeNumberField("currentTaskCount", threadPoolMetrics.getCurrentTaskCount().longValue()); safelyWriteNumberField(json, "rollingCountThreadsExecuted", new Func0<Long>() { @Override public Long call() { safelyWriteNumberField(json, "rollingCountCommandRejections", new Func0<Long>() { @Override public Long call() {
public static String toJsonString(HystrixDashboardStream.DashboardData dashboardData) { StringWriter jsonString = new StringWriter(); try { JsonGenerator json = jsonFactory.createGenerator(jsonString); writeDashboardData(json, dashboardData); } catch (Exception e) { throw new RuntimeException(e); } return jsonString.getBuffer().toString(); }
public static String toJsonString(HystrixCommandMetrics commandMetrics) { StringWriter jsonString = new StringWriter(); try { JsonGenerator json = jsonFactory.createGenerator(jsonString); writeCommandMetrics(commandMetrics, json); json.close(); return jsonString.getBuffer().toString(); } catch (IOException ioe) { throw new RuntimeException(ioe); } }
public static String toJsonString(HystrixThreadPoolMetrics threadPoolMetrics) { StringWriter jsonString = new StringWriter(); try { JsonGenerator json = jsonFactory.createGenerator(jsonString); writeThreadPoolMetrics(threadPoolMetrics, json); json.close(); return jsonString.getBuffer().toString(); } catch (IOException ioe) { throw new RuntimeException(ioe); } }
public static String toJsonString(HystrixCollapserMetrics collapserMetrics) { StringWriter jsonString = new StringWriter(); try { JsonGenerator json = jsonFactory.createGenerator(jsonString); writeCollapserMetrics(collapserMetrics, json); json.close(); return jsonString.getBuffer().toString(); } catch (IOException ioe) { throw new RuntimeException(ioe); } }
json.writeNumberField("currentTime", System.currentTimeMillis()); safelyWriteNumberField(json, "rollingCountRequestsBatched", new Func0<Long>() { @Override public Long call() { safelyWriteNumberField(json, "rollingCountBatches", new Func0<Long>() { @Override public Long call() { safelyWriteNumberField(json, "rollingCountResponsesFromCache", new Func0<Long>() { @Override public Long call() {
@Bean @ConditionalOnEnabledEndpoint public HystrixWebfluxEndpoint hystrixWebfluxController() { Observable<String> serializedDashboardData = HystrixDashboardStream.getInstance().observe() .concatMap(dashboardData -> Observable.from(SerialHystrixDashboardData.toMultipleJsonStrings(dashboardData))); Publisher<String> publisher = RxReactiveStreams.toPublisher(serializedDashboardData); return new HystrixWebfluxEndpoint(publisher); }
safelyWriteNumberField(json, "rollingCountBadRequests", new Func0<Long>() { @Override public Long call() { safelyWriteNumberField(json, "rollingCountCollapsedRequests", new Func0<Long>() { @Override public Long call() { safelyWriteNumberField(json, "rollingCountEmit", new Func0<Long>() { @Override public Long call() { safelyWriteNumberField(json, "rollingCountExceptionsThrown", new Func0<Long>() { @Override public Long call() { safelyWriteNumberField(json, "rollingCountFailure", new Func0<Long>() { @Override public Long call() { safelyWriteNumberField(json, "rollingCountFallbackEmit", new Func0<Long>() { @Override public Long call() { safelyWriteNumberField(json, "rollingCountFallbackFailure", new Func0<Long>() { @Override public Long call() { safelyWriteNumberField(json, "rollingCountFallbackMissing", new Func0<Long>() {