Interface ResultNameStrategy

All Known Implementing Classes:
JConsoleResultNameStrategyImpl, ResultNameStrategyImpl

public interface ResultNameStrategy
Build a QueryResult.name from a collected metric (Query). Build name must be escaped to be compatible with all OutputWriter. The approach is to escape non alpha-numeric chars. Expressions support '#' based keywords (e.g. #hostname#) and with '%' based variables mapped to objectname properties. Supported '#' based 'functions':
Function Description Sample
#hostname# localhost - hostname InetAddress.getHostName()
#reversed_hostname# reversed localhost - hostname InetAddress.getHostName()
#escaped_hostname# localhost - hostname InetAddress.getHostName() with '.' replaced by '_'
#canonical_hostname# localhost - canonical hostname InetAddress.getCanonicalHostName() server1.ecommerce.mycompany.com
#reversed_canonical_hostname# reversed localhost - canonical hostname InetAddress.getCanonicalHostName() com.mycompany.ecommerce.server1
#escaped_canonical_hostname# localhost - canonical hostname InetAddress.getCanonicalHostName() with '.' replaced by '_' server1_ecommerce_mycompany_com
#hostaddress# localhost - hostaddress InetAddress.getHostAddress()
#escaped_hostname# localhost - hostaddress InetAddress.getHostAddress() with '.' replaced by '_'
Author:
Cyrille Le Clerc
  • Method Summary

    Modifier and Type Method Description
    java.lang.String getResultName​(Query query, javax.management.ObjectName objectName, java.lang.String attribute, java.lang.String compositeDataKey, java.lang.Integer position)  
    void postConstruct​(java.util.Map<java.lang.String,​java.lang.String> settings)  
  • Method Details

    • getResultName

      @Nonnull java.lang.String getResultName​(@Nonnull Query query, @Nonnull javax.management.ObjectName objectName, @Nullable java.lang.String attribute, @Nullable java.lang.String compositeDataKey, @Nullable java.lang.Integer position)
    • postConstruct

      void postConstruct​(@Nonnull java.util.Map<java.lang.String,​java.lang.String> settings)