Class MetricConfig
- java.lang.Object
-
- org.kairosdb.metrics4j.configuration.MetricConfig
-
public class MetricConfig extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringCLASS_PROPERTYstatic StringCONFIG_SYSTEM_PROPERTYstatic StringDUMP_FILEstatic StringFOLDER_PROPERTYstatic StringMETRIC_NAMEstatic StringOVERRIDES_SYSTEM_PROPERTYstatic StringPATH_SPLITTER_REGEX
-
Constructor Summary
Constructors Constructor Description MetricConfig(MetricsContextImpl context)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDumpSource(String src, String helpText)Adds a source that will be dumped out on shutdown.protected static com.typesafe.config.ConfigapplyEnvironmentVariables(com.typesafe.config.Config config)StringgetConfigString(String config)Returns any configuration that was used in initializing metrics4jcom.typesafe.config.ConfigValuegetConfigValue(String config)Returns any configuration that was used in initializing metrics4jMetricsContextgetContext()StringgetMetricNameForKey(ArgKey key)Map<String,String>getPropsForKey(ArgKey argKey)returns immutable map of properties for the specified key contextShutdownHookOverridegetShutdownHookOverride()Map<String,String>getTagsForKey(ArgKey argKey)Returns a map of tags that you can modifybooleanisDisabled(ArgKey argKey)booleanisDumpMetrics()static MetricConfigparseConfig(String baseConfig, String overridesConfig)Parses config files to generate new MetricConfig objectvoidrunPostConfigInit()voidsetProperties(Properties properties)protected static StringtoEnvVarName(String propName)
-
-
-
Field Detail
-
CLASS_PROPERTY
public static final String CLASS_PROPERTY
- See Also:
- Constant Field Values
-
FOLDER_PROPERTY
public static final String FOLDER_PROPERTY
- See Also:
- Constant Field Values
-
DUMP_FILE
public static final String DUMP_FILE
- See Also:
- Constant Field Values
-
METRIC_NAME
public static final String METRIC_NAME
- See Also:
- Constant Field Values
-
CONFIG_SYSTEM_PROPERTY
public static final String CONFIG_SYSTEM_PROPERTY
- See Also:
- Constant Field Values
-
OVERRIDES_SYSTEM_PROPERTY
public static final String OVERRIDES_SYSTEM_PROPERTY
- See Also:
- Constant Field Values
-
PATH_SPLITTER_REGEX
public static final String PATH_SPLITTER_REGEX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MetricConfig
public MetricConfig(MetricsContextImpl context)
-
-
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 classpathoverridesConfig- Override config- Returns:
- MetricConfig object
-
applyEnvironmentVariables
protected static com.typesafe.config.Config applyEnvironmentVariables(com.typesafe.config.Config config)
-
runPostConfigInit
public void runPostConfigInit()
-
getShutdownHookOverride
public ShutdownHookOverride getShutdownHookOverride()
-
getContext
public MetricsContext getContext()
-
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 sourcehelpText- 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
-
-