mirror of https://github.com/apache/lucene.git
SOLR-11061: Fix incorrect metric path.
This commit is contained in:
parent
d4b4782943
commit
915b36564f
|
@ -1162,7 +1162,7 @@ public final class SolrCore implements SolrInfoBean, SolrMetricProducer, Closeab
|
||||||
File dataDirFile = dataDirPath.toFile();
|
File dataDirFile = dataDirPath.toFile();
|
||||||
manager.registerGauge(this, registry, () -> dataDirFile.getTotalSpace(), true, "totalSpace", Category.CORE.toString(), "fs");
|
manager.registerGauge(this, registry, () -> dataDirFile.getTotalSpace(), true, "totalSpace", Category.CORE.toString(), "fs");
|
||||||
manager.registerGauge(this, registry, () -> dataDirFile.getUsableSpace(), true, "usableSpace", Category.CORE.toString(), "fs");
|
manager.registerGauge(this, registry, () -> dataDirFile.getUsableSpace(), true, "usableSpace", Category.CORE.toString(), "fs");
|
||||||
manager.registerGauge(this, registry, () -> dataDirPath.toAbsolutePath().toString(), true, "fs", "dataDir");
|
manager.registerGauge(this, registry, () -> dataDirPath.toAbsolutePath().toString(), true, "path", Category.CORE.toString(), "fs");
|
||||||
manager.registerGauge(this, registry, () -> {
|
manager.registerGauge(this, registry, () -> {
|
||||||
try {
|
try {
|
||||||
return org.apache.lucene.util.IOUtils.spins(dataDirPath.toAbsolutePath());
|
return org.apache.lucene.util.IOUtils.spins(dataDirPath.toAbsolutePath());
|
||||||
|
@ -1170,7 +1170,7 @@ public final class SolrCore implements SolrInfoBean, SolrMetricProducer, Closeab
|
||||||
// default to spinning
|
// default to spinning
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}, true, "spins", Category.CORE.toString(), "fs", "dataDir");
|
}, true, "spins", Category.CORE.toString(), "fs");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkVersionFieldExistsInSchema(IndexSchema schema, CoreDescriptor coreDescriptor) {
|
private void checkVersionFieldExistsInSchema(IndexSchema schema, CoreDescriptor coreDescriptor) {
|
||||||
|
|
|
@ -178,11 +178,12 @@ public class SolrMetricsIntegrationTest extends SolrTestCaseJ4 {
|
||||||
assertEquals(g.getValue(), cc.getResourceLoader().getInstancePath().toAbsolutePath().toString());
|
assertEquals(g.getValue(), cc.getResourceLoader().getInstancePath().toAbsolutePath().toString());
|
||||||
boolean spins = IOUtils.spins(cc.getCoreRootDirectory());
|
boolean spins = IOUtils.spins(cc.getCoreRootDirectory());
|
||||||
g = (Gauge<?>)metrics.get("CONTAINER.fs.coreRoot.spins");
|
g = (Gauge<?>)metrics.get("CONTAINER.fs.coreRoot.spins");
|
||||||
g = (Gauge<?>)metrics.get("CONTAINER.fs.coreRoot.spins");
|
|
||||||
assertEquals(spins, g.getValue());
|
assertEquals(spins, g.getValue());
|
||||||
|
g = (Gauge<?>)metrics.get("CONTAINER.fs.spins");
|
||||||
if (cc.getConfig().getSolrDataHome() != null) {
|
if (cc.getConfig().getSolrDataHome() != null) {
|
||||||
spins = IOUtils.spins(cc.getConfig().getSolrDataHome());
|
spins = IOUtils.spins(cc.getConfig().getSolrDataHome());
|
||||||
g = (Gauge<?>)metrics.get("CONTAINER.fs.spins");
|
assertEquals(spins, g.getValue());
|
||||||
|
} else {
|
||||||
assertEquals(spins, g.getValue());
|
assertEquals(spins, g.getValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue