Class StreamIntrospectionD2Converter

java.lang.Object
org.nuxeo.ecm.core.bulk.introspection.StreamIntrospectionBaseConverter
org.nuxeo.ecm.core.bulk.introspection.StreamIntrospectionD2Converter

public class StreamIntrospectionD2Converter extends StreamIntrospectionBaseConverter
Converts stream introspection JSON data to D2 diagram format (https://d2lang.com/)
Since:
2025.10
  • Field Details

    • D2_HEADER_TEMPLATE

      protected static final String D2_HEADER_TEMPLATE
      See Also:
    • excludePatterns

      protected List<String> excludePatterns
    • excludeInactive

      protected boolean excludeInactive
  • Constructor Details

    • StreamIntrospectionD2Converter

      public StreamIntrospectionD2Converter(String json)
  • Method Details

    • getD2

      public String getD2()
    • getD2

      public String getD2(List<String> excludePatterns, boolean excludeInactive)
      Gets the D2 diagram format with filtering options.
      Parameters:
      excludePatterns - list of patterns to exclude (e.g., Arrays.asList("work/", "bulk/"))
      excludeInactive - whether to exclude inactive computations (computation-idle class) and empty streams (stream-empty class)
      Returns:
      the D2 diagram as a string
    • shouldExcludeByPattern

      protected boolean shouldExcludeByPattern(String name)
      Checks if a name (stream or computation) should be excluded based on patterns.
    • shouldExcludeByInactivity

      protected boolean shouldExcludeByInactivity(String name, String host, Map<String,String> metrics)
      Checks if a computation should be excluded based on inactivity filter.
    • shouldExcludeStreamByInactivity

      protected boolean shouldExcludeStreamByInactivity(String streamName, Map<String,String> metrics)
      Checks if a stream should be excluded based on inactivity filter.
    • dumpStream

      protected void dumpStream(StringBuilder ret, com.fasterxml.jackson.databind.JsonNode item, Map<String,String> metrics)
    • getComputationMetrics

      protected String getComputationMetrics(String host, String name, com.fasterxml.jackson.databind.JsonNode item, Map<String,String> metrics)
    • getTimerAsJson

      protected String getTimerAsJson(String title, String baseKey, Map<String,String> metrics)
    • getBatchInfo

      protected String getBatchInfo(com.fasterxml.jackson.databind.JsonNode item)
      Overrides:
      getBatchInfo in class StreamIntrospectionBaseConverter
    • getD2Identifier

      protected String getD2Identifier(String name)
    • collectComputationNames

      protected Set<String> collectComputationNames()
    • dumpComputationInGroup

      protected void dumpComputationInGroup(String host, StringBuilder ret, com.fasterxml.jackson.databind.JsonNode item, Map<String,String> metrics, String created)
    • getD2IdentifierForConnection

      protected String getD2IdentifierForConnection(String host, String id)