public class SolrCoreMetricManager extends Object implements Closeable
SolrMetricProducer
's
and exposing metrics to SolrMetricReporter
's.Constructor and Description |
---|
SolrCoreMetricManager(SolrCore core)
Constructs a metric manager.
|
Modifier and Type | Method and Description |
---|---|
void |
afterCoreSetName()
Make sure that metrics already collected that correspond to the old core name
are carried over and will be used under the new core name.
|
void |
close()
Closes reporters specific to this core and unregisters gauges with this core's instance tag.
|
static String |
createLeaderRegistryName(boolean cloud,
String collectionName,
String shardName) |
static String |
createRegistryName(boolean cloud,
String collectionName,
String shardName,
String replicaName,
String coreName) |
static String |
createRegistryName(SolrCore aCore,
String coreName)
This method is used by
CoreContainer.rename(String, String) . |
SolrCore |
getCore() |
String |
getLeaderRegistryName()
Metric registry name for leader metrics.
|
com.codahale.metrics.MetricRegistry |
getRegistry()
Return the registry used by this SolrCore.
|
String |
getRegistryName()
Metric registry name of the manager.
|
String |
getTag()
Return a tag specific to this instance.
|
void |
loadReporters()
Load reporters configured globally and specific to
SolrInfoBean.Group.core
group or with a registry name specific to this core. |
void |
registerMetricProducer(String scope,
SolrMetricProducer producer)
Registers a mapping of name/metric's with the manager's metric registry.
|
public SolrCoreMetricManager(SolrCore core)
core
- the metric manager's corepublic void loadReporters()
SolrInfoBean.Group.core
group or with a registry name specific to this core.public void afterCoreSetName()
public void registerMetricProducer(String scope, SolrMetricProducer producer)
scope
- the scope of the metrics to be registered (e.g. `/admin/ping`)producer
- producer of metrics to be registeredpublic com.codahale.metrics.MetricRegistry getRegistry()
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public SolrCore getCore()
public String getRegistryName()
For example, when the core name looks like this but it's NOT a SolrCloud collection:
my_collection_shard1_1_replica1
then this will be used as the registry name (plus
the required solr.core
prefix). However,
if this is a SolrCloud collection my_collection
then the registry name will become
solr.core.my_collection.shard1_1.replica1
.
public String getLeaderRegistryName()
public String getTag()
public static String createRegistryName(boolean cloud, String collectionName, String shardName, String replicaName, String coreName)
public static String createRegistryName(SolrCore aCore, String coreName)
CoreContainer.rename(String, String)
.aCore
- existing core with old namecoreName
- new nameCopyright © 2000-2019 Apache Software Foundation. All Rights Reserved.