mirror of https://github.com/apache/lucene.git
SOLR-15081: Metrics for core: isLeader, replicaState (#2198)
Note that getLastPublished returns an Enum type. TextWriter.writeVal should probably support Enums, which would simplify this code.
This commit is contained in:
parent
5328ced82e
commit
a233ed2fd1
|
@ -201,13 +201,12 @@ New Features
|
||||||
|
|
||||||
Improvements
|
Improvements
|
||||||
---------------------
|
---------------------
|
||||||
|
* SOLR-15081: Metrics for a core: add SolrCloud "isLeader" and "replicaState". (David Smiley)
|
||||||
* SOLR-15079: Block Collapse - Faster collapse code when groups are co-located via Block Join style nested doc indexing.
|
|
||||||
Used by default when field=_root_, or explicitly requsted for other fields via hint=block. (Joel Bernstein, hossman)
|
|
||||||
|
|
||||||
Optimizations
|
Optimizations
|
||||||
---------------------
|
---------------------
|
||||||
(No changes)
|
* SOLR-15079: Block Collapse - Faster collapse code when groups are co-located via Block Join style nested doc indexing.
|
||||||
|
Used by default when field=_root_, or explicitly requested for other fields via hint=block. (Joel Bernstein, hossman)
|
||||||
|
|
||||||
Bug Fixes
|
Bug Fixes
|
||||||
---------------------
|
---------------------
|
||||||
|
|
|
@ -1203,26 +1203,19 @@ public final class SolrCore implements SolrInfoBean, Closeable {
|
||||||
parentContext.gauge(() -> isClosed() ? parentContext.nullString() : getIndexDir(), true, "indexDir", Category.CORE.toString());
|
parentContext.gauge(() -> isClosed() ? parentContext.nullString() : getIndexDir(), true, "indexDir", Category.CORE.toString());
|
||||||
parentContext.gauge(() -> isClosed() ? parentContext.nullNumber() : getIndexSize(), true, "sizeInBytes", Category.INDEX.toString());
|
parentContext.gauge(() -> isClosed() ? parentContext.nullNumber() : getIndexSize(), true, "sizeInBytes", Category.INDEX.toString());
|
||||||
parentContext.gauge(() -> isClosed() ? parentContext.nullString() : NumberUtils.readableSize(getIndexSize()), true, "size", Category.INDEX.toString());
|
parentContext.gauge(() -> isClosed() ? parentContext.nullString() : NumberUtils.readableSize(getIndexSize()), true, "size", Category.INDEX.toString());
|
||||||
if (coreContainer != null) {
|
|
||||||
final CloudDescriptor cd = getCoreDescriptor().getCloudDescriptor();
|
|
||||||
if (cd != null) {
|
|
||||||
parentContext.gauge(() -> {
|
|
||||||
if (cd.getCollectionName() != null) {
|
|
||||||
return cd.getCollectionName();
|
|
||||||
} else {
|
|
||||||
return parentContext.nullString();
|
|
||||||
}
|
|
||||||
}, true, "collection", Category.CORE.toString());
|
|
||||||
|
|
||||||
parentContext.gauge(() -> {
|
final CloudDescriptor cd = getCoreDescriptor().getCloudDescriptor();
|
||||||
if (cd.getShardId() != null) {
|
if (cd != null) {
|
||||||
return cd.getShardId();
|
parentContext.gauge(cd::getCollectionName, true, "collection", Category.CORE.toString());
|
||||||
} else {
|
parentContext.gauge(cd::getShardId, true, "shard", Category.CORE.toString());
|
||||||
return parentContext.nullString();
|
parentContext.gauge(cd::isLeader, true, "isLeader", Category.CORE.toString());
|
||||||
}
|
parentContext.gauge(
|
||||||
}, true, "shard", Category.CORE.toString());
|
() -> String.valueOf(cd.getLastPublished()),
|
||||||
}
|
true,
|
||||||
|
"replicaState",
|
||||||
|
Category.CORE.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
// initialize disk total / free metrics
|
// initialize disk total / free metrics
|
||||||
Path dataDirPath = Paths.get(dataDir);
|
Path dataDirPath = Paths.get(dataDir);
|
||||||
File dataDirFile = dataDirPath.toFile();
|
File dataDirFile = dataDirPath.toFile();
|
||||||
|
|
Loading…
Reference in New Issue