Class FcDashboardJson

java.lang.Object
org.frontcache.resilience.stream.FcDashboardJson

public class FcDashboardJson extends Object
Serializes FcCommandMetrics and FcThreadPools into the Hystrix dashboard's JSON, replacing SerialHystrixDashboardData. This is the compatibility contract of the whole migration, and the reason it is hand-written rather than adapted from a metrics library: the consumer is vendored JavaScript whose validateData() throws on the first missing field, blanking the panel with a console error and no server-side symptom. The field names, their types and the percentile map's shape are frozen by dashboard-json-keys.txt and asserted by FcDashboardJsonTest - 48 keys on a command frame and 18 on a thread-pool frame, which is the full set Hystrix emitted, not just the 36 and 16 the dashboard happens to assert. An external Turbine or a custom dashboard may read the rest. Written by hand with a StringBuilder rather than through Jackson for one reason: field ORDER is stable and reviewable this way, which makes a diff of an old and a new frame readable during the cut-over. See proposal sections 7.1-7.3.
  • Method Details

    • frames

      public static List<String> frames()
      One frame per command plus one per thread pool. Thread-pool frames are NOT filtered by anything. A pool is a node-level resource shared by every THREAD-isolated command, so there is no per-domain answer to give - the old code compared the pool name against the caller's domain, which is false for every domain that can exist, which is why the console's thread-pool panel has never rendered. Proposal section 6.6, defect 1.
    • commandFrame

      public static String commandFrame(FcCommandMetrics metrics)
    • threadPoolFrame

      public static String threadPoolFrame(String poolKey, ThreadPoolExecutor pool)