@Override public String call(HystrixUtilization hystrixUtilization) { return SerialHystrixUtilization.toJsonString(hystrixUtilization); } }), pausePollerThreadDelayInMs);
@Override public String call(HystrixRequestEvents requestEvents) { return SerialHystrixRequestEvents.toJsonString(requestEvents); } }), pausePollerThreadDelayInMs);
@Override public String call(HystrixConfiguration hystrixConfiguration) { return SerialHystrixConfiguration.toJsonString(hystrixConfiguration); } }), pausePollerThreadDelayInMs);
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); } }
final HystrixCommandKey key = entry.getKey(); final HystrixCommandConfiguration commandConfig = entry.getValue(); writeCommandConfigJson(json, key, commandConfig); final HystrixThreadPoolKey threadPoolKey = entry.getKey(); final HystrixThreadPoolConfiguration threadPoolConfig = entry.getValue(); writeThreadPoolConfigJson(json, threadPoolKey, threadPoolConfig); final HystrixCollapserKey collapserKey = entry.getKey(); final HystrixCollapserConfiguration collapserConfig = entry.getValue(); writeCollapserConfigJson(json, collapserKey, collapserConfig);
@Override public Observable<String> call(HystrixDashboardStream.DashboardData dashboardData) { return Observable.from(SerialHystrixDashboardData.toMultipleJsonStrings(dashboardData)); } }), pausePollerThreadDelayInMs);
private static void serializeUtilization(HystrixUtilization utilization, JsonGenerator json) { try { json.writeStartObject(); json.writeStringField("type", "HystrixUtilization"); json.writeObjectFieldStart("commands"); for (Map.Entry<HystrixCommandKey, HystrixCommandUtilization> entry: utilization.getCommandUtilizationMap().entrySet()) { final HystrixCommandKey key = entry.getKey(); final HystrixCommandUtilization commandUtilization = entry.getValue(); writeCommandUtilizationJson(json, key, commandUtilization); } json.writeEndObject(); json.writeObjectFieldStart("threadpools"); for (Map.Entry<HystrixThreadPoolKey, HystrixThreadPoolUtilization> entry: utilization.getThreadPoolUtilizationMap().entrySet()) { final HystrixThreadPoolKey threadPoolKey = entry.getKey(); final HystrixThreadPoolUtilization threadPoolUtilization = entry.getValue(); writeThreadPoolUtilizationJson(json, threadPoolKey, threadPoolUtilization); } json.writeEndObject(); json.writeEndObject(); 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(HystrixRequestEvents requestEvents) { StringWriter jsonString = new StringWriter(); try { JsonGenerator json = jsonFactory.createGenerator(jsonString); serializeRequestEvents(requestEvents, json); } catch (Exception e) { throw new RuntimeException(e); } return jsonString.getBuffer().toString(); }
public static String toJsonString(HystrixConfiguration config) { StringWriter jsonString = new StringWriter(); try { JsonGenerator json = jsonFactory.createGenerator(jsonString); serializeConfiguration(config, json); } catch (Exception e) { throw new RuntimeException(e); } return jsonString.getBuffer().toString(); }
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(HystrixUtilization utilization) { StringWriter jsonString = new StringWriter(); try { JsonGenerator json = jsonFactory.createGenerator(jsonString); serializeUtilization(utilization, json); } catch (Exception e) { throw new RuntimeException(e); } return jsonString.getBuffer().toString(); }
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; }
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); } }
private static void serializeRequestEvents(HystrixRequestEvents requestEvents, JsonGenerator json) { try { json.writeStartArray(); for (Map.Entry<HystrixRequestEvents.ExecutionSignature, List<Integer>> entry: requestEvents.getExecutionsMappedToLatencies().entrySet()) { convertExecutionToJson(json, entry.getKey(), entry.getValue()); } json.writeEndArray(); json.close(); } catch (Exception e) { throw new RuntimeException(e); } }
@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); }
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() {
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>() {