Merge pull request #17278 from javanna/fix/remove_cluster_stats_os_mem
Cluster Stats: remove mem section
This commit is contained in:
commit
609456a324
|
@ -302,7 +302,6 @@ public class ClusterStatsNodes implements ToXContent, Streamable {
|
|||
|
||||
int availableProcessors;
|
||||
int allocatedProcessors;
|
||||
long availableMemory;
|
||||
final ObjectIntHashMap<String> names;
|
||||
|
||||
public OsStats() {
|
||||
|
@ -326,15 +325,10 @@ public class ClusterStatsNodes implements ToXContent, Streamable {
|
|||
return allocatedProcessors;
|
||||
}
|
||||
|
||||
public ByteSizeValue getAvailableMemory() {
|
||||
return new ByteSizeValue(availableMemory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
availableProcessors = in.readVInt();
|
||||
allocatedProcessors = in.readVInt();
|
||||
availableMemory = in.readLong();
|
||||
int size = in.readVInt();
|
||||
names.clear();
|
||||
for (int i = 0; i < size; i++) {
|
||||
|
@ -346,7 +340,6 @@ public class ClusterStatsNodes implements ToXContent, Streamable {
|
|||
public void writeTo(StreamOutput out) throws IOException {
|
||||
out.writeVInt(availableProcessors);
|
||||
out.writeVInt(allocatedProcessors);
|
||||
out.writeLong(availableMemory);
|
||||
out.writeVInt(names.size());
|
||||
for (ObjectIntCursor<String> name : names) {
|
||||
out.writeString(name.key);
|
||||
|
@ -365,9 +358,6 @@ public class ClusterStatsNodes implements ToXContent, Streamable {
|
|||
static final XContentBuilderString ALLOCATED_PROCESSORS = new XContentBuilderString("allocated_processors");
|
||||
static final XContentBuilderString NAME = new XContentBuilderString("name");
|
||||
static final XContentBuilderString NAMES = new XContentBuilderString("names");
|
||||
static final XContentBuilderString MEM = new XContentBuilderString("mem");
|
||||
static final XContentBuilderString TOTAL = new XContentBuilderString("total");
|
||||
static final XContentBuilderString TOTAL_IN_BYTES = new XContentBuilderString("total_in_bytes");
|
||||
static final XContentBuilderString COUNT = new XContentBuilderString("count");
|
||||
}
|
||||
|
||||
|
@ -375,10 +365,6 @@ public class ClusterStatsNodes implements ToXContent, Streamable {
|
|||
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
|
||||
builder.field(Fields.AVAILABLE_PROCESSORS, availableProcessors);
|
||||
builder.field(Fields.ALLOCATED_PROCESSORS, allocatedProcessors);
|
||||
builder.startObject(Fields.MEM);
|
||||
builder.byteSizeField(Fields.TOTAL_IN_BYTES, Fields.TOTAL, availableMemory);
|
||||
builder.endObject();
|
||||
|
||||
builder.startArray(Fields.NAMES);
|
||||
for (ObjectIntCursor<String> name : names) {
|
||||
builder.startObject();
|
||||
|
|
|
@ -299,3 +299,8 @@ requests can now be validated at call time which results in much clearer errors.
|
|||
==== ExplainRequestBuilder
|
||||
|
||||
The `setQuery(BytesReference)` method have been removed in favor of using `setQuery(QueryBuilder<?>)`
|
||||
|
||||
=== ClusterStatsResponse
|
||||
|
||||
Removed the `getMemoryAvailable` method from `OsStats`, which could be previously accessed calling
|
||||
`clusterStatsResponse.getNodesStats().getOs().getMemoryAvailable()`.
|
||||
|
|
|
@ -15,3 +15,8 @@ endpoint should be used in lieu of optimize.
|
|||
The `GET` HTTP verb for `/_forcemerge` is no longer supported, please use the
|
||||
`POST` HTTP verb.
|
||||
|
||||
==== Removed `mem` section from `/_cluster/stats` response
|
||||
|
||||
The `mem` section contained only one value, the total memory available
|
||||
throughout all nodes in the cluster. The section was removed as it didn't
|
||||
prove useful.
|
||||
|
|
Loading…
Reference in New Issue