public class SolrJmxReporter extends SolrMetricReporter
SolrMetricReporter
that finds (or creates) a MBeanServer from
the given configuration and registers metrics to it with JMX.
NOTE: JmxReporter
that this class uses exports only newly added metrics (it doesn't
process already existing metrics in a registry)
enabled, metricManager, pluginInfo, registryName
Constructor and Description |
---|
SolrJmxReporter(SolrMetricManager metricManager,
String registryName)
Creates a new instance of
SolrJmxReporter . |
Modifier and Type | Method and Description |
---|---|
void |
close()
Stops the reporter from publishing metrics.
|
String |
getAgentId()
Return configured agentId or null.
|
String |
getDomain()
Return configured domain or null.
|
MBeanServer |
getMBeanServer()
Return the reporter's MBeanServer.
|
String |
getServiceUrl()
Return configured serviceUrl or null.
|
void |
init(PluginInfo pluginInfo)
Initializes the reporter by finding an MBeanServer
and registering the metricManager's metric registry.
|
boolean |
isActive()
For unit tests.
|
boolean |
isStarted()
For unit tests.
|
void |
setAgentId(String agentId)
Sets the agent id for a JMX server.
|
void |
setDomain(String domain)
Sets the domain with which MBeans are published.
|
void |
setFilter(List<String> filters)
Report only metrics with names matching any of the prefix filters.
|
void |
setFilter(String filter) |
void |
setRootName(String rootName)
Set root name of the JMX hierarchy for this reporter.
|
void |
setServiceUrl(String serviceUrl)
Sets the service url for a JMX server.
|
String |
toString() |
protected void |
validate()
Validates that the reporter has been correctly configured.
|
getPluginInfo, setEnabled
public SolrJmxReporter(SolrMetricManager metricManager, String registryName)
SolrJmxReporter
.registryName
- name of the registry to reportpublic void init(PluginInfo pluginInfo)
init
in interface PluginInfoInitialized
init
in class SolrMetricReporter
pluginInfo
- the configuration for the reporterpublic void close()
protected void validate() throws IllegalStateException
validate
in class SolrMetricReporter
IllegalStateException
- if the reporter is not properly configuredpublic void setRootName(String rootName)
rootName
- root name of the JMX name hierarchy, or null or empty for default.public void setDomain(String domain)
domain
- the domainpublic void setServiceUrl(String serviceUrl)
serviceUrl
- the service urlpublic void setAgentId(String agentId)
agentId
- the agent idpublic String getAgentId()
public String getServiceUrl()
public String getDomain()
public void setFilter(List<String> filters)
filters
- list of 0 or more prefixes. If the list is empty then
all names will match.public void setFilter(String filter)
public MBeanServer getMBeanServer()
public boolean isActive()
public boolean isStarted()
public String toString()
toString
in class SolrMetricReporter
Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.