Class MetricConfig


  • public class MetricConfig
    extends Object
    • Method Detail

      • parseConfig

        public static MetricConfig parseConfig​(String baseConfig,
                                               String overridesConfig)
        Parses config files to generate new MetricConfig object
        Parameters:
        baseConfig - Base config to be found in the classpath
        overridesConfig - Override config
        Returns:
        MetricConfig object
      • toEnvVarName

        protected static String toEnvVarName​(String propName)
      • applyEnvironmentVariables

        protected static com.typesafe.config.Config applyEnvironmentVariables​(com.typesafe.config.Config config)
      • runPostConfigInit

        public void runPostConfigInit()
      • getMetricNameForKey

        public String getMetricNameForKey​(ArgKey key)
      • setProperties

        public void setProperties​(Properties properties)
      • isDisabled

        public boolean isDisabled​(ArgKey argKey)
      • getTagsForKey

        public Map<String,​String> getTagsForKey​(ArgKey argKey)
        Returns a map of tags that you can modify
        Parameters:
        argKey - ArgKey used to find tags
        Returns:
        Map of tags and values.
      • getPropsForKey

        public Map<String,​String> getPropsForKey​(ArgKey argKey)
        returns immutable map of properties for the specified key context
        Parameters:
        argKey - ArgKey used to find tags
        Returns:
        Map of properties
      • isDumpMetrics

        public boolean isDumpMetrics()
      • addDumpSource

        public void addDumpSource​(String src,
                                  String helpText)
        Adds a source that will be dumped out on shutdown.
        Parameters:
        src - Path to a metric source
        helpText - Help text for source
      • getConfigString

        public String getConfigString​(String config)
        Returns any configuration that was used in initializing metrics4j
        Parameters:
        config - Config string
        Returns:
        String representation of value
      • getConfigValue

        public com.typesafe.config.ConfigValue getConfigValue​(String config)
        Returns any configuration that was used in initializing metrics4j
        Parameters:
        config - Config string
        Returns:
        ConfigValue object you can unwrap