Remove network stats & info
This commit is contained in:
parent
50ec1b1f8e
commit
30892c4129
|
@ -30,7 +30,6 @@ import org.elasticsearch.common.io.stream.StreamOutput;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.http.HttpInfo;
|
import org.elasticsearch.http.HttpInfo;
|
||||||
import org.elasticsearch.monitor.jvm.JvmInfo;
|
import org.elasticsearch.monitor.jvm.JvmInfo;
|
||||||
import org.elasticsearch.monitor.network.NetworkInfo;
|
|
||||||
import org.elasticsearch.monitor.os.OsInfo;
|
import org.elasticsearch.monitor.os.OsInfo;
|
||||||
import org.elasticsearch.monitor.process.ProcessInfo;
|
import org.elasticsearch.monitor.process.ProcessInfo;
|
||||||
import org.elasticsearch.threadpool.ThreadPoolInfo;
|
import org.elasticsearch.threadpool.ThreadPoolInfo;
|
||||||
|
@ -65,9 +64,6 @@ public class NodeInfo extends BaseNodeResponse {
|
||||||
@Nullable
|
@Nullable
|
||||||
private ThreadPoolInfo threadPool;
|
private ThreadPoolInfo threadPool;
|
||||||
|
|
||||||
@Nullable
|
|
||||||
private NetworkInfo network;
|
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
private TransportInfo transport;
|
private TransportInfo transport;
|
||||||
|
|
||||||
|
@ -81,7 +77,7 @@ public class NodeInfo extends BaseNodeResponse {
|
||||||
}
|
}
|
||||||
|
|
||||||
public NodeInfo(Version version, Build build, DiscoveryNode node, @Nullable ImmutableMap<String, String> serviceAttributes, @Nullable Settings settings,
|
public NodeInfo(Version version, Build build, DiscoveryNode node, @Nullable ImmutableMap<String, String> serviceAttributes, @Nullable Settings settings,
|
||||||
@Nullable OsInfo os, @Nullable ProcessInfo process, @Nullable JvmInfo jvm, @Nullable ThreadPoolInfo threadPool, @Nullable NetworkInfo network,
|
@Nullable OsInfo os, @Nullable ProcessInfo process, @Nullable JvmInfo jvm, @Nullable ThreadPoolInfo threadPool,
|
||||||
@Nullable TransportInfo transport, @Nullable HttpInfo http, @Nullable PluginsInfo plugins) {
|
@Nullable TransportInfo transport, @Nullable HttpInfo http, @Nullable PluginsInfo plugins) {
|
||||||
super(node);
|
super(node);
|
||||||
this.version = version;
|
this.version = version;
|
||||||
|
@ -92,7 +88,6 @@ public class NodeInfo extends BaseNodeResponse {
|
||||||
this.process = process;
|
this.process = process;
|
||||||
this.jvm = jvm;
|
this.jvm = jvm;
|
||||||
this.threadPool = threadPool;
|
this.threadPool = threadPool;
|
||||||
this.network = network;
|
|
||||||
this.transport = transport;
|
this.transport = transport;
|
||||||
this.http = http;
|
this.http = http;
|
||||||
this.plugins = plugins;
|
this.plugins = plugins;
|
||||||
|
@ -165,14 +160,6 @@ public class NodeInfo extends BaseNodeResponse {
|
||||||
return this.threadPool;
|
return this.threadPool;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Network level information.
|
|
||||||
*/
|
|
||||||
@Nullable
|
|
||||||
public NetworkInfo getNetwork() {
|
|
||||||
return network;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public TransportInfo getTransport() {
|
public TransportInfo getTransport() {
|
||||||
return transport;
|
return transport;
|
||||||
|
@ -222,9 +209,6 @@ public class NodeInfo extends BaseNodeResponse {
|
||||||
if (in.readBoolean()) {
|
if (in.readBoolean()) {
|
||||||
threadPool = ThreadPoolInfo.readThreadPoolInfo(in);
|
threadPool = ThreadPoolInfo.readThreadPoolInfo(in);
|
||||||
}
|
}
|
||||||
if (in.readBoolean()) {
|
|
||||||
network = NetworkInfo.readNetworkInfo(in);
|
|
||||||
}
|
|
||||||
if (in.readBoolean()) {
|
if (in.readBoolean()) {
|
||||||
transport = TransportInfo.readTransportInfo(in);
|
transport = TransportInfo.readTransportInfo(in);
|
||||||
}
|
}
|
||||||
|
@ -281,12 +265,6 @@ public class NodeInfo extends BaseNodeResponse {
|
||||||
out.writeBoolean(true);
|
out.writeBoolean(true);
|
||||||
threadPool.writeTo(out);
|
threadPool.writeTo(out);
|
||||||
}
|
}
|
||||||
if (network == null) {
|
|
||||||
out.writeBoolean(false);
|
|
||||||
} else {
|
|
||||||
out.writeBoolean(true);
|
|
||||||
network.writeTo(out);
|
|
||||||
}
|
|
||||||
if (transport == null) {
|
if (transport == null) {
|
||||||
out.writeBoolean(false);
|
out.writeBoolean(false);
|
||||||
} else {
|
} else {
|
||||||
|
@ -306,5 +284,4 @@ public class NodeInfo extends BaseNodeResponse {
|
||||||
plugins.writeTo(out);
|
plugins.writeTo(out);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,9 +111,6 @@ public class NodesInfoResponse extends BaseNodesResponse<NodeInfo> implements To
|
||||||
if (nodeInfo.getThreadPool() != null) {
|
if (nodeInfo.getThreadPool() != null) {
|
||||||
nodeInfo.getThreadPool().toXContent(builder, params);
|
nodeInfo.getThreadPool().toXContent(builder, params);
|
||||||
}
|
}
|
||||||
if (nodeInfo.getNetwork() != null) {
|
|
||||||
nodeInfo.getNetwork().toXContent(builder, params);
|
|
||||||
}
|
|
||||||
if (nodeInfo.getTransport() != null) {
|
if (nodeInfo.getTransport() != null) {
|
||||||
nodeInfo.getTransport().toXContent(builder, params);
|
nodeInfo.getTransport().toXContent(builder, params);
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,6 @@ import org.elasticsearch.indices.NodeIndicesStats;
|
||||||
import org.elasticsearch.indices.breaker.AllCircuitBreakerStats;
|
import org.elasticsearch.indices.breaker.AllCircuitBreakerStats;
|
||||||
import org.elasticsearch.monitor.fs.FsStats;
|
import org.elasticsearch.monitor.fs.FsStats;
|
||||||
import org.elasticsearch.monitor.jvm.JvmStats;
|
import org.elasticsearch.monitor.jvm.JvmStats;
|
||||||
import org.elasticsearch.monitor.network.NetworkStats;
|
|
||||||
import org.elasticsearch.monitor.os.OsStats;
|
import org.elasticsearch.monitor.os.OsStats;
|
||||||
import org.elasticsearch.monitor.process.ProcessStats;
|
import org.elasticsearch.monitor.process.ProcessStats;
|
||||||
import org.elasticsearch.threadpool.ThreadPoolStats;
|
import org.elasticsearch.threadpool.ThreadPoolStats;
|
||||||
|
@ -62,9 +61,6 @@ public class NodeStats extends BaseNodeResponse implements ToXContent {
|
||||||
@Nullable
|
@Nullable
|
||||||
private ThreadPoolStats threadPool;
|
private ThreadPoolStats threadPool;
|
||||||
|
|
||||||
@Nullable
|
|
||||||
private NetworkStats network;
|
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
private FsStats fs;
|
private FsStats fs;
|
||||||
|
|
||||||
|
@ -82,7 +78,7 @@ public class NodeStats extends BaseNodeResponse implements ToXContent {
|
||||||
|
|
||||||
public NodeStats(DiscoveryNode node, long timestamp, @Nullable NodeIndicesStats indices,
|
public NodeStats(DiscoveryNode node, long timestamp, @Nullable NodeIndicesStats indices,
|
||||||
@Nullable OsStats os, @Nullable ProcessStats process, @Nullable JvmStats jvm, @Nullable ThreadPoolStats threadPool,
|
@Nullable OsStats os, @Nullable ProcessStats process, @Nullable JvmStats jvm, @Nullable ThreadPoolStats threadPool,
|
||||||
@Nullable NetworkStats network, @Nullable FsStats fs, @Nullable TransportStats transport, @Nullable HttpStats http,
|
@Nullable FsStats fs, @Nullable TransportStats transport, @Nullable HttpStats http,
|
||||||
@Nullable AllCircuitBreakerStats breaker) {
|
@Nullable AllCircuitBreakerStats breaker) {
|
||||||
super(node);
|
super(node);
|
||||||
this.timestamp = timestamp;
|
this.timestamp = timestamp;
|
||||||
|
@ -91,7 +87,6 @@ public class NodeStats extends BaseNodeResponse implements ToXContent {
|
||||||
this.process = process;
|
this.process = process;
|
||||||
this.jvm = jvm;
|
this.jvm = jvm;
|
||||||
this.threadPool = threadPool;
|
this.threadPool = threadPool;
|
||||||
this.network = network;
|
|
||||||
this.fs = fs;
|
this.fs = fs;
|
||||||
this.transport = transport;
|
this.transport = transport;
|
||||||
this.http = http;
|
this.http = http;
|
||||||
|
@ -147,14 +142,6 @@ public class NodeStats extends BaseNodeResponse implements ToXContent {
|
||||||
return this.threadPool;
|
return this.threadPool;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Network level statistics.
|
|
||||||
*/
|
|
||||||
@Nullable
|
|
||||||
public NetworkStats getNetwork() {
|
|
||||||
return network;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* File system level stats.
|
* File system level stats.
|
||||||
*/
|
*/
|
||||||
|
@ -203,9 +190,6 @@ public class NodeStats extends BaseNodeResponse implements ToXContent {
|
||||||
if (in.readBoolean()) {
|
if (in.readBoolean()) {
|
||||||
threadPool = ThreadPoolStats.readThreadPoolStats(in);
|
threadPool = ThreadPoolStats.readThreadPoolStats(in);
|
||||||
}
|
}
|
||||||
if (in.readBoolean()) {
|
|
||||||
network = NetworkStats.readNetworkStats(in);
|
|
||||||
}
|
|
||||||
if (in.readBoolean()) {
|
if (in.readBoolean()) {
|
||||||
fs = FsStats.readFsStats(in);
|
fs = FsStats.readFsStats(in);
|
||||||
}
|
}
|
||||||
|
@ -253,12 +237,6 @@ public class NodeStats extends BaseNodeResponse implements ToXContent {
|
||||||
out.writeBoolean(true);
|
out.writeBoolean(true);
|
||||||
threadPool.writeTo(out);
|
threadPool.writeTo(out);
|
||||||
}
|
}
|
||||||
if (network == null) {
|
|
||||||
out.writeBoolean(false);
|
|
||||||
} else {
|
|
||||||
out.writeBoolean(true);
|
|
||||||
network.writeTo(out);
|
|
||||||
}
|
|
||||||
if (fs == null) {
|
if (fs == null) {
|
||||||
out.writeBoolean(false);
|
out.writeBoolean(false);
|
||||||
} else {
|
} else {
|
||||||
|
@ -313,9 +291,6 @@ public class NodeStats extends BaseNodeResponse implements ToXContent {
|
||||||
if (getThreadPool() != null) {
|
if (getThreadPool() != null) {
|
||||||
getThreadPool().toXContent(builder, params);
|
getThreadPool().toXContent(builder, params);
|
||||||
}
|
}
|
||||||
if (getNetwork() != null) {
|
|
||||||
getNetwork().toXContent(builder, params);
|
|
||||||
}
|
|
||||||
if (getFs() != null) {
|
if (getFs() != null) {
|
||||||
getFs().toXContent(builder, params);
|
getFs().toXContent(builder, params);
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,9 +26,6 @@ import org.elasticsearch.monitor.fs.FsService;
|
||||||
import org.elasticsearch.monitor.fs.JmxFsProbe;
|
import org.elasticsearch.monitor.fs.JmxFsProbe;
|
||||||
import org.elasticsearch.monitor.jvm.JvmMonitorService;
|
import org.elasticsearch.monitor.jvm.JvmMonitorService;
|
||||||
import org.elasticsearch.monitor.jvm.JvmService;
|
import org.elasticsearch.monitor.jvm.JvmService;
|
||||||
import org.elasticsearch.monitor.network.JmxNetworkProbe;
|
|
||||||
import org.elasticsearch.monitor.network.NetworkProbe;
|
|
||||||
import org.elasticsearch.monitor.network.NetworkService;
|
|
||||||
import org.elasticsearch.monitor.os.JmxOsProbe;
|
import org.elasticsearch.monitor.os.JmxOsProbe;
|
||||||
import org.elasticsearch.monitor.os.OsProbe;
|
import org.elasticsearch.monitor.os.OsProbe;
|
||||||
import org.elasticsearch.monitor.os.OsService;
|
import org.elasticsearch.monitor.os.OsService;
|
||||||
|
@ -56,13 +53,11 @@ public class MonitorModule extends AbstractModule {
|
||||||
// bind default implementations
|
// bind default implementations
|
||||||
bind(ProcessProbe.class).to(JmxProcessProbe.class).asEagerSingleton();
|
bind(ProcessProbe.class).to(JmxProcessProbe.class).asEagerSingleton();
|
||||||
bind(OsProbe.class).to(JmxOsProbe.class).asEagerSingleton();
|
bind(OsProbe.class).to(JmxOsProbe.class).asEagerSingleton();
|
||||||
bind(NetworkProbe.class).to(JmxNetworkProbe.class).asEagerSingleton();
|
|
||||||
bind(FsProbe.class).to(JmxFsProbe.class).asEagerSingleton();
|
bind(FsProbe.class).to(JmxFsProbe.class).asEagerSingleton();
|
||||||
|
|
||||||
// bind other services
|
// bind other services
|
||||||
bind(ProcessService.class).asEagerSingleton();
|
bind(ProcessService.class).asEagerSingleton();
|
||||||
bind(OsService.class).asEagerSingleton();
|
bind(OsService.class).asEagerSingleton();
|
||||||
bind(NetworkService.class).asEagerSingleton();
|
|
||||||
bind(JvmService.class).asEagerSingleton();
|
bind(JvmService.class).asEagerSingleton();
|
||||||
bind(FsService.class).asEagerSingleton();
|
bind(FsService.class).asEagerSingleton();
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,6 @@ import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.monitor.fs.FsService;
|
import org.elasticsearch.monitor.fs.FsService;
|
||||||
import org.elasticsearch.monitor.jvm.JvmMonitorService;
|
import org.elasticsearch.monitor.jvm.JvmMonitorService;
|
||||||
import org.elasticsearch.monitor.jvm.JvmService;
|
import org.elasticsearch.monitor.jvm.JvmService;
|
||||||
import org.elasticsearch.monitor.network.NetworkService;
|
|
||||||
import org.elasticsearch.monitor.os.OsService;
|
import org.elasticsearch.monitor.os.OsService;
|
||||||
import org.elasticsearch.monitor.process.ProcessService;
|
import org.elasticsearch.monitor.process.ProcessService;
|
||||||
|
|
||||||
|
@ -42,20 +41,17 @@ public class MonitorService extends AbstractLifecycleComponent<MonitorService> {
|
||||||
|
|
||||||
private final JvmService jvmService;
|
private final JvmService jvmService;
|
||||||
|
|
||||||
private final NetworkService networkService;
|
|
||||||
|
|
||||||
private final FsService fsService;
|
private final FsService fsService;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public MonitorService(Settings settings, JvmMonitorService jvmMonitorService,
|
public MonitorService(Settings settings, JvmMonitorService jvmMonitorService,
|
||||||
OsService osService, ProcessService processService, JvmService jvmService, NetworkService networkService,
|
OsService osService, ProcessService processService, JvmService jvmService,
|
||||||
FsService fsService) {
|
FsService fsService) {
|
||||||
super(settings);
|
super(settings);
|
||||||
this.jvmMonitorService = jvmMonitorService;
|
this.jvmMonitorService = jvmMonitorService;
|
||||||
this.osService = osService;
|
this.osService = osService;
|
||||||
this.processService = processService;
|
this.processService = processService;
|
||||||
this.jvmService = jvmService;
|
this.jvmService = jvmService;
|
||||||
this.networkService = networkService;
|
|
||||||
this.fsService = fsService;
|
this.fsService = fsService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,10 +67,6 @@ public class MonitorService extends AbstractLifecycleComponent<MonitorService> {
|
||||||
return this.jvmService;
|
return this.jvmService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public NetworkService networkService() {
|
|
||||||
return this.networkService;
|
|
||||||
}
|
|
||||||
|
|
||||||
public FsService fsService() {
|
public FsService fsService() {
|
||||||
return this.fsService;
|
return this.fsService;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,53 +0,0 @@
|
||||||
/*
|
|
||||||
* Licensed to Elasticsearch under one or more contributor
|
|
||||||
* license agreements. See the NOTICE file distributed with
|
|
||||||
* this work for additional information regarding copyright
|
|
||||||
* ownership. Elasticsearch licenses this file to you under
|
|
||||||
* the Apache License, Version 2.0 (the "License"); you may
|
|
||||||
* not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing,
|
|
||||||
* software distributed under the License is distributed on an
|
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
* KIND, either express or implied. See the License for the
|
|
||||||
* specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.elasticsearch.monitor.network;
|
|
||||||
|
|
||||||
import org.elasticsearch.common.component.AbstractComponent;
|
|
||||||
import org.elasticsearch.common.inject.Inject;
|
|
||||||
import org.elasticsearch.common.settings.Settings;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class JmxNetworkProbe extends AbstractComponent implements NetworkProbe {
|
|
||||||
|
|
||||||
@Inject
|
|
||||||
public JmxNetworkProbe(Settings settings) {
|
|
||||||
super(settings);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public NetworkInfo networkInfo() {
|
|
||||||
NetworkInfo info = new NetworkInfo();
|
|
||||||
return info;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public NetworkStats networkStats() {
|
|
||||||
NetworkStats stats = new NetworkStats();
|
|
||||||
stats.timestamp = System.currentTimeMillis();
|
|
||||||
return stats;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String ifconfig() {
|
|
||||||
return "NA";
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,161 +0,0 @@
|
||||||
/*
|
|
||||||
* Licensed to Elasticsearch under one or more contributor
|
|
||||||
* license agreements. See the NOTICE file distributed with
|
|
||||||
* this work for additional information regarding copyright
|
|
||||||
* ownership. Elasticsearch licenses this file to you under
|
|
||||||
* the Apache License, Version 2.0 (the "License"); you may
|
|
||||||
* not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing,
|
|
||||||
* software distributed under the License is distributed on an
|
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
* KIND, either express or implied. See the License for the
|
|
||||||
* specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.elasticsearch.monitor.network;
|
|
||||||
|
|
||||||
import org.elasticsearch.common.io.stream.StreamInput;
|
|
||||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
|
||||||
import org.elasticsearch.common.io.stream.Streamable;
|
|
||||||
import org.elasticsearch.common.xcontent.ToXContent;
|
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilderString;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class NetworkInfo implements Streamable, ToXContent {
|
|
||||||
|
|
||||||
public static final Interface NA_INTERFACE = new Interface();
|
|
||||||
|
|
||||||
long refreshInterval;
|
|
||||||
|
|
||||||
Interface primary = NA_INTERFACE;
|
|
||||||
|
|
||||||
public long refreshInterval() {
|
|
||||||
return this.refreshInterval;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getRefreshInterval() {
|
|
||||||
return this.refreshInterval;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Interface primaryInterface() {
|
|
||||||
return primary;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Interface getPrimaryInterface() {
|
|
||||||
return primaryInterface();
|
|
||||||
}
|
|
||||||
|
|
||||||
static final class Fields {
|
|
||||||
static final XContentBuilderString NETWORK = new XContentBuilderString("network");
|
|
||||||
static final XContentBuilderString REFRESH_INTERVAL = new XContentBuilderString("refresh_interval");
|
|
||||||
static final XContentBuilderString REFRESH_INTERVAL_IN_MILLIS = new XContentBuilderString("refresh_interval_in_millis");
|
|
||||||
static final XContentBuilderString PRIMARY_INTERFACE = new XContentBuilderString("primary_interface");
|
|
||||||
static final XContentBuilderString ADDRESS = new XContentBuilderString("address");
|
|
||||||
static final XContentBuilderString NAME = new XContentBuilderString("name");
|
|
||||||
static final XContentBuilderString MAC_ADDRESS = new XContentBuilderString("mac_address");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
|
|
||||||
builder.startObject(Fields.NETWORK);
|
|
||||||
builder.timeValueField(Fields.REFRESH_INTERVAL_IN_MILLIS, Fields.REFRESH_INTERVAL, refreshInterval);
|
|
||||||
if (primary != NA_INTERFACE) {
|
|
||||||
builder.startObject(Fields.PRIMARY_INTERFACE);
|
|
||||||
builder.field(Fields.ADDRESS, primary.address());
|
|
||||||
builder.field(Fields.NAME, primary.name());
|
|
||||||
builder.field(Fields.MAC_ADDRESS, primary.macAddress());
|
|
||||||
builder.endObject();
|
|
||||||
}
|
|
||||||
builder.endObject();
|
|
||||||
return builder;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static NetworkInfo readNetworkInfo(StreamInput in) throws IOException {
|
|
||||||
NetworkInfo info = new NetworkInfo();
|
|
||||||
info.readFrom(in);
|
|
||||||
return info;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void readFrom(StreamInput in) throws IOException {
|
|
||||||
refreshInterval = in.readLong();
|
|
||||||
primary = Interface.readNetworkInterface(in);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void writeTo(StreamOutput out) throws IOException {
|
|
||||||
out.writeLong(refreshInterval);
|
|
||||||
primary.writeTo(out);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class Interface implements Streamable {
|
|
||||||
|
|
||||||
private String name = "";
|
|
||||||
private String address = "";
|
|
||||||
private String macAddress = "";
|
|
||||||
|
|
||||||
private Interface() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public Interface(String name, String address, String macAddress) {
|
|
||||||
this.name = name;
|
|
||||||
this.address = address;
|
|
||||||
this.macAddress = macAddress;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String name() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String address() {
|
|
||||||
return address;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAddress() {
|
|
||||||
return address();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String macAddress() {
|
|
||||||
return macAddress;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMacAddress() {
|
|
||||||
return macAddress();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Interface readNetworkInterface(StreamInput in) throws IOException {
|
|
||||||
Interface inf = new Interface();
|
|
||||||
inf.readFrom(in);
|
|
||||||
return inf;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void readFrom(StreamInput in) throws IOException {
|
|
||||||
name = in.readString();
|
|
||||||
address = in.readString();
|
|
||||||
macAddress = in.readString();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void writeTo(StreamOutput out) throws IOException {
|
|
||||||
out.writeString(name);
|
|
||||||
out.writeString(address);
|
|
||||||
out.writeString(macAddress);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,32 +0,0 @@
|
||||||
/*
|
|
||||||
* Licensed to Elasticsearch under one or more contributor
|
|
||||||
* license agreements. See the NOTICE file distributed with
|
|
||||||
* this work for additional information regarding copyright
|
|
||||||
* ownership. Elasticsearch licenses this file to you under
|
|
||||||
* the Apache License, Version 2.0 (the "License"); you may
|
|
||||||
* not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing,
|
|
||||||
* software distributed under the License is distributed on an
|
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
* KIND, either express or implied. See the License for the
|
|
||||||
* specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.elasticsearch.monitor.network;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public interface NetworkProbe {
|
|
||||||
|
|
||||||
NetworkInfo networkInfo();
|
|
||||||
|
|
||||||
NetworkStats networkStats();
|
|
||||||
|
|
||||||
String ifconfig();
|
|
||||||
}
|
|
|
@ -1,130 +0,0 @@
|
||||||
/*
|
|
||||||
* Licensed to Elasticsearch under one or more contributor
|
|
||||||
* license agreements. See the NOTICE file distributed with
|
|
||||||
* this work for additional information regarding copyright
|
|
||||||
* ownership. Elasticsearch licenses this file to you under
|
|
||||||
* the Apache License, Version 2.0 (the "License"); you may
|
|
||||||
* not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing,
|
|
||||||
* software distributed under the License is distributed on an
|
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
* KIND, either express or implied. See the License for the
|
|
||||||
* specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.elasticsearch.monitor.network;
|
|
||||||
|
|
||||||
import org.elasticsearch.common.component.AbstractComponent;
|
|
||||||
import org.elasticsearch.common.inject.Inject;
|
|
||||||
import org.elasticsearch.common.settings.Settings;
|
|
||||||
import org.elasticsearch.common.unit.TimeValue;
|
|
||||||
import org.elasticsearch.common.util.SingleObjectCache;
|
|
||||||
|
|
||||||
import java.net.InetAddress;
|
|
||||||
import java.net.NetworkInterface;
|
|
||||||
import java.util.Enumeration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public final class NetworkService extends AbstractComponent {
|
|
||||||
|
|
||||||
private final NetworkProbe probe;
|
|
||||||
|
|
||||||
private final NetworkInfo info;
|
|
||||||
|
|
||||||
private final SingleObjectCache<NetworkStats> networkStatsCache;
|
|
||||||
|
|
||||||
@Inject
|
|
||||||
public NetworkService(Settings settings, NetworkProbe probe) {
|
|
||||||
super(settings);
|
|
||||||
this.probe = probe;
|
|
||||||
|
|
||||||
TimeValue refreshInterval = settings.getAsTime("monitor.network.refresh_interval", TimeValue.timeValueSeconds(5));
|
|
||||||
|
|
||||||
logger.debug("Using probe [{}] with refresh_interval [{}]", probe, refreshInterval);
|
|
||||||
|
|
||||||
this.info = probe.networkInfo();
|
|
||||||
this.info.refreshInterval = refreshInterval.millis();
|
|
||||||
networkStatsCache = new NetworkStatsCache(refreshInterval, probe.networkStats());
|
|
||||||
if (logger.isDebugEnabled()) {
|
|
||||||
StringBuilder netDebug = new StringBuilder("net_info");
|
|
||||||
try {
|
|
||||||
Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
|
|
||||||
String hostName = InetAddress.getLocalHost().getHostName();
|
|
||||||
netDebug.append("\nhost [").append(hostName).append("]\n");
|
|
||||||
while (interfaces.hasMoreElements()) {
|
|
||||||
NetworkInterface net = interfaces.nextElement();
|
|
||||||
|
|
||||||
netDebug.append(net.getName()).append('\t').append("display_name [").append(net.getDisplayName()).append("]\n");
|
|
||||||
Enumeration<InetAddress> addresses = net.getInetAddresses();
|
|
||||||
netDebug.append("\t\taddress ");
|
|
||||||
while (addresses.hasMoreElements()) {
|
|
||||||
netDebug.append("[").append(addresses.nextElement()).append("] ");
|
|
||||||
}
|
|
||||||
netDebug.append('\n');
|
|
||||||
netDebug.append("\t\tmtu [").append(net.getMTU()).append("] multicast [").append(net.supportsMulticast()).append("] ptp [").append(net.isPointToPoint())
|
|
||||||
.append("] loopback [").append(net.isLoopback()).append("] up [").append(net.isUp()).append("] virtual [").append(net.isVirtual()).append("]")
|
|
||||||
.append('\n');
|
|
||||||
|
|
||||||
Enumeration<NetworkInterface> subInterfaces = net.getSubInterfaces();
|
|
||||||
if (subInterfaces != null && subInterfaces.hasMoreElements()) {
|
|
||||||
netDebug.append("\t\t\tsub interfaces:\n");
|
|
||||||
|
|
||||||
while (subInterfaces.hasMoreElements()) {
|
|
||||||
|
|
||||||
net = subInterfaces.nextElement();
|
|
||||||
|
|
||||||
netDebug.append("\t\t\t").append(net.getName()).append("\t").append("display_name [").append(net.getDisplayName()).append("]\n");
|
|
||||||
addresses = net.getInetAddresses();
|
|
||||||
netDebug.append("\t\t\t\t\taddress ");
|
|
||||||
while (addresses.hasMoreElements()) {
|
|
||||||
netDebug.append("[").append(addresses.nextElement()).append("] ");
|
|
||||||
}
|
|
||||||
netDebug.append('\n');
|
|
||||||
netDebug.append("\t\t\t\t\tmtu [").append(net.getMTU()).append("] multicast [").append(net.supportsMulticast()).append("] ptp [").append(net.isPointToPoint())
|
|
||||||
.append("] loopback [").append(net.isLoopback()).append("] up [").append(net.isUp()).append("] virtual [").append(net.isVirtual()).append("]")
|
|
||||||
.append('\n');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (Exception ex) {
|
|
||||||
netDebug.append("failed to get Network Interface Info [" + ex.getMessage() + "]");
|
|
||||||
}
|
|
||||||
logger.debug(netDebug.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (logger.isTraceEnabled()) {
|
|
||||||
logger.trace("ifconfig\n\n" + ifconfig());
|
|
||||||
}
|
|
||||||
stats(); // pull the stats one time
|
|
||||||
}
|
|
||||||
|
|
||||||
public NetworkInfo info() {
|
|
||||||
return this.info;
|
|
||||||
}
|
|
||||||
|
|
||||||
public NetworkStats stats() {
|
|
||||||
return networkStatsCache.getOrRefresh();
|
|
||||||
}
|
|
||||||
|
|
||||||
private class NetworkStatsCache extends SingleObjectCache<NetworkStats> {
|
|
||||||
public NetworkStatsCache(TimeValue interval, NetworkStats initValue) {
|
|
||||||
super(interval, initValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected NetworkStats refresh() {
|
|
||||||
return probe.networkStats();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public String ifconfig() {
|
|
||||||
return probe.ifconfig();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,248 +0,0 @@
|
||||||
/*
|
|
||||||
* Licensed to Elasticsearch under one or more contributor
|
|
||||||
* license agreements. See the NOTICE file distributed with
|
|
||||||
* this work for additional information regarding copyright
|
|
||||||
* ownership. Elasticsearch licenses this file to you under
|
|
||||||
* the Apache License, Version 2.0 (the "License"); you may
|
|
||||||
* not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing,
|
|
||||||
* software distributed under the License is distributed on an
|
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
* KIND, either express or implied. See the License for the
|
|
||||||
* specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.elasticsearch.monitor.network;
|
|
||||||
|
|
||||||
import org.elasticsearch.common.io.stream.StreamInput;
|
|
||||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
|
||||||
import org.elasticsearch.common.io.stream.Streamable;
|
|
||||||
import org.elasticsearch.common.xcontent.ToXContent;
|
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilderString;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class NetworkStats implements Streamable, ToXContent {
|
|
||||||
|
|
||||||
long timestamp;
|
|
||||||
|
|
||||||
Tcp tcp = null;
|
|
||||||
|
|
||||||
NetworkStats() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
static final class Fields {
|
|
||||||
static final XContentBuilderString NETWORK = new XContentBuilderString("network");
|
|
||||||
static final XContentBuilderString TCP = new XContentBuilderString("tcp");
|
|
||||||
static final XContentBuilderString ACTIVE_OPENS = new XContentBuilderString("active_opens");
|
|
||||||
static final XContentBuilderString PASSIVE_OPENS = new XContentBuilderString("passive_opens");
|
|
||||||
static final XContentBuilderString CURR_ESTAB = new XContentBuilderString("curr_estab");
|
|
||||||
static final XContentBuilderString IN_SEGS = new XContentBuilderString("in_segs");
|
|
||||||
static final XContentBuilderString OUT_SEGS = new XContentBuilderString("out_segs");
|
|
||||||
static final XContentBuilderString RETRANS_SEGS = new XContentBuilderString("retrans_segs");
|
|
||||||
static final XContentBuilderString ESTAB_RESETS = new XContentBuilderString("estab_resets");
|
|
||||||
static final XContentBuilderString ATTEMPT_FAILS = new XContentBuilderString("attempt_fails");
|
|
||||||
static final XContentBuilderString IN_ERRS = new XContentBuilderString("in_errs");
|
|
||||||
static final XContentBuilderString OUT_RSTS = new XContentBuilderString("out_rsts");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
|
|
||||||
builder.startObject(Fields.NETWORK);
|
|
||||||
if (tcp != null) {
|
|
||||||
builder.startObject(Fields.TCP);
|
|
||||||
builder.field(Fields.ACTIVE_OPENS, tcp.getActiveOpens());
|
|
||||||
builder.field(Fields.PASSIVE_OPENS, tcp.getPassiveOpens());
|
|
||||||
builder.field(Fields.CURR_ESTAB, tcp.getCurrEstab());
|
|
||||||
builder.field(Fields.IN_SEGS, tcp.getInSegs());
|
|
||||||
builder.field(Fields.OUT_SEGS, tcp.getOutSegs());
|
|
||||||
builder.field(Fields.RETRANS_SEGS, tcp.getRetransSegs());
|
|
||||||
builder.field(Fields.ESTAB_RESETS, tcp.getEstabResets());
|
|
||||||
builder.field(Fields.ATTEMPT_FAILS, tcp.getAttemptFails());
|
|
||||||
builder.field(Fields.IN_ERRS, tcp.getInErrs());
|
|
||||||
builder.field(Fields.OUT_RSTS, tcp.getOutRsts());
|
|
||||||
builder.endObject();
|
|
||||||
}
|
|
||||||
builder.endObject();
|
|
||||||
return builder;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static NetworkStats readNetworkStats(StreamInput in) throws IOException {
|
|
||||||
NetworkStats stats = new NetworkStats();
|
|
||||||
stats.readFrom(in);
|
|
||||||
return stats;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void readFrom(StreamInput in) throws IOException {
|
|
||||||
timestamp = in.readVLong();
|
|
||||||
if (in.readBoolean()) {
|
|
||||||
tcp = Tcp.readNetworkTcp(in);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void writeTo(StreamOutput out) throws IOException {
|
|
||||||
out.writeVLong(timestamp);
|
|
||||||
if (tcp == null) {
|
|
||||||
out.writeBoolean(false);
|
|
||||||
} else {
|
|
||||||
out.writeBoolean(true);
|
|
||||||
tcp.writeTo(out);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public long timestamp() {
|
|
||||||
return timestamp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getTimestamp() {
|
|
||||||
return timestamp();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Tcp tcp() {
|
|
||||||
return tcp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Tcp getTcp() {
|
|
||||||
return tcp();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class Tcp implements Streamable {
|
|
||||||
|
|
||||||
long activeOpens;
|
|
||||||
long passiveOpens;
|
|
||||||
long attemptFails;
|
|
||||||
long estabResets;
|
|
||||||
long currEstab;
|
|
||||||
long inSegs;
|
|
||||||
long outSegs;
|
|
||||||
long retransSegs;
|
|
||||||
long inErrs;
|
|
||||||
long outRsts;
|
|
||||||
|
|
||||||
public static Tcp readNetworkTcp(StreamInput in) throws IOException {
|
|
||||||
Tcp tcp = new Tcp();
|
|
||||||
tcp.readFrom(in);
|
|
||||||
return tcp;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void readFrom(StreamInput in) throws IOException {
|
|
||||||
activeOpens = in.readLong();
|
|
||||||
passiveOpens = in.readLong();
|
|
||||||
attemptFails = in.readLong();
|
|
||||||
estabResets = in.readLong();
|
|
||||||
currEstab = in.readLong();
|
|
||||||
inSegs = in.readLong();
|
|
||||||
outSegs = in.readLong();
|
|
||||||
retransSegs = in.readLong();
|
|
||||||
inErrs = in.readLong();
|
|
||||||
outRsts = in.readLong();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void writeTo(StreamOutput out) throws IOException {
|
|
||||||
out.writeLong(activeOpens);
|
|
||||||
out.writeLong(passiveOpens);
|
|
||||||
out.writeLong(attemptFails);
|
|
||||||
out.writeLong(estabResets);
|
|
||||||
out.writeLong(currEstab);
|
|
||||||
out.writeLong(inSegs);
|
|
||||||
out.writeLong(outSegs);
|
|
||||||
out.writeLong(retransSegs);
|
|
||||||
out.writeLong(inErrs);
|
|
||||||
out.writeLong(outRsts);
|
|
||||||
}
|
|
||||||
|
|
||||||
public long activeOpens() {
|
|
||||||
return this.activeOpens;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getActiveOpens() {
|
|
||||||
return activeOpens();
|
|
||||||
}
|
|
||||||
|
|
||||||
public long passiveOpens() {
|
|
||||||
return passiveOpens;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getPassiveOpens() {
|
|
||||||
return passiveOpens();
|
|
||||||
}
|
|
||||||
|
|
||||||
public long attemptFails() {
|
|
||||||
return attemptFails;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getAttemptFails() {
|
|
||||||
return attemptFails();
|
|
||||||
}
|
|
||||||
|
|
||||||
public long estabResets() {
|
|
||||||
return estabResets;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getEstabResets() {
|
|
||||||
return estabResets();
|
|
||||||
}
|
|
||||||
|
|
||||||
public long currEstab() {
|
|
||||||
return currEstab;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getCurrEstab() {
|
|
||||||
return currEstab();
|
|
||||||
}
|
|
||||||
|
|
||||||
public long inSegs() {
|
|
||||||
return inSegs;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getInSegs() {
|
|
||||||
return inSegs();
|
|
||||||
}
|
|
||||||
|
|
||||||
public long outSegs() {
|
|
||||||
return outSegs;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getOutSegs() {
|
|
||||||
return outSegs();
|
|
||||||
}
|
|
||||||
|
|
||||||
public long retransSegs() {
|
|
||||||
return retransSegs;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getRetransSegs() {
|
|
||||||
return retransSegs();
|
|
||||||
}
|
|
||||||
|
|
||||||
public long inErrs() {
|
|
||||||
return inErrs;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getInErrs() {
|
|
||||||
return inErrs();
|
|
||||||
}
|
|
||||||
|
|
||||||
public long outRsts() {
|
|
||||||
return outRsts;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getOutRsts() {
|
|
||||||
return outRsts();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -102,7 +102,6 @@ public class NodeService extends AbstractComponent {
|
||||||
monitorService.processService().info(),
|
monitorService.processService().info(),
|
||||||
monitorService.jvmService().info(),
|
monitorService.jvmService().info(),
|
||||||
threadPool.info(),
|
threadPool.info(),
|
||||||
monitorService.networkService().info(),
|
|
||||||
transportService.info(),
|
transportService.info(),
|
||||||
httpServer == null ? null : httpServer.info(),
|
httpServer == null ? null : httpServer.info(),
|
||||||
pluginService == null ? null : pluginService.info()
|
pluginService == null ? null : pluginService.info()
|
||||||
|
@ -117,7 +116,6 @@ public class NodeService extends AbstractComponent {
|
||||||
process ? monitorService.processService().info() : null,
|
process ? monitorService.processService().info() : null,
|
||||||
jvm ? monitorService.jvmService().info() : null,
|
jvm ? monitorService.jvmService().info() : null,
|
||||||
threadPool ? this.threadPool.info() : null,
|
threadPool ? this.threadPool.info() : null,
|
||||||
network ? monitorService.networkService().info() : null,
|
|
||||||
transport ? transportService.info() : null,
|
transport ? transportService.info() : null,
|
||||||
http ? (httpServer == null ? null : httpServer.info()) : null,
|
http ? (httpServer == null ? null : httpServer.info()) : null,
|
||||||
plugin ? (pluginService == null ? null : pluginService.info()) : null
|
plugin ? (pluginService == null ? null : pluginService.info()) : null
|
||||||
|
@ -133,7 +131,6 @@ public class NodeService extends AbstractComponent {
|
||||||
monitorService.processService().stats(),
|
monitorService.processService().stats(),
|
||||||
monitorService.jvmService().stats(),
|
monitorService.jvmService().stats(),
|
||||||
threadPool.stats(),
|
threadPool.stats(),
|
||||||
monitorService.networkService().stats(),
|
|
||||||
monitorService.fsService().stats(),
|
monitorService.fsService().stats(),
|
||||||
transportService.stats(),
|
transportService.stats(),
|
||||||
httpServer == null ? null : httpServer.stats(),
|
httpServer == null ? null : httpServer.stats(),
|
||||||
|
@ -151,7 +148,6 @@ public class NodeService extends AbstractComponent {
|
||||||
process ? monitorService.processService().stats() : null,
|
process ? monitorService.processService().stats() : null,
|
||||||
jvm ? monitorService.jvmService().stats() : null,
|
jvm ? monitorService.jvmService().stats() : null,
|
||||||
threadPool ? this.threadPool.stats() : null,
|
threadPool ? this.threadPool.stats() : null,
|
||||||
network ? monitorService.networkService().stats() : null,
|
|
||||||
fs ? monitorService.fsService().stats() : null,
|
fs ? monitorService.fsService().stats() : null,
|
||||||
transport ? transportService.stats() : null,
|
transport ? transportService.stats() : null,
|
||||||
http ? (httpServer == null ? null : httpServer.stats()) : null,
|
http ? (httpServer == null ? null : httpServer.stats()) : null,
|
||||||
|
|
|
@ -148,7 +148,7 @@ public class MockDiskUsagesTests extends ElasticsearchIntegrationTest {
|
||||||
FsStats fsStats = new FsStats(System.currentTimeMillis(), infos);
|
FsStats fsStats = new FsStats(System.currentTimeMillis(), infos);
|
||||||
return new NodeStats(new DiscoveryNode(nodeName, null, Version.V_2_0_0),
|
return new NodeStats(new DiscoveryNode(nodeName, null, Version.V_2_0_0),
|
||||||
System.currentTimeMillis(),
|
System.currentTimeMillis(),
|
||||||
null, null, null, null, null, null,
|
null, null, null, null, null,
|
||||||
fsStats,
|
fsStats,
|
||||||
null, null, null);
|
null, null, null);
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,6 @@ package org.elasticsearch.stresstest.leaks;
|
||||||
|
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.monitor.jvm.JvmService;
|
import org.elasticsearch.monitor.jvm.JvmService;
|
||||||
import org.elasticsearch.monitor.network.NetworkService;
|
|
||||||
import org.elasticsearch.monitor.os.OsService;
|
import org.elasticsearch.monitor.os.OsService;
|
||||||
import org.elasticsearch.monitor.process.ProcessService;
|
import org.elasticsearch.monitor.process.ProcessService;
|
||||||
import org.elasticsearch.node.Node;
|
import org.elasticsearch.node.Node;
|
||||||
|
@ -39,13 +38,11 @@ public class GenericStatsLeak {
|
||||||
JvmService jvmService = node.injector().getInstance(JvmService.class);
|
JvmService jvmService = node.injector().getInstance(JvmService.class);
|
||||||
OsService osService = node.injector().getInstance(OsService.class);
|
OsService osService = node.injector().getInstance(OsService.class);
|
||||||
ProcessService processService = node.injector().getInstance(ProcessService.class);
|
ProcessService processService = node.injector().getInstance(ProcessService.class);
|
||||||
NetworkService networkService = node.injector().getInstance(NetworkService.class);
|
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
jvmService.stats();
|
jvmService.stats();
|
||||||
osService.stats();
|
osService.stats();
|
||||||
processService.stats();
|
processService.stats();
|
||||||
networkService.stats();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -17,7 +17,7 @@ The second command selectively retrieves nodes information of only
|
||||||
|
|
||||||
By default, it just returns all attributes and core settings for a node.
|
By default, it just returns all attributes and core settings for a node.
|
||||||
It also allows to get only information on `settings`, `os`, `process`, `jvm`,
|
It also allows to get only information on `settings`, `os`, `process`, `jvm`,
|
||||||
`thread_pool`, `network`, `transport`, `http` and `plugins`:
|
`thread_pool`, `transport`, `http` and `plugins`:
|
||||||
|
|
||||||
[source,js]
|
[source,js]
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
|
|
|
@ -19,7 +19,7 @@ second command selectively retrieves nodes stats of only `nodeId1` and
|
||||||
<<cluster-nodes,here>>.
|
<<cluster-nodes,here>>.
|
||||||
|
|
||||||
By default, all stats are returned. You can limit this by combining any
|
By default, all stats are returned. You can limit this by combining any
|
||||||
of `indices`, `os`, `process`, `jvm`, `network`, `transport`, `http`,
|
of `indices`, `os`, `process`, `jvm`, `transport`, `http`,
|
||||||
`fs`, `breaker` and `thread_pool`. For example:
|
`fs`, `breaker` and `thread_pool`. For example:
|
||||||
|
|
||||||
[horizontal]
|
[horizontal]
|
||||||
|
@ -38,9 +38,6 @@ of `indices`, `os`, `process`, `jvm`, `network`, `transport`, `http`,
|
||||||
JVM stats, memory pool information, garbage collection, buffer
|
JVM stats, memory pool information, garbage collection, buffer
|
||||||
pools
|
pools
|
||||||
|
|
||||||
`network`::
|
|
||||||
TCP information
|
|
||||||
|
|
||||||
`os`::
|
`os`::
|
||||||
Operating system stats, load average, cpu, mem, swap
|
Operating system stats, load average, cpu, mem, swap
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
},
|
},
|
||||||
"metric": {
|
"metric": {
|
||||||
"type": "list",
|
"type": "list",
|
||||||
"options": ["settings", "os", "process", "jvm", "thread_pool", "network", "transport", "http", "plugins"],
|
"options": ["settings", "os", "process", "jvm", "thread_pool", "transport", "http", "plugins"],
|
||||||
"description": "A comma-separated list of metrics you wish returned. Leave empty to return all."
|
"description": "A comma-separated list of metrics you wish returned. Leave empty to return all."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
"parts": {
|
"parts": {
|
||||||
"metric" : {
|
"metric" : {
|
||||||
"type" : "list",
|
"type" : "list",
|
||||||
"options" : ["_all", "breaker", "fs", "http", "indices", "jvm", "network", "os", "process", "thread_pool", "transport"],
|
"options" : ["_all", "breaker", "fs", "http", "indices", "jvm", "os", "process", "thread_pool", "transport"],
|
||||||
"description" : "Limit the information returned to the specified metrics"
|
"description" : "Limit the information returned to the specified metrics"
|
||||||
},
|
},
|
||||||
"index_metric" : {
|
"index_metric" : {
|
||||||
|
|
Loading…
Reference in New Issue