├── .gitignore ├── .graphics ├── eslogo.png └── eslogo.psd ├── .travis.yml ├── LICENSE ├── README.md ├── build.gradle ├── config ├── newrelic.template.json ├── plugin.json └── plugin.template.json ├── docker-compose.yml ├── lib └── metrics_publish-2.0.1.jar └── src ├── main └── java │ └── me │ └── snov │ └── newrelic │ └── elasticsearch │ ├── ElasticsearchAgent.java │ ├── ElasticsearchAgentFactory.java │ ├── Main.java │ ├── interfaces │ └── AgentInterface.java │ ├── parsers │ ├── AbstractParser.java │ ├── ClusterStatsParser.java │ └── NodesStatsParser.java │ ├── reporters │ ├── ClusterStatsReporter.java │ └── NodesStatsReporter.java │ ├── responses │ ├── ClusterStats.java │ └── NodesStats.java │ └── services │ ├── ClusterStatsService.java │ ├── EpochCounterFactory.java │ └── NodesStatsService.java └── test ├── java └── me │ └── snov │ └── newrelic │ └── elasticsearch │ ├── IntegrationTest.java │ ├── parsers │ ├── ClusterStatsParserTest.java │ └── NodesStatsParserTest.java │ ├── reporters │ ├── ClusterStatsReporterTest.java │ ├── MockAgent.java │ └── NodesStatsReporterTest.java │ └── services │ ├── ClusterStatsServiceGetVersionMismatchTest.java │ └── ClusterStatsServiceTest.java └── resources ├── cluster_stats_0.90.12.json ├── cluster_stats_1.3.4.json ├── cluster_stats_1.4.2.json ├── cluster_stats_1.5.1.json ├── cluster_stats_2.1.0.json ├── cluster_stats_2.1.1.json ├── cluster_stats_5.1.1.json ├── cluster_stats_6.6.1.json ├── cluster_stats_version_mismatch.json ├── nodes_stats_0.90.12.json ├── nodes_stats_1.3.4.json ├── nodes_stats_1.4.2.json ├── nodes_stats_1.4.2_incomplete_os_stats.json ├── nodes_stats_1.5.1.json ├── nodes_stats_2.1.1.json ├── nodes_stats_5.1.1.json └── nodes_stats_6.6.1.json /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | *.iml 3 | /.gradle 4 | /gradle* 5 | build/ 6 | config/newrelic.json 7 | lib/* 8 | !lib/metrics_publish-*.jar 9 | logs/ 10 | -------------------------------------------------------------------------------- /.graphics/eslogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s12v/newrelic-elasticsearch/970ea210891a55ba5d6dfe6329dbbd8cd605c82c/.graphics/eslogo.png -------------------------------------------------------------------------------- /.graphics/eslogo.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s12v/newrelic-elasticsearch/970ea210891a55ba5d6dfe6329dbbd8cd605c82c/.graphics/eslogo.psd -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | dist: trusty 2 | 3 | sudo: required 4 | 5 | language: java 6 | 7 | env: 8 | - ELASTICSEARCH_VERSION="1.3" 9 | - ELASTICSEARCH_VERSION="1.7-alpine" 10 | - ELASTICSEARCH_VERSION="2.4-alpine" 11 | - ELASTICSEARCH_VERSION="5-alpine" 12 | - ELASTICSEARCH_VERSION="6.6.1" 13 | 14 | jdk: 15 | - openjdk8 16 | 17 | before_install: 18 | - sudo sysctl -w vm.max_map_count=262144 19 | - docker run -d -p 127.0.0.1:9200:9200 elasticsearch:$ELASTICSEARCH_VERSION 20 | - pip install --user codecov 21 | 22 | script: 23 | - gradle clean build integrationTest jacocoTestReport dist 24 | 25 | after_success: 26 | - codecov 27 | 28 | deploy: 29 | provider: releases 30 | api-key: 31 | secure: fNp7Sv3SEjb5XzhZsCn7ub8qzMtSU/HmNVu2kolxLoLykbqRTvtn3+0SNT3x5urb12akZ+PrN6QlBvBLWBClhFaJDJ6XvGMs60ZIwpvmkBKAftKH1c6GNWjo8kdxvkawvQJNy8KDPh7GbzdjbTJ7J16eCdWQnWVyoNKubEuyiPA= 32 | file: "$(ls $TRAVIS_BUILD_DIR/build/distributions/newrelic-elasticsearch-plugin*.tar.gz | head -n 1)" 33 | skip_cleanup: true 34 | on: 35 | tags: true 36 | all_branches: true 37 | condition: 38 | - $TRAVIS_JDK_VERSION = openjdk8 39 | - $ELASTICSEARCH_VERSION = "6.6.1" 40 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Sergey Novikov 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/s12v/newrelic-elasticsearch.svg?branch=master)](https://travis-ci.org/s12v/newrelic-elasticsearch) 2 | [![codecov](https://codecov.io/gh/s12v/newrelic-elasticsearch/branch/master/graph/badge.svg)](https://codecov.io/gh/s12v/newrelic-elasticsearch) 3 | [![Docker Pulls](https://img.shields.io/docker/pulls/s12v/newrelic-elasticsearch.svg?maxAge=2592000)]() 4 | 5 | # Newrelic elasticsearch plugin (discontinued) 6 | 7 | > Note: On Wednesday, June 16th, 2021, New Relic will no longer support or maintain Plugins. 8 | 9 | Elasticsearch monitoring plugin. Polls cluster/nodes stats every minute and logs metrics, including RPMs, thread pool, merges, JVM and OS stats. 10 | 11 | ![screen shot 2015-02-15 at 22 41 57](https://cloud.githubusercontent.com/assets/1462574/6205166/8c7b12ee-b565-11e4-9495-4fee5de919db.png) 12 | 13 | ## Installation 14 | 15 | ### Interactive installation with New Relic NPI 16 | 17 | See https://docs.newrelic.com/docs/plugins/plugins-new-relic/installing-plugins/installing-npi-compatible-plugin 18 | ``` 19 | ./npi install me.snov.newrelic-elasticsearch 20 | ``` 21 | 22 | ### Docker 23 | 24 | ``` 25 | docker run -e "ES_HOST=localhost" -e "NEW_RELIC_LICENSE_KEY=..." s12v/newrelic-elasticsearch 26 | ``` 27 | 28 | More details: https://hub.docker.com/r/s12v/newrelic-elasticsearch/ 29 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | import java.text.SimpleDateFormat 2 | 3 | apply plugin: 'java' 4 | apply plugin: 'jacoco' 5 | 6 | // me.snov.newrelic.elasticsearch.ElasticsearchAgent 7 | version = '2.4.0' 8 | 9 | repositories { 10 | mavenCentral() 11 | } 12 | 13 | dependencies { 14 | compile files('lib/metrics_publish-2.0.1.jar') 15 | compile 'com.google.code.gson:gson:2.6.1' 16 | compile 'commons-codec:commons-codec:1.10' 17 | testCompile 'junit:junit:4.12' 18 | testCompile 'org.mockito:mockito-core:1.10.19' 19 | } 20 | 21 | task copyTestResources(type: Copy) { 22 | from "${projectDir}/src/test/resources" 23 | into "${buildDir}/classes/test/resources" 24 | } 25 | processTestResources.dependsOn copyTestResources 26 | 27 | test { 28 | useJUnit { 29 | excludeCategories 'me.snov.newrelic.elasticsearch.IntegrationTest' 30 | } 31 | } 32 | 33 | task integrationTest(type: Test) { 34 | useJUnit { 35 | includeCategories 'me.snov.newrelic.elasticsearch.IntegrationTest' 36 | } 37 | } 38 | 39 | tasks.withType(Test) { 40 | testLogging { 41 | events "passed", "skipped", "failed" 42 | } 43 | } 44 | 45 | jacocoTestReport { 46 | reports { 47 | xml.enabled true 48 | } 49 | } 50 | 51 | def getDateTime() { 52 | return new SimpleDateFormat("YYYYMMDDHHmm").format(new Date()); 53 | } 54 | 55 | task fatJar(type: Jar) { 56 | manifest { 57 | attributes 'Specification-Title': 'New Relic Elasticsearch Plugin' 58 | attributes 'Specification-Vendor': 'Sergey Novikov' 59 | attributes 'Implementation-Vendor': 'Sergey Novikov' 60 | attributes 'Built-Date': getDateTime() 61 | attributes 'Specification-Version': version 62 | attributes 'Implementation-Version': "${version}-${getDateTime()}" 63 | attributes 'Main-Class': 'me.snov.newrelic.elasticsearch.Main' 64 | } 65 | baseName = 'plugin' 66 | from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } 67 | with jar 68 | } 69 | 70 | task dist(type: Tar) { 71 | baseName 'newrelic-elasticsearch-plugin' 72 | extension = 'tar.gz' 73 | compression Compression.GZIP 74 | into("newrelic-elasticsearch-plugin-${version}") { 75 | from 'LICENSE' 76 | into("config") { 77 | from 'config', 'config' 78 | } 79 | from("${buildDir}/libs") { 80 | include 'plugin*' 81 | rename 'plugin-(.*).jar', 'plugin.jar' 82 | } 83 | } 84 | } 85 | dist.dependsOn fatJar 86 | 87 | -------------------------------------------------------------------------------- /config/newrelic.template.json: -------------------------------------------------------------------------------- 1 | { 2 | "license_key": "...", 3 | "log_level": "info", 4 | "log_file_name": "newrelic_plugin.log", 5 | "log_file_path": "logs" 6 | } 7 | -------------------------------------------------------------------------------- /config/plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "agents": [ 3 | { 4 | "host" : "localhost", 5 | "port" : 9200, 6 | "username": "", 7 | "password": "", 8 | "_protocol": "Optional. Default 'http'. Rename to 'protocol' and set to 'https' if needed.", 9 | "_basePath": "Optional. API path on server. Default '/'. Rename to 'basePath' if you need to customize it", 10 | "_name": "Optional. By default loaded from elasticsearch. Rename to 'name' if you need to customize it" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /config/plugin.template.json: -------------------------------------------------------------------------------- 1 | { 2 | "agents": [ 3 | { 4 | "host" : "localhost", 5 | "port" : 9200, 6 | "username": "", 7 | "password": "", 8 | "_name": "Optional. By default loaded from elasticsearch. Rename to 'name' if you need to customize it" 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "2" 2 | services: 3 | es24: 4 | image: elasticsearch:2.4 5 | ports: 6 | - "9224:9200" 7 | es5: 8 | image: elasticsearch:5-alpine 9 | ports: 10 | - "9205:9200" 11 | es66: 12 | image: elasticsearch:6.6.1 13 | ports: 14 | - "9266:9200" 15 | -------------------------------------------------------------------------------- /lib/metrics_publish-2.0.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/s12v/newrelic-elasticsearch/970ea210891a55ba5d6dfe6329dbbd8cd605c82c/lib/metrics_publish-2.0.1.jar -------------------------------------------------------------------------------- /src/main/java/me/snov/newrelic/elasticsearch/ElasticsearchAgent.java: -------------------------------------------------------------------------------- 1 | package me.snov.newrelic.elasticsearch; 2 | 3 | import com.newrelic.metrics.publish.Agent; 4 | import com.newrelic.metrics.publish.util.Logger; 5 | import me.snov.newrelic.elasticsearch.interfaces.AgentInterface; 6 | import me.snov.newrelic.elasticsearch.parsers.ClusterStatsParser; 7 | import me.snov.newrelic.elasticsearch.parsers.NodesStatsParser; 8 | import me.snov.newrelic.elasticsearch.reporters.ClusterStatsReporter; 9 | import me.snov.newrelic.elasticsearch.reporters.NodesStatsReporter; 10 | 11 | import java.io.IOException; 12 | 13 | /** 14 | * Agent for Elasticsearch cluster 15 | */ 16 | public class ElasticsearchAgent extends Agent implements AgentInterface { 17 | 18 | private static final String GUID = "me.snov.newrelic-elasticsearch"; 19 | private static final String VERSION = "2.4.0"; 20 | 21 | private final String clusterName; 22 | private final Logger logger; 23 | 24 | private ClusterStatsParser clusterStatsParser; 25 | private ClusterStatsReporter clusterStatsReporter; 26 | private NodesStatsParser nodesStatsParser; 27 | private NodesStatsReporter nodesStatsReporter; 28 | 29 | public ElasticsearchAgent(String clusterName) { 30 | super(GUID, VERSION); 31 | this.clusterName = clusterName; 32 | this.logger = Logger.getLogger(ElasticsearchAgent.class); 33 | } 34 | 35 | @Override 36 | public String getAgentName() { 37 | return clusterName; 38 | } 39 | 40 | @Override 41 | public void pollCycle() { 42 | try { 43 | clusterStatsReporter.reportClusterStats(clusterStatsParser.request()); 44 | nodesStatsReporter.reportNodesStats(nodesStatsParser.request()); 45 | } catch (IOException e) { 46 | logger.error("Unable to perform poll cycle", e); 47 | } 48 | } 49 | 50 | public void configure(ClusterStatsParser clusterStatsParser, ClusterStatsReporter clusterStatsReporter, 51 | NodesStatsParser nodesStatsParser, NodesStatsReporter nodesStatsReporter) { 52 | this.clusterStatsParser = clusterStatsParser; 53 | this.clusterStatsReporter = clusterStatsReporter; 54 | this.nodesStatsParser = nodesStatsParser; 55 | this.nodesStatsReporter = nodesStatsReporter; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/me/snov/newrelic/elasticsearch/ElasticsearchAgentFactory.java: -------------------------------------------------------------------------------- 1 | package me.snov.newrelic.elasticsearch; 2 | 3 | import com.newrelic.metrics.publish.Agent; 4 | import com.newrelic.metrics.publish.AgentFactory; 5 | import com.newrelic.metrics.publish.configuration.ConfigurationException; 6 | import me.snov.newrelic.elasticsearch.parsers.ClusterStatsParser; 7 | import me.snov.newrelic.elasticsearch.parsers.NodesStatsParser; 8 | import me.snov.newrelic.elasticsearch.reporters.ClusterStatsReporter; 9 | import me.snov.newrelic.elasticsearch.reporters.NodesStatsReporter; 10 | 11 | import java.io.IOException; 12 | import java.net.MalformedURLException; 13 | import java.util.Map; 14 | 15 | public class ElasticsearchAgentFactory extends AgentFactory { 16 | 17 | @Override 18 | public Agent createConfiguredAgent(Map properties) throws ConfigurationException { 19 | String host = (String) properties.get("host"); 20 | String protocol = (String) properties.get("protocol"); 21 | String basePath = (String) properties.get("basePath"); 22 | String username = (String) properties.get("username"); 23 | String password = (String) properties.get("password"); 24 | Long port = (Long) properties.get("port"); 25 | String name = (String) properties.get("name"); 26 | 27 | if (host == null || port == null) { 28 | throw new ConfigurationException("'host' and 'port' must be specified. Do you have a 'config/plugin.json' file?"); 29 | } 30 | 31 | if (protocol == null) { 32 | protocol = "http"; 33 | } 34 | 35 | if (basePath == null) { 36 | basePath = ""; 37 | } 38 | 39 | if (basePath.endsWith("/")) { 40 | basePath = basePath.substring(0, basePath.length() - 1); 41 | } 42 | 43 | try { 44 | ClusterStatsParser clusterStatsParser = new ClusterStatsParser(protocol, host, port.intValue(), basePath, username, password); 45 | String clusterName = name != null && name.length() > 0 ? name : clusterStatsParser.request().cluster_name; 46 | ElasticsearchAgent agent = new ElasticsearchAgent(clusterName); 47 | 48 | ClusterStatsReporter clusterStatsReporter = new ClusterStatsReporter(agent); 49 | NodesStatsParser nodeStatsParser = new NodesStatsParser(protocol, host, port.intValue(), basePath, username, password); 50 | NodesStatsReporter nodeStatsReporter = new NodesStatsReporter(agent); 51 | agent.configure(clusterStatsParser, clusterStatsReporter, nodeStatsParser, nodeStatsReporter); 52 | 53 | return agent; 54 | } catch (MalformedURLException e) { 55 | throw new ConfigurationException(String.format("URL could not be parsed: %s", e.getMessage())); 56 | } catch (IOException e) { 57 | throw new ConfigurationException( 58 | String.format("Can't connect to elasticsearch at %s:%d: %s", host, port, e.getMessage()), e); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/me/snov/newrelic/elasticsearch/Main.java: -------------------------------------------------------------------------------- 1 | package me.snov.newrelic.elasticsearch; 2 | 3 | import com.newrelic.metrics.publish.Runner; 4 | import com.newrelic.metrics.publish.configuration.ConfigurationException; 5 | 6 | public class Main { 7 | 8 | public static void main(String[] args) { 9 | try { 10 | Runner runner = new Runner(); 11 | runner.add(new ElasticsearchAgentFactory()); 12 | runner.setupAndRun(); // Never returns 13 | } catch (ConfigurationException e) { 14 | System.err.println("ERROR: " + e.getMessage()); 15 | System.exit(-1); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/me/snov/newrelic/elasticsearch/interfaces/AgentInterface.java: -------------------------------------------------------------------------------- 1 | package me.snov.newrelic.elasticsearch.interfaces; 2 | 3 | public interface AgentInterface { 4 | void reportMetric(String metricName, String units, Number value); 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/me/snov/newrelic/elasticsearch/parsers/AbstractParser.java: -------------------------------------------------------------------------------- 1 | package me.snov.newrelic.elasticsearch.parsers; 2 | 3 | import com.google.gson.FieldNamingPolicy; 4 | import com.google.gson.Gson; 5 | import com.google.gson.GsonBuilder; 6 | 7 | import org.apache.commons.codec.binary.Base64; 8 | 9 | import java.io.*; 10 | import java.net.HttpURLConnection; 11 | import java.net.URL; 12 | 13 | abstract class AbstractParser { 14 | 15 | private final Class typeParameterClass; 16 | private final URL url; 17 | private final Gson gson; 18 | private final String username; 19 | private final String password; 20 | private HttpURLConnection connection; 21 | 22 | public AbstractParser(Class typeParameterClass, URL url, String username, String password) { 23 | this.typeParameterClass = typeParameterClass; 24 | this.url = url; 25 | this.username = username; 26 | this.password = password; 27 | this.gson = new GsonBuilder() 28 | .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES) 29 | .create(); 30 | } 31 | 32 | private InputStream getInputStream(URL url) throws IOException { 33 | connection = (HttpURLConnection) url.openConnection(); 34 | connection.addRequestProperty("Accept", "application/json"); 35 | 36 | // If we have basic authentication credentials defined, generate the Authorization header. 37 | if (username != null && password != null 38 | && !username.isEmpty() && !password.isEmpty()) { 39 | String authString = username + ":" + password; 40 | byte[] authEncBytes = Base64.encodeBase64(authString.getBytes()); 41 | String authStringEnc = new String(authEncBytes); 42 | 43 | connection.setRequestProperty("Authorization", "Basic " + authStringEnc); 44 | } 45 | return connection.getInputStream(); 46 | } 47 | 48 | public final T request() throws IOException { 49 | InputStream inputStream = null; 50 | try { 51 | inputStream = getInputStream(url); 52 | return parse(inputStream); 53 | } finally { 54 | if (inputStream != null) { 55 | inputStream.close(); 56 | } 57 | if (connection != null) { 58 | connection.disconnect(); 59 | } 60 | } 61 | } 62 | 63 | public final T parse(InputStream stream) throws IOException { 64 | return gson.fromJson(new InputStreamReader(stream), typeParameterClass); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/me/snov/newrelic/elasticsearch/parsers/ClusterStatsParser.java: -------------------------------------------------------------------------------- 1 | package me.snov.newrelic.elasticsearch.parsers; 2 | 3 | import me.snov.newrelic.elasticsearch.responses.ClusterStats; 4 | 5 | import java.net.MalformedURLException; 6 | import java.net.URL; 7 | 8 | public class ClusterStatsParser extends AbstractParser { 9 | 10 | private static final String URL_CLUSTER_STATS = "/_cluster/stats"; 11 | 12 | public ClusterStatsParser() { 13 | super(ClusterStats.class, null, null, null); 14 | } 15 | 16 | public ClusterStatsParser(String protocol, String host, int port, String basePath, String username, String password) throws MalformedURLException { 17 | super(ClusterStats.class, new URL(protocol, host, port, basePath + URL_CLUSTER_STATS), username, password); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/me/snov/newrelic/elasticsearch/parsers/NodesStatsParser.java: -------------------------------------------------------------------------------- 1 | package me.snov.newrelic.elasticsearch.parsers; 2 | 3 | import me.snov.newrelic.elasticsearch.responses.NodesStats; 4 | 5 | import java.net.MalformedURLException; 6 | import java.net.URL; 7 | 8 | public class NodesStatsParser extends AbstractParser { 9 | 10 | private static final String URL_CLUSTER_STATS = "/_nodes/stats"; 11 | 12 | public NodesStatsParser() { 13 | super(NodesStats.class, null, null, null); 14 | } 15 | 16 | public NodesStatsParser(String protocol, String host, int port, String basePath, String username, String password) throws MalformedURLException { 17 | super(NodesStats.class, new URL(protocol, host, port, basePath + URL_CLUSTER_STATS), username, password); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/me/snov/newrelic/elasticsearch/reporters/ClusterStatsReporter.java: -------------------------------------------------------------------------------- 1 | package me.snov.newrelic.elasticsearch.reporters; 2 | 3 | import me.snov.newrelic.elasticsearch.interfaces.AgentInterface; 4 | import me.snov.newrelic.elasticsearch.responses.ClusterStats; 5 | import me.snov.newrelic.elasticsearch.services.ClusterStatsService; 6 | 7 | public class ClusterStatsReporter { 8 | 9 | private final AgentInterface agent; 10 | private final ClusterStatsService clusterStatsService; 11 | 12 | public ClusterStatsReporter(AgentInterface agent) { 13 | this.agent = agent; 14 | this.clusterStatsService = new ClusterStatsService(); 15 | } 16 | 17 | public void reportClusterStats(ClusterStats clusterStats) { 18 | // Cluster status (we represent unhealthy states as an int to allow alerting on values > 0) 19 | agent.reportMetric("V1/ClusterStats/Status/IsYellow", "bool", asInt(clusterStatsService.isYellow(clusterStats))); 20 | agent.reportMetric("V1/ClusterStats/Status/IsRed", "bool", asInt(clusterStatsService.isRed(clusterStats))); 21 | 22 | // Component/V1/ClusterStats/Indices/Docs/* 23 | agent.reportMetric("V1/ClusterStats/Indices/Docs/Count", "documents", clusterStats.indices.docs.count); 24 | agent.reportMetric("V1/ClusterStats/Indices/Docs/Deleted", "documents", clusterStats.indices.docs.deleted); 25 | 26 | // Nodes (table) 27 | // Component/V1/ClusterStats/Nodes/Count/* 28 | agent.reportMetric("V1/ClusterStats/Nodes/Count/Total", "nodes", clusterStats.nodes.count.total); 29 | agent.reportMetric("V1/ClusterStats/Nodes/Count/Master and data", "nodes", clusterStats.nodes.count.master_data); 30 | agent.reportMetric("V1/ClusterStats/Nodes/Count/Master only", "nodes", clusterStats.nodes.count.master_only); 31 | agent.reportMetric("V1/ClusterStats/Nodes/Count/Data only", "nodes", clusterStats.nodes.count.data_only); 32 | agent.reportMetric("V1/ClusterStats/Nodes/Count/Client", "nodes", clusterStats.nodes.count.client); 33 | 34 | // Indices and Shards (table) 35 | // Component/V1/ClusterStats/Indices/Group1/* 36 | agent.reportMetric("V1/ClusterStats/Indices/Group1/Indices", "indices", clusterStats.indices.count); 37 | agent.reportMetric("V1/ClusterStats/Indices/Group1/Shards", "shards", clusterStats.indices.shards.total); 38 | agent.reportMetric("V1/ClusterStats/Indices/Group1/Primaries", "shards", clusterStats.indices.shards.primaries); 39 | agent.reportMetric("V1/ClusterStats/Indices/Group1/Replication", "shards", clusterStats.indices.shards.replication); 40 | 41 | // Component/V1/ClusterStats/Indices/Segments/Count 42 | agent.reportMetric("V1/ClusterStats/Indices/Segments/Count", "segments", clusterStats.indices.segments.count); 43 | 44 | // Component/V1/ClusterStats/Indices/Store/Size 45 | agent.reportMetric("V1/ClusterStats/Indices/Store/Size", "bytes", clusterStats.indices.store.size_in_bytes); 46 | 47 | 48 | /******************* Summary *******************/ 49 | 50 | // Component/V1/ClusterStats/NumberOfVersionsInCluster 51 | agent.reportMetric("V1/ClusterStats/NumberOfVersionsInCluster", "versions", 52 | clusterStatsService.getNumberOfVersionsInCluster(clusterStats)); 53 | } 54 | 55 | private int asInt(boolean value) { 56 | return value ? 1 : 0; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/me/snov/newrelic/elasticsearch/reporters/NodesStatsReporter.java: -------------------------------------------------------------------------------- 1 | package me.snov.newrelic.elasticsearch.reporters; 2 | 3 | import me.snov.newrelic.elasticsearch.interfaces.AgentInterface; 4 | import me.snov.newrelic.elasticsearch.responses.NodesStats; 5 | import me.snov.newrelic.elasticsearch.services.EpochCounterFactory; 6 | import me.snov.newrelic.elasticsearch.services.NodesStatsService; 7 | 8 | public class NodesStatsReporter { 9 | 10 | private final AgentInterface agent; 11 | private final EpochCounterFactory processorFactory; 12 | private final NodesStatsService nodesStatsService; 13 | 14 | public NodesStatsReporter(AgentInterface agent) { 15 | this.agent = agent; 16 | this.nodesStatsService = new NodesStatsService(); 17 | this.processorFactory = new EpochCounterFactory(); 18 | } 19 | 20 | public void reportNodesStats(NodesStats nodesStats) { 21 | if (nodesStats.nodes != null) { 22 | reportCalculatedClusterStats(nodesStats); 23 | for (NodesStats.NodeStats nodeStats : nodesStats.nodes.values()) { 24 | reportNodeStats(nodeStats); 25 | } 26 | } 27 | } 28 | 29 | private void reportCalculatedClusterStats(NodesStats nodesStats) { 30 | /******************* Queries stats *******************/ 31 | 32 | NodesStatsService.QueriesStat queriesStat = nodesStatsService.getTotalNumberOfQueries(nodesStats); 33 | 34 | // Component/V1/QueriesPerSecond/* 35 | reportProcessedMetric("V1/QueriesPerSecond/Search", "requests/second", queriesStat.search); 36 | reportProcessedMetric("V1/QueriesPerSecond/Fetch", "requests/second", queriesStat.fetch); 37 | reportProcessedMetric("V1/QueriesPerSecond/Get", "requests/second", queriesStat.get); 38 | reportProcessedMetric("V1/QueriesPerSecond/Index", "requests/second", queriesStat.index); 39 | reportProcessedMetric("V1/QueriesPerSecond/Delete", "requests/second", queriesStat.delete); 40 | 41 | /******************* Max heap used, % *******************/ 42 | int maxHeapPercent = 0; 43 | for (NodesStats.NodeStats nodeStats : nodesStats.nodes.values()) { 44 | if (nodeStats.jvm != null && nodeStats.jvm.mem.heap_used_percent.intValue() > maxHeapPercent) { 45 | maxHeapPercent = nodeStats.jvm.mem.heap_used_percent.intValue(); 46 | } 47 | } 48 | 49 | // Max heap used, % 50 | // Component/V1/Summary/Jvm/Mem/MaxHeapUsedPercent 51 | agent.reportMetric("V1/Summary/Jvm/Mem/MaxHeapUsedPercent", "percent", maxHeapPercent); 52 | } 53 | 54 | private String nodeMetricName(String metricName, String nodeName) { 55 | return metricName + "/" + nodeName; 56 | } 57 | 58 | private void reportNodeMetric(String metricName, String units, String nodeName, Number value) 59 | { 60 | agent.reportMetric(nodeMetricName(metricName, nodeName), units, value); 61 | } 62 | 63 | private void reportNodeProcessedMetric(String metricName, String units, String nodeName, Number value) 64 | { 65 | Number processedValue = processorFactory.getProcessorForNode(metricName, nodeName).process(value); 66 | reportNodeMetric(metricName, units, nodeName, processedValue); 67 | } 68 | 69 | private void reportProcessedMetric(String metricName, String units, Number value) 70 | { 71 | Number processedValue = processorFactory.getProcessor(metricName).process(value); 72 | agent.reportMetric(metricName, units, processedValue); 73 | } 74 | 75 | private void reportNodeStats(NodesStats.NodeStats nodeStats) { 76 | String nodeName = nodeStats.name; 77 | 78 | reportGeneral(nodeStats, nodeName); 79 | reportIndexing(nodeStats, nodeName); 80 | reportSearch(nodeStats, nodeName); 81 | reportMerges(nodeStats, nodeName); 82 | reportCache(nodeStats, nodeName); 83 | reportSystem(nodeStats, nodeName); 84 | reportJvm(nodeStats, nodeName); 85 | reportIo(nodeStats, nodeName); 86 | reportNetwork(nodeStats, nodeName); 87 | reportThreadPool(nodeStats, nodeName); 88 | } 89 | 90 | /** 91 | * Thread pool 92 | */ 93 | private void reportThreadPool(NodesStats.NodeStats nodeStats, String nodeName) { 94 | if (nodeStats.thread_pool != null) { 95 | // Search 96 | // Component/V1/NodeStats/ThreadPool/Search/Completed/* 97 | reportNodeProcessedMetric("V1/NodeStats/ThreadPool/Search/Completed", "threads/second", nodeName, 98 | nodeStats.thread_pool.search.completed); 99 | 100 | // Search: queue 101 | // Component/V1/NodeStats/ThreadPool/Search/Queue/* 102 | reportNodeMetric("V1/NodeStats/ThreadPool/Search/Queue", "threads", nodeName, 103 | nodeStats.thread_pool.search.queue); 104 | 105 | // Search: rejected 106 | // Component/V1/NodeStats/ThreadPool/Search/Rejected/* 107 | reportNodeProcessedMetric("V1/NodeStats/ThreadPool/Search/Rejected", "threads/second", nodeName, 108 | nodeStats.thread_pool.search.rejected); 109 | 110 | // Get 111 | // Component/V1/NodeStats/ThreadPool/Get/Completed/* 112 | reportNodeProcessedMetric("V1/NodeStats/ThreadPool/Get/Completed", "threads/second", nodeName, 113 | nodeStats.thread_pool.get.completed); 114 | 115 | // Get: queue 116 | // Component/V1/NodeStats/ThreadPool/Get/Queue/* 117 | reportNodeMetric("V1/NodeStats/ThreadPool/Get/Queue", "threads", nodeName, 118 | nodeStats.thread_pool.get.queue); 119 | 120 | // Get: rejected 121 | // Component/V1/NodeStats/ThreadPool/Get/Rejected/* 122 | reportNodeProcessedMetric("V1/NodeStats/ThreadPool/Get/Rejected", "threads/second", nodeName, 123 | nodeStats.thread_pool.get.rejected); 124 | 125 | if(nodeStats.thread_pool.suggest != null) { 126 | // Suggest 127 | // Component/V1/NodeStats/ThreadPool/Suggest/Completed/* 128 | reportNodeProcessedMetric("V1/NodeStats/ThreadPool/Suggest/Completed", "threads/second", nodeName, 129 | nodeStats.thread_pool.suggest.completed); 130 | 131 | // Suggest: queue 132 | // Component/V1/NodeStats/ThreadPool/Suggest/Queue/* 133 | reportNodeMetric("V1/NodeStats/ThreadPool/Suggest/Queue", "threads", nodeName, 134 | nodeStats.thread_pool.suggest.queue); 135 | 136 | // Suggest: rejected 137 | // Component/V1/NodeStats/ThreadPool/Suggest/Rejected/* 138 | reportNodeProcessedMetric("V1/NodeStats/ThreadPool/Suggest/Rejected", "threads/second", nodeName, 139 | nodeStats.thread_pool.suggest.rejected); 140 | 141 | // Index 142 | // Component/V1/NodeStats/ThreadPool/Index/Completed/* 143 | reportNodeProcessedMetric("V1/NodeStats/ThreadPool/Index/Completed", "threads/second", nodeName, 144 | nodeStats.thread_pool.index.completed); 145 | 146 | // Index queue 147 | // Component/V1/NodeStats/ThreadPool/Index/Queue/* 148 | reportNodeMetric("V1/NodeStats/ThreadPool/Index/Queue", "threads", nodeName, 149 | nodeStats.thread_pool.index.queue); 150 | 151 | // Index rejected 152 | // Component/V1/NodeStats/ThreadPool/Index/Rejected/* 153 | reportNodeProcessedMetric("V1/NodeStats/ThreadPool/Index/Rejected", "threads/second", nodeName, 154 | nodeStats.thread_pool.index.rejected); 155 | } 156 | 157 | if (nodeStats.thread_pool.force_merge != null) { 158 | // Merge 159 | // Component/V1/NodeStats/ThreadPool/Merge/Completed/* 160 | reportNodeProcessedMetric("V1/NodeStats/ThreadPool/Merge/Completed", "threads/second", nodeName, 161 | nodeStats.thread_pool.force_merge.completed); 162 | 163 | // Merge: queue 164 | // Component/V1/NodeStats/ThreadPool/Merge/Queue/* 165 | reportNodeMetric("V1/NodeStats/ThreadPool/Merge/Queue", "threads", nodeName, 166 | nodeStats.thread_pool.force_merge.queue); 167 | 168 | // Merge: rejected 169 | // Component/V1/NodeStats/ThreadPool/Merge/Rejected/* 170 | reportNodeProcessedMetric("V1/NodeStats/ThreadPool/Merge/Rejected", "threads/second", nodeName, 171 | nodeStats.thread_pool.force_merge.rejected); 172 | } else if (nodeStats.thread_pool.merge != null) { 173 | // Merge 174 | // Component/V1/NodeStats/ThreadPool/Merge/Completed/* 175 | reportNodeProcessedMetric("V1/NodeStats/ThreadPool/Merge/Completed", "threads/second", nodeName, 176 | nodeStats.thread_pool.merge.completed); 177 | 178 | // Merge: queue 179 | // Component/V1/NodeStats/ThreadPool/Merge/Queue/* 180 | reportNodeMetric("V1/NodeStats/ThreadPool/Merge/Queue", "threads", nodeName, 181 | nodeStats.thread_pool.merge.queue); 182 | 183 | // Merge: rejected 184 | // Component/V1/NodeStats/ThreadPool/Merge/Rejected/* 185 | reportNodeProcessedMetric("V1/NodeStats/ThreadPool/Merge/Rejected", "threads/second", nodeName, 186 | nodeStats.thread_pool.merge.rejected); 187 | } 188 | 189 | if (nodeStats.thread_pool.bulk != null) { 190 | // Bulk 191 | // Component/V1/NodeStats/ThreadPool/Bulk/Completed/* 192 | reportNodeProcessedMetric("V1/NodeStats/ThreadPool/Bulk/Completed", "threads/second", nodeName, 193 | nodeStats.thread_pool.bulk.completed); 194 | 195 | // Bulk: queue 196 | // Component/V1/NodeStats/ThreadPool/Bulk/Queue/* 197 | reportNodeMetric("V1/NodeStats/ThreadPool/Bulk/Queue", "threads", nodeName, 198 | nodeStats.thread_pool.bulk.queue); 199 | 200 | // Bulk: rejected 201 | // Component/V1/NodeStats/ThreadPool/Bulk/Rejected/* 202 | reportNodeProcessedMetric("V1/NodeStats/ThreadPool/Bulk/Rejected", "threads/second", nodeName, 203 | nodeStats.thread_pool.bulk.rejected); 204 | } 205 | 206 | // Warmer 207 | // Component/V1/NodeStats/ThreadPool/Warmer/Completed/* 208 | reportNodeProcessedMetric("V1/NodeStats/ThreadPool/Warmer/Completed", "threads/second", nodeName, 209 | nodeStats.thread_pool.warmer.completed); 210 | 211 | // Warmer: queue 212 | // Component/V1/NodeStats/ThreadPool/Warmer/Queue/* 213 | reportNodeMetric("V1/NodeStats/ThreadPool/Warmer/Queue", "threads", nodeName, 214 | nodeStats.thread_pool.warmer.queue); 215 | 216 | // Warmer: rejected 217 | // Component/V1/NodeStats/ThreadPool/Warmer/Rejected/* 218 | reportNodeProcessedMetric("V1/NodeStats/ThreadPool/Warmer/Rejected", "threads/second", nodeName, 219 | nodeStats.thread_pool.warmer.rejected); 220 | 221 | // Flush 222 | // Component/V1/NodeStats/ThreadPool/Flush/Completed/* 223 | reportNodeProcessedMetric("V1/NodeStats/ThreadPool/Flush/Completed", "threads/second", nodeName, 224 | nodeStats.thread_pool.flush.completed); 225 | 226 | // Flush: queue 227 | // Component/V1/NodeStats/ThreadPool/Flush/Queue/* 228 | reportNodeMetric("V1/NodeStats/ThreadPool/Flush/Queue", "threads", nodeName, 229 | nodeStats.thread_pool.flush.queue); 230 | 231 | // Flush: rejected 232 | // Component/V1/NodeStats/ThreadPool/Flush/Rejected/* 233 | reportNodeProcessedMetric("V1/NodeStats/ThreadPool/Flush/Rejected", "threads/second", nodeName, 234 | nodeStats.thread_pool.flush.rejected); 235 | 236 | // Refresh 237 | // Component/V1/NodeStats/ThreadPool/Refresh/Completed/* 238 | reportNodeProcessedMetric("V1/NodeStats/ThreadPool/Refresh/Completed", "threads/second", nodeName, 239 | nodeStats.thread_pool.refresh.completed); 240 | 241 | // Refresh: queue 242 | // Component/V1/NodeStats/ThreadPool/Refresh/Queue/* 243 | reportNodeMetric("V1/NodeStats/ThreadPool/Refresh/Queue", "threads", nodeName, 244 | nodeStats.thread_pool.refresh.queue); 245 | 246 | // Refresh: rejected 247 | // Component/V1/NodeStats/ThreadPool/Refresh/Rejected/* 248 | reportNodeProcessedMetric("V1/NodeStats/ThreadPool/Refresh/Rejected", "threads/second", nodeName, 249 | nodeStats.thread_pool.refresh.rejected); 250 | } 251 | } 252 | 253 | /** 254 | * Network 255 | */ 256 | private void reportNetwork(NodesStats.NodeStats nodeStats, String nodeName) { 257 | if (nodeStats.transport != null) { 258 | // Opened transport connections 259 | // Component/V1/NodeStats/Transport/ServerOpen/* 260 | reportNodeMetric("V1/NodeStats/Transport/ServerOpen", "connections", nodeName, 261 | nodeStats.transport.server_open); 262 | 263 | // Transmit 264 | // Component/V1/NodeStats/Transport/TxSizeInBytes/* 265 | reportNodeProcessedMetric("V1/NodeStats/Transport/TxSizeInBytes", "bytes/second", nodeName, 266 | nodeStats.transport.tx_size_in_bytes); 267 | 268 | // Receive 269 | // Component/V1/NodeStats/Transport/RxSizeInBytes/* 270 | reportNodeProcessedMetric("V1/NodeStats/Transport/RxSizeInBytes", "bytes/second", nodeName, 271 | nodeStats.transport.rx_size_in_bytes); 272 | } 273 | 274 | if (nodeStats.http != null) { 275 | // Client connections 276 | // Component/V1/NodeStats/Http/CurrentOpen/* 277 | reportNodeMetric("V1/NodeStats/Http/CurrentOpen", "connections", nodeName, 278 | nodeStats.http.current_open); 279 | } 280 | } 281 | 282 | /** 283 | * I/O 284 | */ 285 | private void reportIo(NodesStats.NodeStats nodeStats, String nodeName) { 286 | if (nodeStats.fs != null) { 287 | // Disk reads 288 | // Component/V1/NodeStats/Fs/Total/DiskReadSizeInBytes/* 289 | reportNodeProcessedMetric("V1/NodeStats/Fs/Total/DiskReadSizeInBytes", "bytes/second", nodeName, 290 | nodeStats.fs.total.disk_read_size_in_bytes); 291 | 292 | // Disk writes 293 | // Component/V1/NodeStats/Fs/Total/DiskWriteSizeInBytes/* 294 | reportNodeProcessedMetric("V1/NodeStats/Fs/Total/DiskWriteSizeInBytes", "bytes/second", nodeName, 295 | nodeStats.fs.total.disk_write_size_in_bytes); 296 | 297 | // Open file descriptors 298 | // Component/V1/NodeStats/Process/OpenFileDescriptors/* 299 | reportNodeMetric("V1/NodeStats/Process/OpenFileDescriptors", "descriptors", nodeName, 300 | nodeStats.process.open_file_descriptors); 301 | 302 | // Store throttle time 303 | // Component/V1/NodeStats/Indices/Store/ThrottleTimeInMillis/* 304 | reportNodeProcessedMetric("V1/NodeStats/Indices/Store/ThrottleTimeInMillis", "milliseconds", nodeName, 305 | nodeStats.indices.store.throttle_time_in_millis); 306 | } 307 | } 308 | 309 | /** 310 | * JVM 311 | */ 312 | private void reportJvm(NodesStats.NodeStats nodeStats, String nodeName) { 313 | if (nodeStats.jvm != null) { 314 | // Heap used, % 315 | // Component/V1/NodeStats/Jvm/Mem/HeapUsedPercent/* 316 | reportNodeMetric("V1/NodeStats/Jvm/Mem/HeapUsedPercent", "percent", nodeName, 317 | nodeStats.jvm.mem.heap_used_percent); 318 | 319 | // Heap used, bytes 320 | // Component/V1/NodeStats/Jvm/Mem/HeapUsedInBytes/* 321 | reportNodeMetric("V1/NodeStats/Jvm/Mem/HeapUsedInBytes", "bytes", nodeName, 322 | nodeStats.jvm.mem.heap_used_in_bytes); 323 | 324 | // Non-Heap used, bytes 325 | // Component/V1/NodeStats/Jvm/Mem/NonHeapUsedInBytes/* 326 | reportNodeMetric("V1/NodeStats/Jvm/Mem/NonHeapUsedInBytes", "bytes", nodeName, 327 | nodeStats.jvm.mem.non_heap_used_in_bytes); 328 | 329 | // GC collections (old) 330 | // Component/V1/NodeStats/Jvm/Gc/Old/CollectionCount/* 331 | reportNodeProcessedMetric("V1/NodeStats/Jvm/Gc/Old/CollectionCount", "collections/second", nodeName, 332 | nodeStats.jvm.gc.collectors.old.collection_count); 333 | 334 | // GC collection time (old) 335 | // Component/V1/NodeStats/Jvm/Gc/Old/CollectionTime/* 336 | reportNodeProcessedMetric("V1/NodeStats/Jvm/Gc/Old/CollectionTime", "milliseconds", nodeName, 337 | nodeStats.jvm.gc.collectors.old.collection_time_in_millis); 338 | 339 | // GC collections (young) 340 | // Component/V1/NodeStats/Jvm/Gc/Young/CollectionCount/* 341 | reportNodeProcessedMetric("V1/NodeStats/Jvm/Gc/Young/CollectionCount", "collections/second", nodeName, 342 | nodeStats.jvm.gc.collectors.young.collection_count); 343 | 344 | // GC collection time (young) 345 | // Component/V1/NodeStats/Jvm/Gc/Young/CollectionTime/* 346 | reportNodeProcessedMetric("V1/NodeStats/Jvm/Gc/Young/CollectionTime", "milliseconds", nodeName, 347 | nodeStats.jvm.gc.collectors.young.collection_time_in_millis); 348 | 349 | // JVM uptime 350 | // Component/V1/NodeStats/Jvm/UptimeInMillis/* 351 | reportNodeMetric("V1/NodeStats/Jvm/UptimeInMillis", "milliseconds", nodeName, nodeStats.jvm.uptime_in_millis); 352 | } 353 | } 354 | 355 | /** 356 | * System 357 | */ 358 | private void reportSystem(NodesStats.NodeStats nodeStats, String nodeName) { 359 | if (nodeStats.os == null) { 360 | return; 361 | } 362 | 363 | if (nodeStats.process != null && nodeStats.process.cpu != null && nodeStats.process.cpu.percent != null) { 364 | // CPU used, % 365 | // Component/V1/NodeStats/Os/Cpu/Usage/* 366 | reportNodeMetric("V1/NodeStats/Os/Cpu/Usage", "percent", nodeName, nodeStats.process.cpu.percent); 367 | } 368 | 369 | if (nodeStats.os.mem != null) { 370 | // Memory used, % 371 | // Component/V1/NodeStats/Os/Mem/UsedPercent/* 372 | reportNodeMetric("V1/NodeStats/Os/Mem/UsedPercent", "percent", nodeName, 373 | nodeStats.os.mem.used_percent); 374 | 375 | // Memory used 376 | // Component/V1/NodeStats/Os/Mem/UsedInBytes/* 377 | reportNodeMetric("V1/NodeStats/Os/Mem/UsedInBytes", "bytes", nodeName, 378 | nodeStats.os.mem.used_in_bytes); 379 | } 380 | 381 | // Load average 382 | // Component/V1/NodeStats/Os/LoadAverage/* 383 | if (nodeStats.os.getLoadAverage() != null) { 384 | reportNodeMetric("V1/NodeStats/Os/LoadAverage", "units", nodeName, nodeStats.os.getLoadAverage()); 385 | } 386 | 387 | // Uptime 388 | // Component/V1/NodeStats/Os/UptimeInMillis/* 389 | if (nodeStats.os.uptime_in_millis != null) { 390 | reportNodeMetric("V1/NodeStats/Os/UptimeInMillis", "milliseconds", nodeName, 391 | nodeStats.os.uptime_in_millis); 392 | } 393 | 394 | if (nodeStats.os.swap != null) { 395 | // Swap usage 396 | // Component/V1/NodeStats/Os/Swap/Percent/* 397 | Long swapUsed = 0l; 398 | if (nodeStats.os.swap.used_in_bytes != null && nodeStats.os.swap.free_in_bytes != null) { 399 | Long swapTotal = nodeStats.os.swap.used_in_bytes.longValue() + nodeStats.os.swap.free_in_bytes.longValue(); 400 | swapUsed = swapTotal > 0 401 | ? nodeStats.os.swap.used_in_bytes.longValue() / swapTotal 402 | : 0; 403 | } 404 | reportNodeMetric("V1/NodeStats/Os/Swap/Percent", "percent", nodeName, swapUsed); 405 | } 406 | } 407 | 408 | /** 409 | * Cache 410 | */ 411 | private void reportCache(NodesStats.NodeStats nodeStats, String nodeName) { 412 | if (nodeStats.indices.filter_cache != null) { 413 | // Filter cache 414 | // Component/V1/NodeStats/Indices/FilterCache/Size/* 415 | reportNodeMetric("V1/NodeStats/Indices/FilterCache/Size", "bytes", nodeName, 416 | nodeStats.indices.filter_cache.memory_size_in_bytes); 417 | 418 | // Filter evictions 419 | // Component/V1/NodeStats/Indices/FilterCache/Evictions/* 420 | reportNodeProcessedMetric("V1/NodeStats/Indices/FilterCache/Evictions", "evictions/second", nodeName, 421 | nodeStats.indices.filter_cache.evictions); 422 | } 423 | 424 | if (nodeStats.indices.fielddata != null) { 425 | // Field data 426 | // Component/V1/NodeStats/Indices/Fielddata/Size/* 427 | reportNodeMetric("V1/NodeStats/Indices/Fielddata/Size", "bytes", nodeName, 428 | nodeStats.indices.fielddata.memory_size_in_bytes); 429 | 430 | // Field evictions 431 | // Component/V1/NodeStats/Indices/Fielddata/Evictions/* 432 | reportNodeProcessedMetric("V1/NodeStats/Indices/Fielddata/Evictions", "evictions/second", nodeName, 433 | nodeStats.indices.fielddata.evictions); 434 | } 435 | 436 | if (nodeStats.indices.id_cache != null) { 437 | // Id cache 438 | // Component/V1/NodeStats/Indices/IdCache/Size/* 439 | reportNodeMetric("V1/NodeStats/Indices/IdCache/Size", "bytes", nodeName, 440 | nodeStats.indices.id_cache.memory_size_in_bytes); 441 | } 442 | 443 | if (nodeStats.indices.completion != null) { 444 | // Completion 445 | // Component/V1/NodeStats/Indices/Completion/Size/* 446 | reportNodeMetric("V1/NodeStats/Indices/Completion/Size", "bytes", nodeName, 447 | nodeStats.indices.completion.size_in_bytes); 448 | } 449 | } 450 | 451 | /** 452 | * Merges 453 | */ 454 | private void reportMerges(NodesStats.NodeStats nodeStats, String nodeName) { 455 | if (nodeStats.indices.merges != null) { 456 | // Merges 457 | // Component/V1/NodeStats/Indices/Merges/Total/* 458 | reportNodeProcessedMetric("V1/NodeStats/Indices/Merges/Total", "merges/second", nodeName, 459 | nodeStats.indices.merges.total); 460 | 461 | // Merge size 462 | // Component/V1/NodeStats/Indices/Merges/TotalSizeInBytes/* 463 | reportNodeProcessedMetric("V1/NodeStats/Indices/Merges/TotalSizeInBytes", "bytes/second", nodeName, 464 | nodeStats.indices.merges.total_size_in_bytes); 465 | 466 | // Merge time 467 | // Component/V1/NodeStats/Indices/Merges/TotalTimeInMillis/* 468 | reportNodeProcessedMetric("V1/NodeStats/Indices/Merges/TotalTimeInMillis", "milliseconds", nodeName, 469 | nodeStats.indices.merges.total_time_in_millis); 470 | 471 | // Merged docs 472 | // Component/V1/NodeStats/Indices/Merges/TotalDocs/* 473 | reportNodeProcessedMetric("V1/NodeStats/Indices/Merges/TotalDocs", "docs/second", nodeName, 474 | nodeStats.indices.merges.total_docs); 475 | } 476 | 477 | if (nodeStats.indices.segments != null) { 478 | // Component/V1/NodeStats/Indices/Segments/Count/* 479 | reportNodeMetric("V1/NodeStats/Indices/Segments/Count", "segments", nodeName, 480 | nodeStats.indices.segments.count); 481 | } 482 | } 483 | 484 | /** 485 | * Search 486 | */ 487 | private void reportSearch(NodesStats.NodeStats nodeStats, String nodeName) { 488 | // Query 489 | // Component/V1/NodeStats/Indices/Search/QueryTotal/* 490 | reportNodeProcessedMetric("V1/NodeStats/Indices/Search/QueryTotal", "requests/second", nodeName, 491 | nodeStats.indices.search.query_total); 492 | 493 | // Query time 494 | // Component/V1/NodeStats/Indices/Search/QueryTimeInMillis/* 495 | reportNodeProcessedMetric("V1/NodeStats/Indices/Search/QueryTimeInMillis", "milliseconds", nodeName, 496 | nodeStats.indices.search.query_time_in_millis); 497 | 498 | // Fetch 499 | // Component/V1/NodeStats/Indices/Search/FetchTotal/* 500 | reportNodeProcessedMetric("V1/NodeStats/Indices/Search/FetchTotal", "requests/second", nodeName, 501 | nodeStats.indices.search.fetch_total); 502 | 503 | // Fetch time 504 | // Component/V1/NodeStats/Indices/Search/FetchTimeInMillis/* 505 | reportNodeProcessedMetric("V1/NodeStats/Indices/Search/FetchTimeInMillis", "milliseconds", nodeName, 506 | nodeStats.indices.search.fetch_time_in_millis); 507 | 508 | // Get 509 | // Component/V1/NodeStats/Indices/Get/Total/* 510 | reportNodeProcessedMetric("V1/NodeStats/Indices/Get/Total", "requests/second", nodeName, 511 | nodeStats.indices.get.total); 512 | 513 | // Get time 514 | // Component/V1/NodeStats/Indices/Get/TimeInMillis/* 515 | reportNodeProcessedMetric("V1/NodeStats/Indices/Get/TimeInMillis", "milliseconds", nodeName, 516 | nodeStats.indices.get.time_in_millis); 517 | 518 | if (nodeStats.indices.suggest != null) { 519 | // Suggest 520 | // Component/V1/NodeStats/Indices/Suggest/Total/* 521 | reportNodeProcessedMetric("V1/NodeStats/Indices/Suggest/Total", "requests/second", nodeName, 522 | nodeStats.indices.suggest.total); 523 | 524 | // Suggest time 525 | // Component/V1/NodeStats/Indices/Suggest/TimeInMillis/* 526 | reportNodeProcessedMetric("V1/NodeStats/Indices/Suggest/TimeInMillis", "milliseconds", nodeName, 527 | nodeStats.indices.suggest.time_in_millis); 528 | } 529 | } 530 | 531 | /** 532 | * Indexing 533 | */ 534 | private void reportIndexing(NodesStats.NodeStats nodeStats, String nodeName) { 535 | // Index 536 | // Component/V1/NodeStats/Indices/Indexing/Index/* 537 | reportNodeProcessedMetric("V1/NodeStats/Indices/Indexing/Index", "operations/second", nodeName, 538 | nodeStats.indices.indexing.index_total); 539 | 540 | // Index time 541 | // Component/V1/NodeStats/Indices/Indexing/IndexTimeInMillis/* 542 | reportNodeProcessedMetric("V1/NodeStats/Indices/Indexing/IndexTimeInMillis", "milliseconds", nodeName, 543 | nodeStats.indices.indexing.index_time_in_millis); 544 | 545 | // Delete 546 | // Component/V1/NodeStats/Indices/Indexing/DeleteTotal/* 547 | reportNodeProcessedMetric("V1/NodeStats/Indices/Indexing/DeleteTotal", "operations/second", nodeName, 548 | nodeStats.indices.indexing.delete_total); 549 | 550 | // Delete time 551 | // Component/V1/NodeStats/Indices/Indexing/DeleteTimeInMillis/* 552 | reportNodeProcessedMetric("V1/NodeStats/Indices/Indexing/DeleteTimeInMillis", "milliseconds", nodeName, 553 | nodeStats.indices.indexing.delete_time_in_millis); 554 | 555 | if (nodeStats.indices.refresh != null) { 556 | // Refresh 557 | // Component/V1/NodeStats/Indices/Refresh/Total/* 558 | reportNodeProcessedMetric("V1/NodeStats/Indices/Refresh/Total", "operations/second", nodeName, 559 | nodeStats.indices.refresh.total); 560 | 561 | // Refresh time 562 | // Component/V1/NodeStats/Indices/Refresh/TotalTimeInMillis/* 563 | reportNodeProcessedMetric("V1/NodeStats/Indices/Refresh/TotalTimeInMillis", "milliseconds", nodeName, 564 | nodeStats.indices.refresh.total_time_in_millis); 565 | } 566 | 567 | if (nodeStats.indices.flush != null) { 568 | // Flush 569 | // Component/V1/NodeStats/Indices/Flush/Total/* 570 | reportNodeProcessedMetric("V1/NodeStats/Indices/Flush/Total", "operations/second", nodeName, 571 | nodeStats.indices.flush.total); 572 | 573 | // Flush time 574 | // Component/V1/NodeStats/Indices/Flush/TotalTimeInMillis/* 575 | reportNodeProcessedMetric("V1/NodeStats/Indices/Flush/TotalTimeInMillis", "milliseconds", nodeName, 576 | nodeStats.indices.flush.total_time_in_millis); 577 | } 578 | 579 | if (nodeStats.indices.warmer != null) { 580 | // Warmer 581 | // Component/V1/NodeStats/Indices/Warmer/Total/* 582 | reportNodeProcessedMetric("V1/NodeStats/Indices/Warmer/Total", "operations/second", nodeName, 583 | nodeStats.indices.warmer.total); 584 | 585 | // Warmer time 586 | // Component/V1/NodeStats/Indices/Warmer/TotalTimeInMillis/* 587 | reportNodeProcessedMetric("V1/NodeStats/Indices/Warmer/TotalTimeInMillis", "milliseconds", nodeName, 588 | nodeStats.indices.warmer.total_time_in_millis); 589 | } 590 | } 591 | 592 | /** 593 | * Nodes 594 | */ 595 | private void reportGeneral(NodesStats.NodeStats nodeStats, String nodeName) { 596 | // Documents 597 | // Component/V1/NodeStats/Nodes/Indices/Docs/Count/* 598 | reportNodeMetric("V1/NodeStats/Nodes/Indices/Docs/Count", "documents", nodeName, 599 | nodeStats.indices.docs.count); 600 | 601 | // Store size 602 | // Component/V1/NodeStats/Indices/Store/Size/* 603 | reportNodeMetric("V1/NodeStats/Indices/Store/Size", "bytes", nodeName, 604 | nodeStats.indices.store.size_in_bytes); 605 | 606 | // Deleted documents 607 | // Component/V1/NodeStats/Nodes/Indices/Docs/Deleted/* 608 | reportNodeMetric("V1/NodeStats/Nodes/Indices/Docs/Deleted", "documents", nodeName, 609 | nodeStats.indices.docs.deleted); 610 | } 611 | } 612 | -------------------------------------------------------------------------------- /src/main/java/me/snov/newrelic/elasticsearch/responses/ClusterStats.java: -------------------------------------------------------------------------------- 1 | package me.snov.newrelic.elasticsearch.responses; 2 | 3 | import java.util.ArrayList; 4 | 5 | public class ClusterStats { 6 | public static class Indices { 7 | public static class Shards { 8 | public static class Index { 9 | public static class IndexStats { 10 | public Number min; 11 | public Number max; 12 | public Number avg; 13 | } 14 | 15 | public IndexStats shards; 16 | public IndexStats primaries; 17 | public IndexStats replication; 18 | } 19 | 20 | public Number total; 21 | public Number primaries; 22 | public Number replication; 23 | } 24 | public static class Docs { 25 | public Number count; 26 | public Number deleted; 27 | } 28 | public static class Store { 29 | public Number size_in_bytes; 30 | public Number throttle_time_in_millis; 31 | } 32 | public static class Fielddata { 33 | public Number memory_size_in_bytes; 34 | public Number evictions; 35 | } 36 | public static class FilterCache { 37 | public Number memory_size_in_bytes; 38 | public Number evictions; 39 | } 40 | public static class IdCache { 41 | public Number memory_size_in_bytes; 42 | } 43 | public static class Completion { 44 | public Number size_in_bytes; 45 | } 46 | public static class Segments { 47 | public Number count; 48 | public Number memory_in_bytes; 49 | public Number index_writer_memory_in_bytes; 50 | public Number index_writer_max_memory_in_bytes; 51 | public Number version_map_memory_in_bytes; 52 | public Number fixed_bit_set_memory_in_bytes; 53 | } 54 | public static class Percolate { 55 | public Number total; 56 | public Number time_in_millis; 57 | public Number current; 58 | public Number memory_size_in_bytes; 59 | public String memory_size; 60 | public Number queries; 61 | } 62 | 63 | public Number count; 64 | 65 | public Shards shards; 66 | public Docs docs; 67 | public Store store; 68 | public Fielddata fielddata; 69 | public FilterCache filter_cache; 70 | public IdCache id_cache; 71 | public Completion completion; 72 | public Segments segments; 73 | public Percolate percolate; 74 | } 75 | 76 | public static class Nodes { 77 | public static class Count { 78 | public Number total; 79 | public Number master_only; 80 | public Number data_only; 81 | public Number master_data; 82 | public Number client; 83 | } 84 | 85 | public Count count; 86 | public ArrayList versions; 87 | } 88 | 89 | public String status; 90 | public String cluster_name; 91 | public Indices indices; 92 | public Nodes nodes; 93 | } 94 | -------------------------------------------------------------------------------- /src/main/java/me/snov/newrelic/elasticsearch/responses/NodesStats.java: -------------------------------------------------------------------------------- 1 | package me.snov.newrelic.elasticsearch.responses; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | public class NodesStats { 8 | public static class NodeStats { 9 | public static class Indices { 10 | public static class Docs { 11 | public Number count; 12 | public Number deleted; 13 | } 14 | public static class Store { 15 | public Number size_in_bytes; 16 | public Number throttle_time_in_millis; 17 | } 18 | public static class Indexing { 19 | public Number index_total; 20 | public Number index_time_in_millis; 21 | public Number index_current; 22 | public Number delete_total; 23 | public Number delete_time_in_millis; 24 | public Number delete_current; 25 | public Number noop_update_total; 26 | public Boolean is_throttled; 27 | public Number throttle_time_in_millis; 28 | } 29 | public static class Get { 30 | public Number total; 31 | public Number time_in_millis; 32 | public Number exists_total; 33 | public Number exists_time_in_millis; 34 | public Number missing_total; 35 | public Number missing_time_in_millis; 36 | public Number current; 37 | } 38 | public static class Search { 39 | public Number open_contexts; 40 | public Number query_total; 41 | public Number query_time_in_millis; 42 | public Number query_current; 43 | public Number fetch_total; 44 | public Number fetch_time_in_millis; 45 | public Number fetch_current; 46 | } 47 | public static class Merges { 48 | public Number current; 49 | public Number current_docs; 50 | public Number current_size_in_bytes; 51 | public Number total; 52 | public Number total_time_in_millis; 53 | public Number total_docs; 54 | public Number total_size_in_bytes; 55 | } 56 | public static class Refresh { 57 | public Number total; 58 | public Number total_time_in_millis; 59 | } 60 | public static class Flush { 61 | public Number total; 62 | public Number total_time_in_millis; 63 | } 64 | public static class Warmer { 65 | public Number current; 66 | public Number total; 67 | public Number total_time_in_millis; 68 | } 69 | public static class FilterCache { 70 | public Number memory_size_in_bytes; 71 | public Number evictions; 72 | } 73 | public static class IdCache { 74 | public Number memory_size_in_bytes; 75 | } 76 | public static class Fielddata { 77 | public Number memory_size_in_bytes; 78 | public Number evictions; 79 | } 80 | public static class Percolate { 81 | public Number total; 82 | public Number time_in_millis; 83 | public Number current; 84 | public Number memory_size_in_bytes; 85 | public String memory_size; 86 | public Number queries; 87 | } 88 | public static class Completion { 89 | public Number size_in_bytes; 90 | } 91 | public static class Segments { 92 | public Number count; 93 | public Number memory_in_bytes; 94 | public Number index_writer_memory_in_bytes; 95 | public Number index_writer_max_memory_in_bytes; 96 | public Number version_map_memory_in_bytes; 97 | public Number fixed_bit_set_memory_in_bytes; 98 | } 99 | public static class Translog { 100 | public Number operations; 101 | public Number size_in_bytes; 102 | } 103 | public static class Suggest { 104 | public Number total; 105 | public Number time_in_millis; 106 | public Number current; 107 | } 108 | public static class QueryCache { 109 | public Number memory_size_in_bytes; 110 | public Number evictions; 111 | public Number hit_count; 112 | public Number miss_count; 113 | } 114 | 115 | public Docs docs; 116 | public Store store; 117 | public Indexing indexing; 118 | public Get get; 119 | public Search search; 120 | public Merges merges; 121 | public Refresh refresh; 122 | public Flush flush; 123 | public Warmer warmer; 124 | public FilterCache filter_cache; 125 | public IdCache id_cache; 126 | public Fielddata fielddata; 127 | public Percolate percolate; 128 | public Completion completion; 129 | public Segments segments; 130 | public Translog translog; 131 | public Suggest suggest; 132 | public QueryCache query_cache; 133 | } 134 | public static class Os { 135 | public static class Cpu { 136 | public Number sys; 137 | public Number user; 138 | public Number idle; 139 | public Number usage; 140 | public Number stolen; 141 | } 142 | public static class Mem { 143 | public Number free_in_bytes; 144 | public Number used_in_bytes; 145 | public Number free_percent; 146 | public Number used_percent; 147 | public Number actual_free_in_bytes; 148 | public Number actual_used_in_bytes; 149 | } 150 | public static class Swap { 151 | public Number used_in_bytes; 152 | public Number free_in_bytes; 153 | } 154 | 155 | public Number uptime_in_millis; 156 | private Object load_average; 157 | public Cpu cpu; 158 | public Mem mem; 159 | public Swap swap; 160 | 161 | public Number getLoadAverage() { 162 | if (load_average instanceof List && ((List) load_average).size() > 0) { 163 | return ((List) load_average).get(0); 164 | } else if (load_average instanceof Number) { 165 | return (Number) load_average; 166 | } else { 167 | return null; 168 | } 169 | } 170 | } 171 | public static class Process { 172 | public static class Cpu { 173 | public Number percent; 174 | public Number sys_in_millis; 175 | public Number user_in_millis; 176 | public Number total_in_millis; 177 | } 178 | public static class Mem { 179 | public Number resident_in_bytes; 180 | public Number share_in_bytes; 181 | public Number total_virtual_in_bytes; 182 | } 183 | 184 | public Number open_file_descriptors; 185 | public Cpu cpu; 186 | public Mem mem; 187 | 188 | } 189 | public static class Jvm { 190 | public static class Mem { 191 | public Number heap_used_in_bytes; 192 | public Number heap_used_percent; 193 | public Number heap_committed_in_bytes; 194 | public Number non_heap_used_in_bytes; 195 | public Number non_heap_committed_in_bytes; 196 | } 197 | public static class Pools { 198 | public static class PoolStats { 199 | public Number used_in_bytes; 200 | public Number max_in_bytes; 201 | public Number peak_used_in_bytes; 202 | public Number peak_max_in_bytes; 203 | } 204 | 205 | public PoolStats young; 206 | public PoolStats survivor; 207 | public PoolStats old; 208 | } 209 | public static class Threads { 210 | public Number count; 211 | public Number peak_count; 212 | } 213 | public static class Gc { 214 | public static class GcCollectors { 215 | public static class GcCollector { 216 | public Number collection_count; 217 | public Number collection_time_in_millis; 218 | } 219 | 220 | public GcCollector young; 221 | public GcCollector old; 222 | } 223 | public GcCollectors collectors; 224 | } 225 | public static class BufferPools { 226 | public static class BufferPoolStats { 227 | public Number count; 228 | public Number used_in_bytes; 229 | public Number total_capacity_in_bytes; 230 | } 231 | 232 | public BufferPoolStats direct; 233 | public BufferPoolStats mapped; 234 | } 235 | 236 | public Number uptime_in_millis; 237 | public Mem mem; 238 | public Pools pools; 239 | public Threads threads; 240 | public Gc gc; 241 | public BufferPools buffer_pools; 242 | } 243 | public static class ThreadPool { 244 | public static class ThreadPoolStats { 245 | public Number threads; 246 | public Number queue; 247 | public Number active; 248 | public Number rejected; 249 | public Number largest; 250 | public Number completed; 251 | } 252 | 253 | public ThreadPoolStats generic; 254 | public ThreadPoolStats index; 255 | public ThreadPoolStats bench; 256 | public ThreadPoolStats get; 257 | public ThreadPoolStats snapshot; 258 | public ThreadPoolStats force_merge; 259 | public ThreadPoolStats merge; 260 | public ThreadPoolStats suggest; 261 | public ThreadPoolStats bulk; 262 | public ThreadPoolStats optimize; 263 | public ThreadPoolStats warmer; 264 | public ThreadPoolStats flush; 265 | public ThreadPoolStats search; 266 | public ThreadPoolStats listener; 267 | public ThreadPoolStats percolate; 268 | public ThreadPoolStats management; 269 | public ThreadPoolStats refresh; 270 | } 271 | public static class Network { 272 | public static class Tcp { 273 | public Number active_opens; 274 | public Number passive_opens; 275 | public Number curr_estab; 276 | public Number in_segs; 277 | public Number out_segs; 278 | public Number retrans_segs; 279 | public Number estab_resets; 280 | public Number attempt_fails; 281 | public Number in_errs; 282 | public Number out_rsts; 283 | } 284 | 285 | public Tcp tcp; 286 | } 287 | public static class Fs { 288 | public static class FsTotal { 289 | public Number total_in_bytes; 290 | public Number free_in_bytes; 291 | public Number available_in_bytes; 292 | public Number disk_reads; 293 | public Number disk_writes; 294 | public Number disk_io_op; 295 | public Number disk_read_size_in_bytes; 296 | public Number disk_write_size_in_bytes; 297 | public Number disk_io_size_in_bytes; 298 | } 299 | public static class FsData { 300 | public String path; 301 | public String mount; 302 | public String dev; 303 | public Number total_in_bytes; 304 | public Number free_in_bytes; 305 | public Number available_in_bytes; 306 | public Number disk_reads; 307 | public Number disk_writes; 308 | public Number disk_io_op; 309 | public Number disk_read_size_in_bytes; 310 | public Number disk_write_size_in_bytes; 311 | public Number disk_io_size_in_bytes; 312 | } 313 | 314 | public FsTotal total; 315 | public ArrayList data; 316 | } 317 | public static class Transport { 318 | public Number server_open; 319 | public Number rx_count; 320 | public Number rx_size_in_bytes; 321 | public Number tx_count; 322 | public Number tx_size_in_bytes; 323 | } 324 | public static class Http { 325 | public Number current_open; 326 | public Number total_opened; 327 | } 328 | public static class Breakers { 329 | public static class BreakerStats { 330 | public Number limit_size_in_bytes; 331 | public String limit_size; 332 | public Number estimated_size_in_bytes; 333 | public String estimated_size; 334 | public Double overhead; 335 | public Number tripped; 336 | } 337 | 338 | public BreakerStats fielddata; 339 | public BreakerStats request; 340 | public BreakerStats parent; 341 | } 342 | 343 | public String name; 344 | public Indices indices; 345 | public Os os; 346 | public Process process; 347 | public Jvm jvm; 348 | public ThreadPool thread_pool; 349 | public Network network; 350 | public Fs fs; 351 | public Transport transport; 352 | public Http http; 353 | public Breakers breakers; 354 | } 355 | 356 | public Map nodes; 357 | } 358 | 359 | -------------------------------------------------------------------------------- /src/main/java/me/snov/newrelic/elasticsearch/services/ClusterStatsService.java: -------------------------------------------------------------------------------- 1 | package me.snov.newrelic.elasticsearch.services; 2 | 3 | import me.snov.newrelic.elasticsearch.responses.ClusterStats; 4 | 5 | import java.util.HashSet; 6 | import java.util.List; 7 | 8 | public class ClusterStatsService { 9 | 10 | /** 11 | * @return Number of different versions 12 | */ 13 | public int getNumberOfVersions(List versions) { 14 | return versions.size() == 0 15 | ? 0 16 | : new HashSet(versions).size(); 17 | } 18 | 19 | /** 20 | * @return Number of different versions in cluster 21 | */ 22 | public int getNumberOfVersionsInCluster(ClusterStats clusterStats) { 23 | return clusterStats == null 24 | ? 0 25 | : getNumberOfVersions(clusterStats.nodes.versions); 26 | } 27 | 28 | public boolean isYellow(ClusterStats clusterStats) { 29 | return "yellow".equals(clusterStats.status); 30 | } 31 | 32 | public boolean isRed(ClusterStats clusterStats) { 33 | return "red".equals(clusterStats.status); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/me/snov/newrelic/elasticsearch/services/EpochCounterFactory.java: -------------------------------------------------------------------------------- 1 | package me.snov.newrelic.elasticsearch.services; 2 | 3 | import com.newrelic.metrics.publish.processors.EpochCounter; 4 | import com.newrelic.metrics.publish.processors.Processor; 5 | 6 | import java.util.HashMap; 7 | 8 | public class EpochCounterFactory { 9 | 10 | private HashMap processors; 11 | 12 | public EpochCounterFactory() 13 | { 14 | processors = new HashMap(); 15 | } 16 | 17 | private String getProcessorKey(String nodeName, String id) 18 | { 19 | return id + "-" + nodeName; 20 | } 21 | 22 | public Processor getProcessorForNode(String id, String nodeName) 23 | { 24 | String key = getProcessorKey(id, nodeName); 25 | if (!processors.containsKey(key)) { 26 | processors.put(key, new EpochCounter()); 27 | } 28 | 29 | return processors.get(key); 30 | } 31 | 32 | public Processor getProcessor(String key) 33 | { 34 | if (!processors.containsKey(key)) { 35 | processors.put(key, new EpochCounter()); 36 | } 37 | 38 | return processors.get(key); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/me/snov/newrelic/elasticsearch/services/NodesStatsService.java: -------------------------------------------------------------------------------- 1 | package me.snov.newrelic.elasticsearch.services; 2 | 3 | import me.snov.newrelic.elasticsearch.responses.NodesStats; 4 | 5 | public class NodesStatsService { 6 | 7 | public static class QueriesStat { 8 | public Long search = 0l; 9 | public Long fetch = 0l; 10 | public Long get = 0l; 11 | public Long index = 0l; 12 | public Long delete = 0l; 13 | } 14 | 15 | /** 16 | * @return Numbers of queries across the cluster 17 | */ 18 | public QueriesStat getTotalNumberOfQueries(NodesStats nodesStats) { 19 | QueriesStat result = new QueriesStat(); 20 | if (nodesStats != null && nodesStats.nodes != null) { 21 | for (NodesStats.NodeStats nodeStats : nodesStats.nodes.values()) { 22 | if (nodeStats.indices.search.query_total != null) { 23 | result.search += nodeStats.indices.search.query_total.longValue(); 24 | } 25 | if (nodeStats.indices.search.fetch_total != null) { 26 | result.fetch += nodeStats.indices.search.fetch_total.longValue(); 27 | } 28 | if (nodeStats.indices.get.total != null) { 29 | result.get += nodeStats.indices.get.total.longValue(); 30 | } 31 | if (nodeStats.indices.indexing.index_total != null) { 32 | result.index += nodeStats.indices.indexing.index_total.longValue(); 33 | } 34 | if (nodeStats.indices.indexing.delete_total != null) { 35 | result.delete += nodeStats.indices.indexing.delete_total.longValue(); 36 | } 37 | } 38 | } 39 | 40 | return result; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/test/java/me/snov/newrelic/elasticsearch/IntegrationTest.java: -------------------------------------------------------------------------------- 1 | package me.snov.newrelic.elasticsearch; 2 | 3 | public interface IntegrationTest { 4 | } 5 | -------------------------------------------------------------------------------- /src/test/java/me/snov/newrelic/elasticsearch/parsers/ClusterStatsParserTest.java: -------------------------------------------------------------------------------- 1 | package me.snov.newrelic.elasticsearch.parsers; 2 | 3 | import me.snov.newrelic.elasticsearch.responses.ClusterStats; 4 | import org.junit.Before; 5 | import org.junit.Test; 6 | 7 | import java.io.IOException; 8 | import java.net.URL; 9 | import java.net.URLClassLoader; 10 | 11 | import static org.junit.Assert.assertEquals; 12 | 13 | public class ClusterStatsParserTest { 14 | 15 | private ClusterStatsParser clusterStatsParser; 16 | 17 | /** 18 | * Sets up the test fixture. 19 | * (Called before every test case method.) 20 | */ 21 | @Before 22 | public void setUp() { 23 | clusterStatsParser = new ClusterStatsParser(); 24 | } 25 | 26 | private ClusterStats parseJson(String path) throws IOException { 27 | return clusterStatsParser.parse(getClass().getResourceAsStream(path)); 28 | } 29 | 30 | @Test 31 | public void testV661() throws Exception { 32 | ClusterStats clusterStats = parseJson("/cluster_stats_6.6.1.json"); 33 | assertEquals("docker-cluster", clusterStats.cluster_name); 34 | assertEquals("green", clusterStats.status); 35 | assertEquals(1, clusterStats.nodes.count.total.longValue()); 36 | assertEquals(1, clusterStats.nodes.versions.size()); 37 | } 38 | 39 | @Test 40 | public void testV511() throws Exception { 41 | ClusterStats clusterStats = parseJson("/cluster_stats_5.1.1.json"); 42 | assertEquals("elasticsearch", clusterStats.cluster_name); 43 | assertEquals("yellow", clusterStats.status); 44 | assertEquals(1, clusterStats.nodes.count.total.longValue()); 45 | assertEquals(1, clusterStats.nodes.versions.size()); 46 | } 47 | 48 | @Test 49 | public void testV211() throws Exception { 50 | ClusterStats clusterStats = parseJson("/cluster_stats_2.1.1.json"); 51 | assertEquals("elasticsearch", clusterStats.cluster_name); 52 | assertEquals("green", clusterStats.status); 53 | assertEquals(2L, clusterStats.nodes.count.total.longValue()); 54 | assertEquals(1, clusterStats.nodes.versions.size()); 55 | } 56 | 57 | @Test 58 | public void testV210() throws Exception { 59 | ClusterStats clusterStats = parseJson("/cluster_stats_2.1.0.json"); 60 | assertEquals("elasticsearch", clusterStats.cluster_name); 61 | assertEquals(1L, clusterStats.nodes.count.total.longValue()); 62 | assertEquals(1, clusterStats.nodes.versions.size()); 63 | } 64 | 65 | @Test 66 | public void testV151() throws Exception { 67 | ClusterStats clusterStats = parseJson("/cluster_stats_1.5.1.json"); 68 | assertEquals("elasticsearch", clusterStats.cluster_name); 69 | assertEquals(1L, clusterStats.nodes.count.total.longValue()); 70 | assertEquals(1, clusterStats.nodes.versions.size()); 71 | } 72 | 73 | @Test 74 | public void testV142() throws Exception { 75 | ClusterStats clusterStats = parseJson("/cluster_stats_1.4.2.json"); 76 | assertEquals("elasticsearch_snov", clusterStats.cluster_name); 77 | assertEquals(1601396L, clusterStats.indices.segments.memory_in_bytes.longValue()); 78 | assertEquals(1L, clusterStats.nodes.count.total.longValue()); 79 | } 80 | 81 | @Test 82 | public void testV134() throws Exception { 83 | ClusterStats clusterStats = parseJson("/cluster_stats_1.3.4.json"); 84 | assertEquals("esearch-testcluster", clusterStats.cluster_name); 85 | assertEquals(3L, clusterStats.nodes.count.total.longValue()); 86 | assertEquals(1, clusterStats.nodes.versions.size()); 87 | } 88 | 89 | @Test 90 | public void testV090() throws Exception { 91 | ClusterStats clusterStats = parseJson("/cluster_stats_0.90.12.json"); 92 | assertEquals("elasticsearch", clusterStats.cluster_name); 93 | assertEquals(1L, clusterStats.nodes.count.total.longValue()); 94 | assertEquals(1, clusterStats.nodes.versions.size()); 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /src/test/java/me/snov/newrelic/elasticsearch/parsers/NodesStatsParserTest.java: -------------------------------------------------------------------------------- 1 | package me.snov.newrelic.elasticsearch.parsers; 2 | 3 | import me.snov.newrelic.elasticsearch.responses.NodesStats; 4 | import org.junit.Before; 5 | import org.junit.Test; 6 | 7 | import java.io.IOException; 8 | import java.io.InputStream; 9 | 10 | import static org.hamcrest.CoreMatchers.is; 11 | import static org.junit.Assert.*; 12 | 13 | public class NodesStatsParserTest { 14 | 15 | private NodesStatsParser nodesStatsParser; 16 | 17 | /** 18 | * Sets up the test fixture. 19 | * (Called before every test case method.) 20 | */ 21 | @Before 22 | public void setUp() { 23 | nodesStatsParser = new NodesStatsParser(); 24 | } 25 | 26 | private NodesStats parseJson(String path) throws IOException { 27 | InputStream stream = getClass().getResourceAsStream(path); 28 | assertNotNull(String.format("Resource %s exists", path), stream); 29 | return nodesStatsParser.parse(stream); 30 | } 31 | 32 | @Test 33 | public void testV661() throws Exception { 34 | NodesStats nodesStats = parseJson("/nodes_stats_6.6.1.json"); 35 | // assertThat(nodesStats.nodes.size(), is(1)); 36 | // assertThat(nodesStats.nodes.get("foobart-xxx").name, is("foobar")); 37 | } 38 | 39 | @Test 40 | public void testV511() throws Exception { 41 | NodesStats nodesStats = parseJson("/nodes_stats_5.1.1.json"); 42 | assertThat(nodesStats.nodes.size(), is(1)); 43 | assertThat(nodesStats.nodes.get("foobart-xxx").name, is("foobar")); 44 | } 45 | 46 | @Test 47 | public void testV211() throws Exception { 48 | NodesStats nodesStats = parseJson("/nodes_stats_2.1.1.json"); 49 | assertThat(nodesStats.nodes.size(), is(2)); 50 | assertThat(nodesStats.nodes.get("nfxaGjN8QLqmru6bA2RoxQ").name, is("Everyman")); 51 | assertThat(nodesStats.nodes.get("88CFbaIcRLql01dB6I0FCw").name, is("Foolkiller")); 52 | } 53 | 54 | @Test 55 | public void testV134() throws Exception { 56 | NodesStats nodesStats = parseJson("/nodes_stats_1.3.4.json"); 57 | assertEquals(3, nodesStats.nodes.size()); 58 | assertEquals(200L, nodesStats.nodes.get("lNFk2gshR5GVDPmRrnDyoA") 59 | .jvm.gc.collectors.young.collection_time_in_millis.longValue()); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/test/java/me/snov/newrelic/elasticsearch/reporters/ClusterStatsReporterTest.java: -------------------------------------------------------------------------------- 1 | package me.snov.newrelic.elasticsearch.reporters; 2 | 3 | import me.snov.newrelic.elasticsearch.interfaces.AgentInterface; 4 | import me.snov.newrelic.elasticsearch.parsers.ClusterStatsParser; 5 | import me.snov.newrelic.elasticsearch.responses.ClusterStats; 6 | import org.junit.Before; 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | import org.mockito.Mock; 10 | import org.mockito.runners.MockitoJUnitRunner; 11 | 12 | import static org.mockito.Mockito.verify; 13 | 14 | @RunWith(MockitoJUnitRunner.class) 15 | public class ClusterStatsReporterTest { 16 | 17 | private ClusterStatsReporter clusterStatsReporter; 18 | private ClusterStats clusterStats; 19 | @Mock private AgentInterface agent; 20 | 21 | @Before 22 | public void setUp() throws Exception { 23 | clusterStatsReporter = new ClusterStatsReporter(agent); 24 | clusterStats = new ClusterStatsParser().parse(getClass().getResourceAsStream("/cluster_stats_2.1.1.json")); 25 | } 26 | 27 | @Test 28 | public void shouldReportGreenStatusCorrectly() throws Exception { 29 | clusterStats.status = "green"; 30 | 31 | clusterStatsReporter.reportClusterStats(clusterStats); 32 | 33 | verify(agent).reportMetric("V1/ClusterStats/Status/IsYellow", "bool", 0); 34 | verify(agent).reportMetric("V1/ClusterStats/Status/IsRed", "bool", 0); 35 | } 36 | 37 | @Test 38 | public void shouldReportRedStatusCorrectly() throws Exception { 39 | clusterStats.status = "red"; 40 | 41 | clusterStatsReporter.reportClusterStats(clusterStats); 42 | 43 | verify(agent).reportMetric("V1/ClusterStats/Status/IsYellow", "bool", 0); 44 | verify(agent).reportMetric("V1/ClusterStats/Status/IsRed", "bool", 1); 45 | } 46 | 47 | @Test 48 | public void shouldReportYellowStatusCorrectly() throws Exception { 49 | clusterStats.status = "yellow"; 50 | 51 | clusterStatsReporter.reportClusterStats(clusterStats); 52 | 53 | verify(agent).reportMetric("V1/ClusterStats/Status/IsYellow", "bool", 1); 54 | verify(agent).reportMetric("V1/ClusterStats/Status/IsRed", "bool", 0); 55 | } 56 | } -------------------------------------------------------------------------------- /src/test/java/me/snov/newrelic/elasticsearch/reporters/MockAgent.java: -------------------------------------------------------------------------------- 1 | package me.snov.newrelic.elasticsearch.reporters; 2 | 3 | import me.snov.newrelic.elasticsearch.interfaces.AgentInterface; 4 | 5 | public class MockAgent implements AgentInterface { 6 | 7 | private int reportedMetricsCount = 0; 8 | 9 | @Override 10 | public void reportMetric(String metricName, String units, Number value) { 11 | reportedMetricsCount++; 12 | } 13 | 14 | public int getReportedMetricsCount() { 15 | return reportedMetricsCount; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/test/java/me/snov/newrelic/elasticsearch/reporters/NodesStatsReporterTest.java: -------------------------------------------------------------------------------- 1 | package me.snov.newrelic.elasticsearch.reporters; 2 | 3 | import me.snov.newrelic.elasticsearch.IntegrationTest; 4 | import me.snov.newrelic.elasticsearch.parsers.NodesStatsParser; 5 | import me.snov.newrelic.elasticsearch.responses.NodesStats; 6 | import org.junit.Before; 7 | import org.junit.Test; 8 | import org.junit.experimental.categories.Category; 9 | 10 | import java.io.IOException; 11 | import java.io.InputStream; 12 | import java.net.URL; 13 | 14 | import static org.junit.Assert.assertTrue; 15 | 16 | public class NodesStatsReporterTest { 17 | 18 | private static final String nodesStatsUrl = "http://localhost:9200/_nodes/stats"; 19 | 20 | private MockAgent agent; 21 | private NodesStatsParser parser; 22 | private NodesStatsReporter reporter; 23 | 24 | /** 25 | * Sets up the test fixture. 26 | * (Called before every test case method.) 27 | */ 28 | @Before 29 | public void setUp() { 30 | agent = new MockAgent(); 31 | parser = new NodesStatsParser(); 32 | reporter = new NodesStatsReporter(agent); 33 | } 34 | 35 | private NodesStats parseJson(InputStream stream) throws IOException { 36 | return parser.parse(stream); 37 | } 38 | 39 | private NodesStats parseJsonFromFile(String path) throws IOException { 40 | return parseJson(getClass().getResourceAsStream(path)); 41 | } 42 | 43 | private NodesStats parseJsonFromUrl(String url) throws IOException { 44 | return parseJson(new URL(url).openConnection().getInputStream()); 45 | } 46 | 47 | @Test 48 | public void testReportNodesStatsV090() throws Exception { 49 | NodesStats nodesStats = parseJsonFromFile("/nodes_stats_0.90.12.json"); 50 | reporter.reportNodesStats(nodesStats); 51 | assertTrue("Number of reported metrics > 0", agent.getReportedMetricsCount() > 0); 52 | } 53 | 54 | @Test 55 | public void testReportNodesStatsV134() throws Exception { 56 | NodesStats nodesStats = parseJsonFromFile("/nodes_stats_1.3.4.json"); 57 | reporter.reportNodesStats(nodesStats); 58 | assertTrue("Number of reported metrics > 0", agent.getReportedMetricsCount() > 0); 59 | } 60 | 61 | @Test 62 | public void testReportNodesStatsV142() throws Exception { 63 | NodesStats nodesStats = parseJsonFromFile("/nodes_stats_1.4.2.json"); 64 | reporter.reportNodesStats(nodesStats); 65 | assertTrue("Number of reported metrics > 0", agent.getReportedMetricsCount() > 0); 66 | } 67 | 68 | @Test 69 | public void testReportNodesStatsV142LimitedOsStats() throws Exception { 70 | NodesStats nodesStats = parseJsonFromFile("/nodes_stats_1.4.2_incomplete_os_stats.json"); 71 | reporter.reportNodesStats(nodesStats); 72 | assertTrue("Number of reported metrics > 0", agent.getReportedMetricsCount() > 0); 73 | } 74 | 75 | @Test 76 | public void testReportNodesStatsV151() throws Exception { 77 | NodesStats nodesStats = parseJsonFromFile("/nodes_stats_1.5.1.json"); 78 | reporter.reportNodesStats(nodesStats); 79 | assertTrue("Number of reported metrics > 0", agent.getReportedMetricsCount() > 0); 80 | } 81 | 82 | @Test 83 | public void testReportNodesStatsV211() throws Exception { 84 | NodesStats nodesStats = parseJsonFromFile("/nodes_stats_2.1.1.json"); 85 | reporter.reportNodesStats(nodesStats); 86 | assertTrue("Number of reported metrics > 0", agent.getReportedMetricsCount() > 0); 87 | } 88 | 89 | @Test 90 | public void testReportNodesStatsV511() throws Exception { 91 | NodesStats nodesStats = parseJsonFromFile("/nodes_stats_5.1.1.json"); 92 | reporter.reportNodesStats(nodesStats); 93 | assertTrue("Number of reported metrics > 0", agent.getReportedMetricsCount() > 0); 94 | } 95 | 96 | @Test 97 | @Category(IntegrationTest.class) 98 | public void testReportNodesStatsIntegration() throws Exception { 99 | NodesStats nodesStats = parseJsonFromUrl(nodesStatsUrl); 100 | reporter.reportNodesStats(nodesStats); 101 | assertTrue("Number of reported metrics > 0", agent.getReportedMetricsCount() > 0); 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /src/test/java/me/snov/newrelic/elasticsearch/services/ClusterStatsServiceGetVersionMismatchTest.java: -------------------------------------------------------------------------------- 1 | package me.snov.newrelic.elasticsearch.services; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.junit.runners.Parameterized; 6 | 7 | import java.util.ArrayList; 8 | import java.util.Arrays; 9 | import java.util.Collection; 10 | 11 | import static org.junit.Assert.*; 12 | 13 | @RunWith(Parameterized.class) 14 | public class ClusterStatsServiceGetVersionMismatchTest { 15 | 16 | private final ArrayList nodes; 17 | private final int expected; 18 | private final ClusterStatsService clusterStatsService; 19 | 20 | @Parameterized.Parameters 21 | public static Collection data() { 22 | return Arrays.asList(new Object[][] { 23 | { new ArrayList(), 0}, 24 | { new ArrayList(Arrays.asList("1")), 1}, 25 | { new ArrayList(Arrays.asList("1.3.1", "1.4.2")), 2}, 26 | { new ArrayList(Arrays.asList("1", "2", "3")), 3}, 27 | }); 28 | } 29 | 30 | public ClusterStatsServiceGetVersionMismatchTest(ArrayList nodes, int expected) { 31 | this.nodes = nodes; 32 | this.expected = expected; 33 | this.clusterStatsService = new ClusterStatsService(); 34 | } 35 | 36 | @Test 37 | public void test() throws Exception { 38 | assertEquals(expected, clusterStatsService.getNumberOfVersions(nodes)); 39 | } 40 | } -------------------------------------------------------------------------------- /src/test/java/me/snov/newrelic/elasticsearch/services/ClusterStatsServiceTest.java: -------------------------------------------------------------------------------- 1 | package me.snov.newrelic.elasticsearch.services; 2 | 3 | import me.snov.newrelic.elasticsearch.parsers.ClusterStatsParser; 4 | import me.snov.newrelic.elasticsearch.responses.ClusterStats; 5 | import org.junit.Before; 6 | import org.junit.Test; 7 | 8 | import java.io.IOException; 9 | import java.net.URL; 10 | 11 | import static org.junit.Assert.*; 12 | 13 | public class ClusterStatsServiceTest { 14 | 15 | private ClusterStatsParser clusterStatsParser; 16 | private ClusterStatsService clusterStatsService; 17 | 18 | /** 19 | * Sets up the test fixture. 20 | * (Called before every test case method.) 21 | */ 22 | @Before 23 | public void setUp() { 24 | clusterStatsParser = new ClusterStatsParser(); 25 | clusterStatsService = new ClusterStatsService(); 26 | } 27 | 28 | private ClusterStats parseJson(String path) throws IOException { 29 | return clusterStatsParser.parse(getClass().getResourceAsStream(path)); 30 | } 31 | 32 | @Test 33 | public void testGetNumberOfVersionsInCluster() throws Exception { 34 | ClusterStats clusterStats = parseJson("/cluster_stats_version_mismatch.json"); 35 | assertEquals(2, clusterStatsService.getNumberOfVersionsInCluster(clusterStats)); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/resources/cluster_stats_0.90.12.json: -------------------------------------------------------------------------------- 1 | { 2 | "timestamp": 1429529774861, 3 | "cluster_name": "elasticsearch", 4 | "status": "green", 5 | "indices": { 6 | "count": 0, 7 | "shards": {}, 8 | "docs": { 9 | "count": 0, 10 | "deleted": 0 11 | }, 12 | "store": { 13 | "size": "0b", 14 | "size_in_bytes": 0, 15 | "throttle_time": "0s", 16 | "throttle_time_in_millis": 0 17 | }, 18 | "fielddata": { 19 | "memory_size": "0b", 20 | "memory_size_in_bytes": 0, 21 | "evictions": 0 22 | }, 23 | "filter_cache": { 24 | "memory_size": "0b", 25 | "memory_size_in_bytes": 0, 26 | "evictions": 0 27 | }, 28 | "id_cache": { 29 | "memory_size": "0b", 30 | "memory_size_in_bytes": 0 31 | }, 32 | "completion": { 33 | "size": "0b", 34 | "size_in_bytes": 0 35 | }, 36 | "segments": { 37 | "count": 0, 38 | "memory": "0b", 39 | "memory_in_bytes": 0 40 | } 41 | }, 42 | "nodes": { 43 | "count": { 44 | "total": 1, 45 | "master_only": 0, 46 | "data_only": 0, 47 | "master_data": 1, 48 | "client": 0 49 | }, 50 | "versions": [ 51 | "0.90.12" 52 | ], 53 | "os": { 54 | "available_processors": 1, 55 | "mem": { 56 | "total": "489.9mb", 57 | "total_in_bytes": 513798144 58 | }, 59 | "cpu": [ 60 | { 61 | "vendor": "Intel", 62 | "model": "Core(TM) i5-3210M CPU @ 2.50GHz", 63 | "mhz": 2508, 64 | "total_cores": 1, 65 | "total_sockets": 1, 66 | "cores_per_socket": 1, 67 | "cache_size": "6kb", 68 | "cache_size_in_bytes": 6144, 69 | "count": 1 70 | } 71 | ] 72 | }, 73 | "process": { 74 | "cpu": { 75 | "percent": 0 76 | }, 77 | "open_file_descriptors": { 78 | "min": 94, 79 | "max": 94, 80 | "avg": 94 81 | } 82 | }, 83 | "jvm": { 84 | "max_uptime": "3m", 85 | "max_uptime_in_millis": 185166, 86 | "versions": [ 87 | { 88 | "version": "1.7.0_75", 89 | "vm_name": "OpenJDK 64-Bit Server VM", 90 | "vm_version": "24.75-b04", 91 | "vm_vendor": "Oracle Corporation", 92 | "count": 1 93 | } 94 | ], 95 | "mem": { 96 | "heap_used": "70.2mb", 97 | "heap_used_in_bytes": 73700816, 98 | "heap_max": "1015.6mb", 99 | "heap_max_in_bytes": 1065025536 100 | }, 101 | "threads": 24 102 | }, 103 | "fs": { 104 | "total": "39.3gb", 105 | "total_in_bytes": 42241163264, 106 | "free": "38gb", 107 | "free_in_bytes": 40849571840, 108 | "available": "36.3gb", 109 | "available_in_bytes": 39071997952, 110 | "disk_reads": 7917, 111 | "disk_writes": 180, 112 | "disk_io_op": 8097, 113 | "disk_read_size": "122.4mb", 114 | "disk_read_size_in_bytes": 128414720, 115 | "disk_write_size": "1.9mb", 116 | "disk_write_size_in_bytes": 1998848, 117 | "disk_io_size": "124.3mb", 118 | "disk_io_size_in_bytes": 130413568, 119 | "disk_queue": "0", 120 | "disk_service_time": "0" 121 | }, 122 | "plugins": [] 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /src/test/resources/cluster_stats_1.3.4.json: -------------------------------------------------------------------------------- 1 | { 2 | "timestamp": 1423599143297, 3 | "cluster_name": "esearch-testcluster", 4 | "status": "green", 5 | "indices": { 6 | "count": 0, 7 | "shards": {}, 8 | "docs": { 9 | "count": 0, 10 | "deleted": 0 11 | }, 12 | "store": { 13 | "size_in_bytes": 0, 14 | "throttle_time_in_millis": 0 15 | }, 16 | "fielddata": { 17 | "memory_size_in_bytes": 0, 18 | "evictions": 0 19 | }, 20 | "filter_cache": { 21 | "memory_size_in_bytes": 0, 22 | "evictions": 0 23 | }, 24 | "id_cache": { 25 | "memory_size_in_bytes": 0 26 | }, 27 | "completion": { 28 | "size_in_bytes": 0 29 | }, 30 | "segments": { 31 | "count": 0, 32 | "memory_in_bytes": 0, 33 | "index_writer_memory_in_bytes": 0, 34 | "version_map_memory_in_bytes": 0 35 | }, 36 | "percolate": { 37 | "total": 0, 38 | "time_in_millis": 0, 39 | "current": 0, 40 | "memory_size_in_bytes": -1, 41 | "memory_size": "-1b", 42 | "queries": 0 43 | } 44 | }, 45 | "nodes": { 46 | "count": { 47 | "total": 3, 48 | "master_only": 0, 49 | "data_only": 0, 50 | "master_data": 3, 51 | "client": 0 52 | }, 53 | "versions": [ 54 | "1.3.4" 55 | ], 56 | "os": { 57 | "available_processors": 6, 58 | "mem": { 59 | "total_in_bytes": 3126497280 60 | }, 61 | "cpu": [ 62 | { 63 | "vendor": "Intel", 64 | "model": "Core(TM) i5-3210M CPU @ 2.50GHz", 65 | "mhz": 2525, 66 | "total_cores": 2, 67 | "total_sockets": 1, 68 | "cores_per_socket": 2, 69 | "cache_size_in_bytes": 6144, 70 | "count": 3 71 | } 72 | ] 73 | }, 74 | "process": { 75 | "cpu": { 76 | "percent": 3 77 | }, 78 | "open_file_descriptors": { 79 | "min": 166, 80 | "max": 167, 81 | "avg": 166 82 | } 83 | }, 84 | "jvm": { 85 | "max_uptime_in_millis": 3455462, 86 | "versions": [ 87 | { 88 | "version": "1.7.0_75", 89 | "vm_name": "OpenJDK 64-Bit Server VM", 90 | "vm_version": "24.75-b04", 91 | "vm_vendor": "Oracle Corporation", 92 | "count": 3 93 | } 94 | ], 95 | "mem": { 96 | "heap_used_in_bytes": 282768904, 97 | "heap_max_in_bytes": 1167851520 98 | }, 99 | "threads": 89 100 | }, 101 | "fs": { 102 | "total_in_bytes": 126723489792, 103 | "free_in_bytes": 122495979520, 104 | "available_in_bytes": 117163257856, 105 | "disk_reads": 29036, 106 | "disk_writes": 23562, 107 | "disk_io_op": 52598, 108 | "disk_read_size_in_bytes": 684354560, 109 | "disk_write_size_in_bytes": 1737199616, 110 | "disk_io_size_in_bytes": 2421554176, 111 | "disk_queue": "0", 112 | "disk_service_time": "1.2" 113 | }, 114 | "plugins": [ 115 | { 116 | "name": "marvel", 117 | "version": "1.3.0", 118 | "description": "Elasticsearch Management & Monitoring", 119 | "url": "/_plugin/marvel/", 120 | "jvm": true, 121 | "site": true 122 | }, 123 | { 124 | "name": "kopf", 125 | "version": "1.4.4", 126 | "description": "kopf - simple web administration tool for ElasticSearch", 127 | "url": "/_plugin/kopf/", 128 | "jvm": false, 129 | "site": true 130 | } 131 | ] 132 | } 133 | } -------------------------------------------------------------------------------- /src/test/resources/cluster_stats_1.4.2.json: -------------------------------------------------------------------------------- 1 | { 2 | "timestamp": 1423513703188, 3 | "cluster_name": "elasticsearch_snov", 4 | "status": "green", 5 | "indices": { 6 | "count": 7, 7 | "shards": { 8 | "total": 14, 9 | "primaries": 14, 10 | "replication": 0, 11 | "index": { 12 | "shards": { 13 | "min": 2, 14 | "max": 2, 15 | "avg": 2 16 | }, 17 | "primaries": { 18 | "min": 2, 19 | "max": 2, 20 | "avg": 2 21 | }, 22 | "replication": { 23 | "min": 0, 24 | "max": 0, 25 | "avg": 0 26 | } 27 | } 28 | }, 29 | "docs": { 30 | "count": 89978, 31 | "deleted": 0 32 | }, 33 | "store": { 34 | "size_in_bytes": 10940758, 35 | "throttle_time_in_millis": 0 36 | }, 37 | "fielddata": { 38 | "memory_size_in_bytes": 0, 39 | "evictions": 0 40 | }, 41 | "filter_cache": { 42 | "memory_size_in_bytes": 0, 43 | "evictions": 0 44 | }, 45 | "id_cache": { 46 | "memory_size_in_bytes": 93944 47 | }, 48 | "completion": { 49 | "size_in_bytes": 0 50 | }, 51 | "segments": { 52 | "count": 22, 53 | "memory_in_bytes": 1601396, 54 | "index_writer_memory_in_bytes": 0, 55 | "index_writer_max_memory_in_bytes": 7168000, 56 | "version_map_memory_in_bytes": 0, 57 | "fixed_bit_set_memory_in_bytes": 336768 58 | }, 59 | "percolate": { 60 | "total": 0, 61 | "time_in_millis": 0, 62 | "current": 0, 63 | "memory_size_in_bytes": -1, 64 | "memory_size": "-1b", 65 | "queries": 0 66 | } 67 | }, 68 | "nodes": { 69 | "count": { 70 | "total": 1, 71 | "master_only": 0, 72 | "data_only": 0, 73 | "master_data": 1, 74 | "client": 0 75 | }, 76 | "versions": [ 77 | "1.4.2" 78 | ], 79 | "os": { 80 | "available_processors": 4, 81 | "mem": { 82 | "total_in_bytes": 17179869184 83 | }, 84 | "cpu": [ 85 | { 86 | "vendor": "Intel", 87 | "model": "MacBookPro9,2", 88 | "mhz": 2500, 89 | "total_cores": 4, 90 | "total_sockets": 4, 91 | "cores_per_socket": 16, 92 | "cache_size_in_bytes": 256, 93 | "count": 1 94 | } 95 | ] 96 | }, 97 | "process": { 98 | "cpu": { 99 | "percent": 10 100 | }, 101 | "open_file_descriptors": { 102 | "min": 223, 103 | "max": 223, 104 | "avg": 223 105 | } 106 | }, 107 | "jvm": { 108 | "max_uptime_in_millis": 95689435, 109 | "versions": [ 110 | { 111 | "version": "1.7.0_60", 112 | "vm_name": "Java HotSpot(TM) 64-Bit Server VM", 113 | "vm_version": "24.60-b09", 114 | "vm_vendor": "Oracle Corporation", 115 | "count": 1 116 | } 117 | ], 118 | "mem": { 119 | "heap_used_in_bytes": 133345248, 120 | "heap_max_in_bytes": 259522560 121 | }, 122 | "threads": 75 123 | }, 124 | "fs": { 125 | "total_in_bytes": 318877626368, 126 | "free_in_bytes": 2758479872, 127 | "available_in_bytes": 2496335872, 128 | "disk_reads": 0, 129 | "disk_writes": 0, 130 | "disk_io_op": 0, 131 | "disk_read_size_in_bytes": 0, 132 | "disk_write_size_in_bytes": 0, 133 | "disk_io_size_in_bytes": 0 134 | }, 135 | "plugins": [ 136 | { 137 | "name": "river-twitter", 138 | "version": "2.4.1", 139 | "description": "River Twitter Plugin", 140 | "jvm": true, 141 | "site": false 142 | }, 143 | { 144 | "name": "marvel", 145 | "version": "1.2.1", 146 | "description": "Elasticsearch Management & Monitoring", 147 | "url": "/_plugin/marvel/", 148 | "jvm": true, 149 | "site": true 150 | }, 151 | { 152 | "name": "kopf", 153 | "version": "1.3.8", 154 | "description": "kopf - simple web administration tool for ElasticSearch", 155 | "url": "/_plugin/kopf/", 156 | "jvm": false, 157 | "site": true 158 | } 159 | ] 160 | } 161 | } -------------------------------------------------------------------------------- /src/test/resources/cluster_stats_1.5.1.json: -------------------------------------------------------------------------------- 1 | { 2 | "timestamp": 1429638147933, 3 | "cluster_name": "elasticsearch", 4 | "status": "green", 5 | "indices": { 6 | "count": 0, 7 | "shards": {}, 8 | "docs": { 9 | "count": 0, 10 | "deleted": 0 11 | }, 12 | "store": { 13 | "size_in_bytes": 0, 14 | "throttle_time_in_millis": 0 15 | }, 16 | "fielddata": { 17 | "memory_size_in_bytes": 0, 18 | "evictions": 0 19 | }, 20 | "filter_cache": { 21 | "memory_size_in_bytes": 0, 22 | "evictions": 0 23 | }, 24 | "id_cache": { 25 | "memory_size_in_bytes": 0 26 | }, 27 | "completion": { 28 | "size_in_bytes": 0 29 | }, 30 | "segments": { 31 | "count": 0, 32 | "memory_in_bytes": 0, 33 | "index_writer_memory_in_bytes": 0, 34 | "index_writer_max_memory_in_bytes": 0, 35 | "version_map_memory_in_bytes": 0, 36 | "fixed_bit_set_memory_in_bytes": 0 37 | }, 38 | "percolate": { 39 | "total": 0, 40 | "time_in_millis": 0, 41 | "current": 0, 42 | "memory_size_in_bytes": -1, 43 | "memory_size": "-1b", 44 | "queries": 0 45 | } 46 | }, 47 | "nodes": { 48 | "count": { 49 | "total": 1, 50 | "master_only": 0, 51 | "data_only": 0, 52 | "master_data": 1, 53 | "client": 0 54 | }, 55 | "versions": [ 56 | "1.5.1" 57 | ], 58 | "os": { 59 | "available_processors": 8, 60 | "mem": { 61 | "total_in_bytes": 2105401344 62 | }, 63 | "cpu": [ 64 | { 65 | "vendor": "Intel", 66 | "model": "Core(TM) i7-4870HQ CPU @ 2.50GHz", 67 | "mhz": 2513, 68 | "total_cores": 8, 69 | "total_sockets": 1, 70 | "cores_per_socket": 8, 71 | "cache_size_in_bytes": 6144, 72 | "count": 1 73 | } 74 | ] 75 | }, 76 | "process": { 77 | "cpu": { 78 | "percent": 14 79 | }, 80 | "open_file_descriptors": { 81 | "min": 225, 82 | "max": 225, 83 | "avg": 225 84 | } 85 | }, 86 | "jvm": { 87 | "max_uptime_in_millis": 13576, 88 | "versions": [ 89 | { 90 | "version": "1.7.0_75", 91 | "vm_name": "OpenJDK 64-Bit Server VM", 92 | "vm_version": "24.75-b04", 93 | "vm_vendor": "Oracle Corporation", 94 | "count": 1 95 | } 96 | ], 97 | "mem": { 98 | "heap_used_in_bytes": 51463040, 99 | "heap_max_in_bytes": 1037959168 100 | }, 101 | "threads": 68 102 | }, 103 | "fs": { 104 | "total_in_bytes": 19507089408, 105 | "free_in_bytes": 18221834240, 106 | "available_in_bytes": 17207332864 107 | }, 108 | "plugins": [] 109 | } 110 | } -------------------------------------------------------------------------------- /src/test/resources/cluster_stats_2.1.0.json: -------------------------------------------------------------------------------- 1 | { 2 | "timestamp": 1450177715999, 3 | "cluster_name": "elasticsearch", 4 | "status": "green", 5 | "indices": { 6 | "count": 0, 7 | "shards": {}, 8 | "docs": { 9 | "count": 0, 10 | "deleted": 0 11 | }, 12 | "store": { 13 | "size_in_bytes": 0, 14 | "throttle_time_in_millis": 0 15 | }, 16 | "fielddata": { 17 | "memory_size_in_bytes": 0, 18 | "evictions": 0 19 | }, 20 | "query_cache": { 21 | "memory_size_in_bytes": 0, 22 | "total_count": 0, 23 | "hit_count": 0, 24 | "miss_count": 0, 25 | "cache_size": 0, 26 | "cache_count": 0, 27 | "evictions": 0 28 | }, 29 | "completion": { 30 | "size_in_bytes": 0 31 | }, 32 | "segments": { 33 | "count": 0, 34 | "memory_in_bytes": 0, 35 | "terms_memory_in_bytes": 0, 36 | "stored_fields_memory_in_bytes": 0, 37 | "term_vectors_memory_in_bytes": 0, 38 | "norms_memory_in_bytes": 0, 39 | "doc_values_memory_in_bytes": 0, 40 | "index_writer_memory_in_bytes": 0, 41 | "index_writer_max_memory_in_bytes": 0, 42 | "version_map_memory_in_bytes": 0, 43 | "fixed_bit_set_memory_in_bytes": 0 44 | }, 45 | "percolate": { 46 | "total": 0, 47 | "time_in_millis": 0, 48 | "current": 0, 49 | "memory_size_in_bytes": -1, 50 | "memory_size": "-1b", 51 | "queries": 0 52 | } 53 | }, 54 | "nodes": { 55 | "count": { 56 | "total": 1, 57 | "master_only": 0, 58 | "data_only": 0, 59 | "master_data": 1, 60 | "client": 0 61 | }, 62 | "versions": [ 63 | "2.1.0" 64 | ], 65 | "os": { 66 | "available_processors": 1, 67 | "allocated_processors": 1, 68 | "mem": { 69 | "total_in_bytes": 0 70 | }, 71 | "names": [ 72 | { 73 | "name": "Linux", 74 | "count": 1 75 | } 76 | ] 77 | }, 78 | "process": { 79 | "cpu": { 80 | "percent": 0 81 | }, 82 | "open_file_descriptors": { 83 | "min": 95, 84 | "max": 95, 85 | "avg": 95 86 | } 87 | }, 88 | "jvm": { 89 | "max_uptime_in_millis": 242552, 90 | "versions": [ 91 | { 92 | "version": "1.8.0_66-internal", 93 | "vm_name": "OpenJDK 64-Bit Server VM", 94 | "vm_version": "25.66-b17", 95 | "vm_vendor": "Oracle Corporation", 96 | "count": 1 97 | } 98 | ], 99 | "mem": { 100 | "heap_used_in_bytes": 53667240, 101 | "heap_max_in_bytes": 1065025536 102 | }, 103 | "threads": 22 104 | }, 105 | "fs": { 106 | "total_in_bytes": 19507089408, 107 | "free_in_bytes": 17436667904, 108 | "available_in_bytes": 16422166528, 109 | "spins": "true" 110 | }, 111 | "plugins": [] 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /src/test/resources/cluster_stats_2.1.1.json: -------------------------------------------------------------------------------- 1 | { 2 | "timestamp" : 1459467560871, 3 | "cluster_name" : "elasticsearch", 4 | "status" : "green", 5 | "indices" : { 6 | "count" : 0, 7 | "shards" : { }, 8 | "docs" : { 9 | "count" : 0, 10 | "deleted" : 0 11 | }, 12 | "store" : { 13 | "size_in_bytes" : 0, 14 | "throttle_time_in_millis" : 0 15 | }, 16 | "fielddata" : { 17 | "memory_size_in_bytes" : 0, 18 | "evictions" : 0 19 | }, 20 | "query_cache" : { 21 | "memory_size_in_bytes" : 0, 22 | "total_count" : 0, 23 | "hit_count" : 0, 24 | "miss_count" : 0, 25 | "cache_size" : 0, 26 | "cache_count" : 0, 27 | "evictions" : 0 28 | }, 29 | "completion" : { 30 | "size_in_bytes" : 0 31 | }, 32 | "segments" : { 33 | "count" : 0, 34 | "memory_in_bytes" : 0, 35 | "terms_memory_in_bytes" : 0, 36 | "stored_fields_memory_in_bytes" : 0, 37 | "term_vectors_memory_in_bytes" : 0, 38 | "norms_memory_in_bytes" : 0, 39 | "doc_values_memory_in_bytes" : 0, 40 | "index_writer_memory_in_bytes" : 0, 41 | "index_writer_max_memory_in_bytes" : 0, 42 | "version_map_memory_in_bytes" : 0, 43 | "fixed_bit_set_memory_in_bytes" : 0 44 | }, 45 | "percolate" : { 46 | "total" : 0, 47 | "time_in_millis" : 0, 48 | "current" : 0, 49 | "memory_size_in_bytes" : -1, 50 | "memory_size" : "-1b", 51 | "queries" : 0 52 | } 53 | }, 54 | "nodes" : { 55 | "count" : { 56 | "total" : 2, 57 | "master_only" : 0, 58 | "data_only" : 0, 59 | "master_data" : 2, 60 | "client" : 0 61 | }, 62 | "versions" : [ "2.1.1" ], 63 | "os" : { 64 | "available_processors" : 8, 65 | "allocated_processors" : 8, 66 | "mem" : { 67 | "total_in_bytes" : 0 68 | }, 69 | "names" : [ ] 70 | }, 71 | "process" : { 72 | "cpu" : { 73 | "percent" : 0 74 | }, 75 | "open_file_descriptors" : { 76 | "min" : 258, 77 | "max" : 259, 78 | "avg" : 258 79 | } 80 | }, 81 | "jvm" : { 82 | "max_uptime_in_millis" : 68119, 83 | "versions" : [ { 84 | "version" : "1.8.0_45", 85 | "vm_name" : "Java HotSpot(TM) 64-Bit Server VM", 86 | "vm_version" : "25.45-b02", 87 | "vm_vendor" : "Oracle Corporation", 88 | "count" : 2 89 | } ], 90 | "mem" : { 91 | "heap_used_in_bytes" : 54635200, 92 | "heap_max_in_bytes" : 2075918336 93 | }, 94 | "threads" : 134 95 | }, 96 | "fs" : { 97 | "total_in_bytes" : 239063433216, 98 | "free_in_bytes" : 9278623744, 99 | "available_in_bytes" : 9016479744 100 | }, 101 | "plugins" : [ ] 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /src/test/resources/cluster_stats_5.1.1.json: -------------------------------------------------------------------------------- 1 | { 2 | "_nodes": { 3 | "total": 1, 4 | "successful": 1, 5 | "failed": 0 6 | }, 7 | "cluster_name": "elasticsearch", 8 | "timestamp": 1482735851082, 9 | "status": "yellow", 10 | "indices": { 11 | "count": 2, 12 | "shards": { 13 | "total": 10, 14 | "primaries": 10, 15 | "replication": 0.0, 16 | "index": { 17 | "shards": { 18 | "min": 5, 19 | "max": 5, 20 | "avg": 5.0 21 | }, 22 | "primaries": { 23 | "min": 5, 24 | "max": 5, 25 | "avg": 5.0 26 | }, 27 | "replication": { 28 | "min": 0.0, 29 | "max": 0.0, 30 | "avg": 0.0 31 | } 32 | } 33 | }, 34 | "docs": { 35 | "count": 6596, 36 | "deleted": 237 37 | }, 38 | "store": { 39 | "size_in_bytes": 2809788, 40 | "throttle_time_in_millis": 0 41 | }, 42 | "fielddata": { 43 | "memory_size_in_bytes": 0, 44 | "evictions": 0 45 | }, 46 | "query_cache": { 47 | "memory_size_in_bytes": 480, 48 | "total_count": 1719, 49 | "hit_count": 818, 50 | "miss_count": 901, 51 | "cache_size": 30, 52 | "cache_count": 35, 53 | "evictions": 5 54 | }, 55 | "completion": { 56 | "size_in_bytes": 0 57 | }, 58 | "segments": { 59 | "count": 96, 60 | "memory_in_bytes": 707076, 61 | "terms_memory_in_bytes": 739924, 62 | "stored_fields_memory_in_bytes": 147296, 63 | "term_vectors_memory_in_bytes": 0, 64 | "norms_memory_in_bytes": 29248, 65 | "points_memory_in_bytes": 8624, 66 | "doc_values_memory_in_bytes": 81984, 67 | "index_writer_memory_in_bytes": 0, 68 | "version_map_memory_in_bytes": 0, 69 | "fixed_bit_set_memory_in_bytes": 0, 70 | "max_unsafe_auto_id_timestamp": -1, 71 | "file_sizes": { 72 | 73 | } 74 | } 75 | }, 76 | "nodes": { 77 | "count": { 78 | "total": 1, 79 | "data": 1, 80 | "coordinating_only": 0, 81 | "master": 1, 82 | "ingest": 1 83 | }, 84 | "versions": [ 85 | "5.1.1" 86 | ], 87 | "os": { 88 | "available_processors": 20, 89 | "allocated_processors": 20, 90 | "names": [ 91 | { 92 | "name": "Linux", 93 | "count": 1 94 | } 95 | ], 96 | "mem": { 97 | "total_in_bytes": 6442466816, 98 | "free_in_bytes": 60727552, 99 | "used_in_bytes": 6841739264, 100 | "free_percent": 1, 101 | "used_percent": 99 102 | } 103 | }, 104 | "process": { 105 | "cpu": { 106 | "percent": 0 107 | }, 108 | "open_file_descriptors": { 109 | "min": 475, 110 | "max": 475, 111 | "avg": 475 112 | } 113 | }, 114 | "jvm": { 115 | "max_uptime_in_millis": 229077263, 116 | "versions": [ 117 | { 118 | "version": "1.8.0_111", 119 | "vm_name": "Java HotSpot(TM) 64-Bit Server VM", 120 | "vm_version": "25.111-b14", 121 | "vm_vendor": "Oracle Corporation", 122 | "count": 1 123 | } 124 | ], 125 | "mem": { 126 | "heap_used_in_bytes": 998168520, 127 | "heap_max_in_bytes": 2075918336 128 | }, 129 | "threads": 183 130 | }, 131 | "fs": { 132 | "total_in_bytes": 1948795334656, 133 | "free_in_bytes": 754496978944, 134 | "available_in_bytes": 655480262656, 135 | "spins": "true" 136 | }, 137 | "plugins": [ 138 | 139 | ], 140 | "network_types": { 141 | "transport_types": { 142 | "netty4": 1 143 | }, 144 | "http_types": { 145 | "netty4": 1 146 | } 147 | } 148 | } 149 | } -------------------------------------------------------------------------------- /src/test/resources/cluster_stats_6.6.1.json: -------------------------------------------------------------------------------- 1 | { 2 | "_nodes" : { 3 | "total" : 1, 4 | "successful" : 1, 5 | "failed" : 0 6 | }, 7 | "cluster_name" : "docker-cluster", 8 | "cluster_uuid" : "VA3CX0u6SSGXozIr7Qmt0A", 9 | "timestamp" : 1551108817897, 10 | "status" : "green", 11 | "indices" : { 12 | "count" : 0, 13 | "shards" : { }, 14 | "docs" : { 15 | "count" : 0, 16 | "deleted" : 0 17 | }, 18 | "store" : { 19 | "size_in_bytes" : 0 20 | }, 21 | "fielddata" : { 22 | "memory_size_in_bytes" : 0, 23 | "evictions" : 0 24 | }, 25 | "query_cache" : { 26 | "memory_size_in_bytes" : 0, 27 | "total_count" : 0, 28 | "hit_count" : 0, 29 | "miss_count" : 0, 30 | "cache_size" : 0, 31 | "cache_count" : 0, 32 | "evictions" : 0 33 | }, 34 | "completion" : { 35 | "size_in_bytes" : 0 36 | }, 37 | "segments" : { 38 | "count" : 0, 39 | "memory_in_bytes" : 0, 40 | "terms_memory_in_bytes" : 0, 41 | "stored_fields_memory_in_bytes" : 0, 42 | "term_vectors_memory_in_bytes" : 0, 43 | "norms_memory_in_bytes" : 0, 44 | "points_memory_in_bytes" : 0, 45 | "doc_values_memory_in_bytes" : 0, 46 | "index_writer_memory_in_bytes" : 0, 47 | "version_map_memory_in_bytes" : 0, 48 | "fixed_bit_set_memory_in_bytes" : 0, 49 | "max_unsafe_auto_id_timestamp" : -9223372036854775808, 50 | "file_sizes" : { } 51 | } 52 | }, 53 | "nodes" : { 54 | "count" : { 55 | "total" : 1, 56 | "data" : 1, 57 | "coordinating_only" : 0, 58 | "master" : 1, 59 | "ingest" : 1 60 | }, 61 | "versions" : [ 62 | "6.6.1" 63 | ], 64 | "os" : { 65 | "available_processors" : 4, 66 | "allocated_processors" : 4, 67 | "names" : [ 68 | { 69 | "name" : "Linux", 70 | "count" : 1 71 | } 72 | ], 73 | "pretty_names" : [ 74 | { 75 | "pretty_name" : "CentOS Linux 7 (Core)", 76 | "count" : 1 77 | } 78 | ], 79 | "mem" : { 80 | "total_in_bytes" : 2095869952, 81 | "free_in_bytes" : 77729792, 82 | "used_in_bytes" : 2018140160, 83 | "free_percent" : 4, 84 | "used_percent" : 96 85 | } 86 | }, 87 | "process" : { 88 | "cpu" : { 89 | "percent" : 0 90 | }, 91 | "open_file_descriptors" : { 92 | "min" : 217, 93 | "max" : 217, 94 | "avg" : 217 95 | } 96 | }, 97 | "jvm" : { 98 | "max_uptime_in_millis" : 62325, 99 | "versions" : [ 100 | { 101 | "version" : "11.0.1", 102 | "vm_name" : "OpenJDK 64-Bit Server VM", 103 | "vm_version" : "11.0.1+13", 104 | "vm_vendor" : "Oracle Corporation", 105 | "count" : 1 106 | } 107 | ], 108 | "mem" : { 109 | "heap_used_in_bytes" : 241837536, 110 | "heap_max_in_bytes" : 1038876672 111 | }, 112 | "threads" : 46 113 | }, 114 | "fs" : { 115 | "total_in_bytes" : 62722478080, 116 | "free_in_bytes" : 49455063040, 117 | "available_in_bytes" : 46238507008 118 | }, 119 | "plugins" : [ 120 | { 121 | "name" : "ingest-user-agent", 122 | "version" : "6.6.1", 123 | "elasticsearch_version" : "6.6.1", 124 | "java_version" : "1.8", 125 | "description" : "Ingest processor that extracts information from a user agent", 126 | "classname" : "org.elasticsearch.ingest.useragent.IngestUserAgentPlugin", 127 | "extended_plugins" : [ ], 128 | "has_native_controller" : false 129 | }, 130 | { 131 | "name" : "ingest-geoip", 132 | "version" : "6.6.1", 133 | "elasticsearch_version" : "6.6.1", 134 | "java_version" : "1.8", 135 | "description" : "Ingest processor that uses looksup geo data based on ip adresses using the Maxmind geo database", 136 | "classname" : "org.elasticsearch.ingest.geoip.IngestGeoIpPlugin", 137 | "extended_plugins" : [ ], 138 | "has_native_controller" : false 139 | } 140 | ], 141 | "network_types" : { 142 | "transport_types" : { 143 | "security4" : 1 144 | }, 145 | "http_types" : { 146 | "security4" : 1 147 | } 148 | } 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /src/test/resources/cluster_stats_version_mismatch.json: -------------------------------------------------------------------------------- 1 | { 2 | "timestamp": 1423513703188, 3 | "cluster_name": "elasticsearch_snov", 4 | "status": "green", 5 | "indices": { 6 | "count": 7, 7 | "shards": { 8 | "total": 14, 9 | "primaries": 14, 10 | "replication": 0, 11 | "index": { 12 | "shards": { 13 | "min": 2, 14 | "max": 2, 15 | "avg": 2 16 | }, 17 | "primaries": { 18 | "min": 2, 19 | "max": 2, 20 | "avg": 2 21 | }, 22 | "replication": { 23 | "min": 0, 24 | "max": 0, 25 | "avg": 0 26 | } 27 | } 28 | }, 29 | "docs": { 30 | "count": 89978, 31 | "deleted": 0 32 | }, 33 | "store": { 34 | "size_in_bytes": 10940758, 35 | "throttle_time_in_millis": 0 36 | }, 37 | "fielddata": { 38 | "memory_size_in_bytes": 0, 39 | "evictions": 0 40 | }, 41 | "filter_cache": { 42 | "memory_size_in_bytes": 0, 43 | "evictions": 0 44 | }, 45 | "id_cache": { 46 | "memory_size_in_bytes": 93944 47 | }, 48 | "completion": { 49 | "size_in_bytes": 0 50 | }, 51 | "segments": { 52 | "count": 22, 53 | "memory_in_bytes": 1601396, 54 | "index_writer_memory_in_bytes": 0, 55 | "index_writer_max_memory_in_bytes": 7168000, 56 | "version_map_memory_in_bytes": 0, 57 | "fixed_bit_set_memory_in_bytes": 336768 58 | }, 59 | "percolate": { 60 | "total": 0, 61 | "time_in_millis": 0, 62 | "current": 0, 63 | "memory_size_in_bytes": -1, 64 | "memory_size": "-1b", 65 | "queries": 0 66 | } 67 | }, 68 | "nodes": { 69 | "count": { 70 | "total": 2, 71 | "master_only": 0, 72 | "data_only": 0, 73 | "master_data": 1, 74 | "client": 0 75 | }, 76 | "versions": [ 77 | "1.3.5", 78 | "1.4.2" 79 | ], 80 | "os": { 81 | "available_processors": 4, 82 | "mem": { 83 | "total_in_bytes": 17179869184 84 | }, 85 | "cpu": [ 86 | { 87 | "vendor": "Intel", 88 | "model": "MacBookPro9,2", 89 | "mhz": 2500, 90 | "total_cores": 4, 91 | "total_sockets": 4, 92 | "cores_per_socket": 16, 93 | "cache_size_in_bytes": 256, 94 | "count": 1 95 | } 96 | ] 97 | }, 98 | "process": { 99 | "cpu": { 100 | "percent": 0 101 | }, 102 | "open_file_descriptors": { 103 | "min": 223, 104 | "max": 223, 105 | "avg": 223 106 | } 107 | }, 108 | "jvm": { 109 | "max_uptime_in_millis": 95689435, 110 | "versions": [ 111 | { 112 | "version": "1.7.0_60", 113 | "vm_name": "Java HotSpot(TM) 64-Bit Server VM", 114 | "vm_version": "24.60-b09", 115 | "vm_vendor": "Oracle Corporation", 116 | "count": 1 117 | } 118 | ], 119 | "mem": { 120 | "heap_used_in_bytes": 133345248, 121 | "heap_max_in_bytes": 259522560 122 | }, 123 | "threads": 75 124 | }, 125 | "fs": { 126 | "total_in_bytes": 318877626368, 127 | "free_in_bytes": 2758479872, 128 | "available_in_bytes": 2496335872, 129 | "disk_reads": 0, 130 | "disk_writes": 0, 131 | "disk_io_op": 0, 132 | "disk_read_size_in_bytes": 0, 133 | "disk_write_size_in_bytes": 0, 134 | "disk_io_size_in_bytes": 0 135 | }, 136 | "plugins": [ 137 | { 138 | "name": "river-twitter", 139 | "version": "2.4.1", 140 | "description": "River Twitter Plugin", 141 | "jvm": true, 142 | "site": false 143 | }, 144 | { 145 | "name": "marvel", 146 | "version": "1.2.1", 147 | "description": "Elasticsearch Management & Monitoring", 148 | "url": "/_plugin/marvel/", 149 | "jvm": true, 150 | "site": true 151 | }, 152 | { 153 | "name": "kopf", 154 | "version": "1.3.8", 155 | "description": "kopf - simple web administration tool for ElasticSearch", 156 | "url": "/_plugin/kopf/", 157 | "jvm": false, 158 | "site": true 159 | } 160 | ] 161 | } 162 | } -------------------------------------------------------------------------------- /src/test/resources/nodes_stats_0.90.12.json: -------------------------------------------------------------------------------- 1 | { 2 | "cluster_name": "elasticsearch", 3 | "nodes": { 4 | "O7z282NvRz2xlHjNhmQTZg": { 5 | "timestamp": 1429529712900, 6 | "name": "Challenger", 7 | "transport_address": "inet[/10.0.2.15:9300]", 8 | "hostname": "vagrant-ubuntu-trusty-64", 9 | "indices": { 10 | "docs": { 11 | "count": 0, 12 | "deleted": 0 13 | }, 14 | "store": { 15 | "size": "0b", 16 | "size_in_bytes": 0, 17 | "throttle_time": "0s", 18 | "throttle_time_in_millis": 0 19 | }, 20 | "indexing": { 21 | "index_total": 0, 22 | "index_time": "0s", 23 | "index_time_in_millis": 0, 24 | "index_current": 0, 25 | "delete_total": 0, 26 | "delete_time": "0s", 27 | "delete_time_in_millis": 0, 28 | "delete_current": 0 29 | }, 30 | "get": { 31 | "total": 0, 32 | "get_time": "0s", 33 | "time_in_millis": 0, 34 | "exists_total": 0, 35 | "exists_time": "0s", 36 | "exists_time_in_millis": 0, 37 | "missing_total": 0, 38 | "missing_time": "0s", 39 | "missing_time_in_millis": 0, 40 | "current": 0 41 | }, 42 | "search": { 43 | "open_contexts": 0, 44 | "query_total": 0, 45 | "query_time": "0s", 46 | "query_time_in_millis": 0, 47 | "query_current": 0, 48 | "fetch_total": 0, 49 | "fetch_time": "0s", 50 | "fetch_time_in_millis": 0, 51 | "fetch_current": 0 52 | } 53 | } 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /src/test/resources/nodes_stats_1.4.2.json: -------------------------------------------------------------------------------- 1 | { 2 | "cluster_name": "elasticsearch_snov", 3 | "nodes": { 4 | "nyYPfm-YQpO56BL1sOvpjQ": { 5 | "timestamp": 1425675889329, 6 | "name": "Edwin Jarvis", 7 | "transport_address": "inet[/192.168.178.24:9300]", 8 | "host": "macbook.fritz.box", 9 | "ip": [ 10 | "inet[/192.168.178.24:9300]", 11 | "NONE" 12 | ], 13 | "indices": { 14 | "docs": { 15 | "count": 89677, 16 | "deleted": 0 17 | }, 18 | "store": { 19 | "size_in_bytes": 9987981, 20 | "throttle_time_in_millis": 0 21 | }, 22 | "indexing": { 23 | "index_total": 0, 24 | "index_time_in_millis": 0, 25 | "index_current": 0, 26 | "delete_total": 0, 27 | "delete_time_in_millis": 0, 28 | "delete_current": 0, 29 | "noop_update_total": 0, 30 | "is_throttled": false, 31 | "throttle_time_in_millis": 0 32 | }, 33 | "get": { 34 | "total": 0, 35 | "time_in_millis": 0, 36 | "exists_total": 0, 37 | "exists_time_in_millis": 0, 38 | "missing_total": 0, 39 | "missing_time_in_millis": 0, 40 | "current": 0 41 | }, 42 | "search": { 43 | "open_contexts": 0, 44 | "query_total": 0, 45 | "query_time_in_millis": 0, 46 | "query_current": 0, 47 | "fetch_total": 0, 48 | "fetch_time_in_millis": 0, 49 | "fetch_current": 0 50 | }, 51 | "merges": { 52 | "current": 0, 53 | "current_docs": 0, 54 | "current_size_in_bytes": 0, 55 | "total": 0, 56 | "total_time_in_millis": 0, 57 | "total_docs": 0, 58 | "total_size_in_bytes": 0 59 | }, 60 | "refresh": { 61 | "total": 16, 62 | "total_time_in_millis": 0 63 | }, 64 | "flush": { 65 | "total": 0, 66 | "total_time_in_millis": 0 67 | }, 68 | "warmer": { 69 | "current": 0, 70 | "total": 32, 71 | "total_time_in_millis": 1134 72 | }, 73 | "filter_cache": { 74 | "memory_size_in_bytes": 0, 75 | "evictions": 0 76 | }, 77 | "id_cache": { 78 | "memory_size_in_bytes": 93944 79 | }, 80 | "fielddata": { 81 | "memory_size_in_bytes": 0, 82 | "evictions": 0 83 | }, 84 | "percolate": { 85 | "total": 0, 86 | "time_in_millis": 0, 87 | "current": 0, 88 | "memory_size_in_bytes": -1, 89 | "memory_size": "-1b", 90 | "queries": 0 91 | }, 92 | "completion": { 93 | "size_in_bytes": 0 94 | }, 95 | "segments": { 96 | "count": 11, 97 | "memory_in_bytes": 1035174, 98 | "index_writer_memory_in_bytes": 0, 99 | "index_writer_max_memory_in_bytes": 67108864, 100 | "version_map_memory_in_bytes": 0, 101 | "fixed_bit_set_memory_in_bytes": 515712 102 | }, 103 | "translog": { 104 | "operations": 0, 105 | "size_in_bytes": 17 106 | }, 107 | "suggest": { 108 | "total": 0, 109 | "time_in_millis": 0, 110 | "current": 0 111 | }, 112 | "query_cache": { 113 | "memory_size_in_bytes": 0, 114 | "evictions": 0, 115 | "hit_count": 0, 116 | "miss_count": 0 117 | } 118 | }, 119 | "os": { 120 | "timestamp": 1425675889337, 121 | "uptime_in_millis": 529845, 122 | "load_average": [ 123 | 3.00146484375, 124 | 3.86328125, 125 | 8.30419921875 126 | ], 127 | "cpu": { 128 | "sys": 4, 129 | "user": 9, 130 | "idle": 85, 131 | "usage": 13, 132 | "stolen": 0 133 | }, 134 | "mem": { 135 | "free_in_bytes": 2417360896, 136 | "used_in_bytes": 14762508288, 137 | "free_percent": 46, 138 | "used_percent": 53, 139 | "actual_free_in_bytes": 8012152832, 140 | "actual_used_in_bytes": 9167716352 141 | }, 142 | "swap": { 143 | "used_in_bytes": 0, 144 | "free_in_bytes": 1073741824 145 | } 146 | }, 147 | "process": { 148 | "timestamp": 1425675889337, 149 | "open_file_descriptors": 217, 150 | "cpu": { 151 | "percent": 1, 152 | "sys_in_millis": 1606, 153 | "user_in_millis": 18634, 154 | "total_in_millis": 20240 155 | }, 156 | "mem": { 157 | "resident_in_bytes": 275562496, 158 | "share_in_bytes": -1, 159 | "total_virtual_in_bytes": 4309331968 160 | } 161 | }, 162 | "jvm": { 163 | "timestamp": 1425675889337, 164 | "uptime_in_millis": 307356, 165 | "mem": { 166 | "heap_used_in_bytes": 71481704, 167 | "heap_used_percent": 27, 168 | "heap_committed_in_bytes": 259522560, 169 | "heap_max_in_bytes": 259522560, 170 | "non_heap_used_in_bytes": 50654800, 171 | "non_heap_committed_in_bytes": 51552256, 172 | "pools": { 173 | "young": { 174 | "used_in_bytes": 44540592, 175 | "max_in_bytes": 71630848, 176 | "peak_used_in_bytes": 71630848, 177 | "peak_max_in_bytes": 71630848 178 | }, 179 | "survivor": { 180 | "used_in_bytes": 8912896, 181 | "max_in_bytes": 8912896, 182 | "peak_used_in_bytes": 8912896, 183 | "peak_max_in_bytes": 8912896 184 | }, 185 | "old": { 186 | "used_in_bytes": 18028216, 187 | "max_in_bytes": 178978816, 188 | "peak_used_in_bytes": 18028216, 189 | "peak_max_in_bytes": 178978816 190 | } 191 | } 192 | }, 193 | "threads": { 194 | "count": 49, 195 | "peak_count": 53 196 | }, 197 | "gc": { 198 | "collectors": { 199 | "young": { 200 | "collection_count": 4, 201 | "collection_time_in_millis": 79 202 | }, 203 | "old": { 204 | "collection_count": 1, 205 | "collection_time_in_millis": 31 206 | } 207 | } 208 | }, 209 | "buffer_pools": { 210 | "direct": { 211 | "count": 55, 212 | "used_in_bytes": 8476870, 213 | "total_capacity_in_bytes": 8476870 214 | }, 215 | "mapped": { 216 | "count": 0, 217 | "used_in_bytes": 0, 218 | "total_capacity_in_bytes": 0 219 | } 220 | } 221 | }, 222 | "thread_pool": { 223 | "percolate": { 224 | "threads": 0, 225 | "queue": 0, 226 | "active": 0, 227 | "rejected": 0, 228 | "largest": 0, 229 | "completed": 0 230 | }, 231 | "bench": { 232 | "threads": 0, 233 | "queue": 0, 234 | "active": 0, 235 | "rejected": 0, 236 | "largest": 0, 237 | "completed": 0 238 | }, 239 | "listener": { 240 | "threads": 2, 241 | "queue": 0, 242 | "active": 0, 243 | "rejected": 0, 244 | "largest": 2, 245 | "completed": 18 246 | }, 247 | "index": { 248 | "threads": 0, 249 | "queue": 0, 250 | "active": 0, 251 | "rejected": 0, 252 | "largest": 0, 253 | "completed": 0 254 | }, 255 | "refresh": { 256 | "threads": 0, 257 | "queue": 0, 258 | "active": 0, 259 | "rejected": 0, 260 | "largest": 0, 261 | "completed": 0 262 | }, 263 | "suggest": { 264 | "threads": 0, 265 | "queue": 0, 266 | "active": 0, 267 | "rejected": 0, 268 | "largest": 0, 269 | "completed": 0 270 | }, 271 | "generic": { 272 | "threads": 1, 273 | "queue": 0, 274 | "active": 0, 275 | "rejected": 0, 276 | "largest": 4, 277 | "completed": 67 278 | }, 279 | "warmer": { 280 | "threads": 2, 281 | "queue": 0, 282 | "active": 0, 283 | "rejected": 0, 284 | "largest": 2, 285 | "completed": 376 286 | }, 287 | "search": { 288 | "threads": 0, 289 | "queue": 0, 290 | "active": 0, 291 | "rejected": 0, 292 | "largest": 0, 293 | "completed": 0 294 | }, 295 | "flush": { 296 | "threads": 0, 297 | "queue": 0, 298 | "active": 0, 299 | "rejected": 0, 300 | "largest": 0, 301 | "completed": 0 302 | }, 303 | "optimize": { 304 | "threads": 0, 305 | "queue": 0, 306 | "active": 0, 307 | "rejected": 0, 308 | "largest": 0, 309 | "completed": 0 310 | }, 311 | "management": { 312 | "threads": 5, 313 | "queue": 0, 314 | "active": 1, 315 | "rejected": 0, 316 | "largest": 5, 317 | "completed": 174 318 | }, 319 | "get": { 320 | "threads": 0, 321 | "queue": 0, 322 | "active": 0, 323 | "rejected": 0, 324 | "largest": 0, 325 | "completed": 0 326 | }, 327 | "merge": { 328 | "threads": 0, 329 | "queue": 0, 330 | "active": 0, 331 | "rejected": 0, 332 | "largest": 0, 333 | "completed": 0 334 | }, 335 | "bulk": { 336 | "threads": 0, 337 | "queue": 0, 338 | "active": 0, 339 | "rejected": 0, 340 | "largest": 0, 341 | "completed": 0 342 | }, 343 | "snapshot": { 344 | "threads": 0, 345 | "queue": 0, 346 | "active": 0, 347 | "rejected": 0, 348 | "largest": 0, 349 | "completed": 0 350 | } 351 | }, 352 | "network": { 353 | "tcp": { 354 | "active_opens": 242233, 355 | "passive_opens": 99299, 356 | "curr_estab": 115, 357 | "in_segs": 47228375, 358 | "out_segs": 26705512, 359 | "retrans_segs": 140959, 360 | "estab_resets": 3722, 361 | "attempt_fails": 51622, 362 | "in_errs": 408, 363 | "out_rsts": -1 364 | } 365 | }, 366 | "fs": { 367 | "timestamp": 1425675889339, 368 | "total": { 369 | "total_in_bytes": 318877626368, 370 | "free_in_bytes": 16657862656, 371 | "available_in_bytes": 16395718656, 372 | "disk_reads": 0, 373 | "disk_writes": 0, 374 | "disk_io_op": 0, 375 | "disk_read_size_in_bytes": 0, 376 | "disk_write_size_in_bytes": 0, 377 | "disk_io_size_in_bytes": 0 378 | }, 379 | "data": [ 380 | { 381 | "path": "/usr/local/var/elasticsearch/elasticsearch_snov/nodes/0", 382 | "mount": "/", 383 | "dev": "/dev/disk1", 384 | "total_in_bytes": 318877626368, 385 | "free_in_bytes": 16657862656, 386 | "available_in_bytes": 16395718656, 387 | "disk_reads": 0, 388 | "disk_writes": 0, 389 | "disk_io_op": 0, 390 | "disk_read_size_in_bytes": 0, 391 | "disk_write_size_in_bytes": 0, 392 | "disk_io_size_in_bytes": 0 393 | } 394 | ] 395 | }, 396 | "transport": { 397 | "server_open": 13, 398 | "rx_count": 6, 399 | "rx_size_in_bytes": 1644, 400 | "tx_count": 6, 401 | "tx_size_in_bytes": 1644 402 | }, 403 | "http": { 404 | "current_open": 6, 405 | "total_opened": 6 406 | }, 407 | "breakers": { 408 | "fielddata": { 409 | "limit_size_in_bytes": 155713536, 410 | "limit_size": "148.5mb", 411 | "estimated_size_in_bytes": 93944, 412 | "estimated_size": "91.7kb", 413 | "overhead": 1.03, 414 | "tripped": 0 415 | }, 416 | "request": { 417 | "limit_size_in_bytes": 103809024, 418 | "limit_size": "99mb", 419 | "estimated_size_in_bytes": 0, 420 | "estimated_size": "0b", 421 | "overhead": 1, 422 | "tripped": 0 423 | }, 424 | "parent": { 425 | "limit_size_in_bytes": 181665792, 426 | "limit_size": "173.2mb", 427 | "estimated_size_in_bytes": 93944, 428 | "estimated_size": "91.7kb", 429 | "overhead": 1, 430 | "tripped": 0 431 | } 432 | } 433 | } 434 | } 435 | } -------------------------------------------------------------------------------- /src/test/resources/nodes_stats_1.4.2_incomplete_os_stats.json: -------------------------------------------------------------------------------- 1 | { 2 | "cluster_name": "elasticsearch_snov", 3 | "nodes": { 4 | "nyYPfm-YQpO56BL1sOvpjQ": { 5 | "timestamp": 1425675889329, 6 | "name": "Edwin Jarvis", 7 | "transport_address": "inet[/192.168.178.24:9300]", 8 | "host": "macbook.fritz.box", 9 | "ip": [ 10 | "inet[/192.168.178.24:9300]", 11 | "NONE" 12 | ], 13 | "indices": { 14 | "docs": { 15 | "count": 89677, 16 | "deleted": 0 17 | }, 18 | "store": { 19 | "size_in_bytes": 9987981, 20 | "throttle_time_in_millis": 0 21 | }, 22 | "indexing": { 23 | "index_total": 0, 24 | "index_time_in_millis": 0, 25 | "index_current": 0, 26 | "delete_total": 0, 27 | "delete_time_in_millis": 0, 28 | "delete_current": 0, 29 | "noop_update_total": 0, 30 | "is_throttled": false, 31 | "throttle_time_in_millis": 0 32 | }, 33 | "get": { 34 | "total": 0, 35 | "time_in_millis": 0, 36 | "exists_total": 0, 37 | "exists_time_in_millis": 0, 38 | "missing_total": 0, 39 | "missing_time_in_millis": 0, 40 | "current": 0 41 | }, 42 | "search": { 43 | "open_contexts": 0, 44 | "query_total": 0, 45 | "query_time_in_millis": 0, 46 | "query_current": 0, 47 | "fetch_total": 0, 48 | "fetch_time_in_millis": 0, 49 | "fetch_current": 0 50 | }, 51 | "merges": { 52 | "current": 0, 53 | "current_docs": 0, 54 | "current_size_in_bytes": 0, 55 | "total": 0, 56 | "total_time_in_millis": 0, 57 | "total_docs": 0, 58 | "total_size_in_bytes": 0 59 | }, 60 | "refresh": { 61 | "total": 16, 62 | "total_time_in_millis": 0 63 | }, 64 | "flush": { 65 | "total": 0, 66 | "total_time_in_millis": 0 67 | }, 68 | "warmer": { 69 | "current": 0, 70 | "total": 32, 71 | "total_time_in_millis": 1134 72 | }, 73 | "filter_cache": { 74 | "memory_size_in_bytes": 0, 75 | "evictions": 0 76 | }, 77 | "id_cache": { 78 | "memory_size_in_bytes": 93944 79 | }, 80 | "fielddata": { 81 | "memory_size_in_bytes": 0, 82 | "evictions": 0 83 | }, 84 | "percolate": { 85 | "total": 0, 86 | "time_in_millis": 0, 87 | "current": 0, 88 | "memory_size_in_bytes": -1, 89 | "memory_size": "-1b", 90 | "queries": 0 91 | }, 92 | "completion": { 93 | "size_in_bytes": 0 94 | }, 95 | "segments": { 96 | "count": 11, 97 | "memory_in_bytes": 1035174, 98 | "index_writer_memory_in_bytes": 0, 99 | "index_writer_max_memory_in_bytes": 67108864, 100 | "version_map_memory_in_bytes": 0, 101 | "fixed_bit_set_memory_in_bytes": 515712 102 | }, 103 | "translog": { 104 | "operations": 0, 105 | "size_in_bytes": 17 106 | }, 107 | "suggest": { 108 | "total": 0, 109 | "time_in_millis": 0, 110 | "current": 0 111 | }, 112 | "query_cache": { 113 | "memory_size_in_bytes": 0, 114 | "evictions": 0, 115 | "hit_count": 0, 116 | "miss_count": 0 117 | } 118 | }, 119 | "os": { 120 | "timestamp": 1425675889337 121 | }, 122 | "process": { 123 | "timestamp": 1425675889337, 124 | "open_file_descriptors": 217, 125 | "cpu": { 126 | "percent": 1, 127 | "sys_in_millis": 1606, 128 | "user_in_millis": 18634, 129 | "total_in_millis": 20240 130 | }, 131 | "mem": { 132 | "resident_in_bytes": 275562496, 133 | "share_in_bytes": -1, 134 | "total_virtual_in_bytes": 4309331968 135 | } 136 | }, 137 | "jvm": { 138 | "timestamp": 1425675889337, 139 | "uptime_in_millis": 307356, 140 | "mem": { 141 | "heap_used_in_bytes": 71481704, 142 | "heap_used_percent": 27, 143 | "heap_committed_in_bytes": 259522560, 144 | "heap_max_in_bytes": 259522560, 145 | "non_heap_used_in_bytes": 50654800, 146 | "non_heap_committed_in_bytes": 51552256, 147 | "pools": { 148 | "young": { 149 | "used_in_bytes": 44540592, 150 | "max_in_bytes": 71630848, 151 | "peak_used_in_bytes": 71630848, 152 | "peak_max_in_bytes": 71630848 153 | }, 154 | "survivor": { 155 | "used_in_bytes": 8912896, 156 | "max_in_bytes": 8912896, 157 | "peak_used_in_bytes": 8912896, 158 | "peak_max_in_bytes": 8912896 159 | }, 160 | "old": { 161 | "used_in_bytes": 18028216, 162 | "max_in_bytes": 178978816, 163 | "peak_used_in_bytes": 18028216, 164 | "peak_max_in_bytes": 178978816 165 | } 166 | } 167 | }, 168 | "threads": { 169 | "count": 49, 170 | "peak_count": 53 171 | }, 172 | "gc": { 173 | "collectors": { 174 | "young": { 175 | "collection_count": 4, 176 | "collection_time_in_millis": 79 177 | }, 178 | "old": { 179 | "collection_count": 1, 180 | "collection_time_in_millis": 31 181 | } 182 | } 183 | }, 184 | "buffer_pools": { 185 | "direct": { 186 | "count": 55, 187 | "used_in_bytes": 8476870, 188 | "total_capacity_in_bytes": 8476870 189 | }, 190 | "mapped": { 191 | "count": 0, 192 | "used_in_bytes": 0, 193 | "total_capacity_in_bytes": 0 194 | } 195 | } 196 | }, 197 | "thread_pool": { 198 | "percolate": { 199 | "threads": 0, 200 | "queue": 0, 201 | "active": 0, 202 | "rejected": 0, 203 | "largest": 0, 204 | "completed": 0 205 | }, 206 | "bench": { 207 | "threads": 0, 208 | "queue": 0, 209 | "active": 0, 210 | "rejected": 0, 211 | "largest": 0, 212 | "completed": 0 213 | }, 214 | "listener": { 215 | "threads": 2, 216 | "queue": 0, 217 | "active": 0, 218 | "rejected": 0, 219 | "largest": 2, 220 | "completed": 18 221 | }, 222 | "index": { 223 | "threads": 0, 224 | "queue": 0, 225 | "active": 0, 226 | "rejected": 0, 227 | "largest": 0, 228 | "completed": 0 229 | }, 230 | "refresh": { 231 | "threads": 0, 232 | "queue": 0, 233 | "active": 0, 234 | "rejected": 0, 235 | "largest": 0, 236 | "completed": 0 237 | }, 238 | "suggest": { 239 | "threads": 0, 240 | "queue": 0, 241 | "active": 0, 242 | "rejected": 0, 243 | "largest": 0, 244 | "completed": 0 245 | }, 246 | "generic": { 247 | "threads": 1, 248 | "queue": 0, 249 | "active": 0, 250 | "rejected": 0, 251 | "largest": 4, 252 | "completed": 67 253 | }, 254 | "warmer": { 255 | "threads": 2, 256 | "queue": 0, 257 | "active": 0, 258 | "rejected": 0, 259 | "largest": 2, 260 | "completed": 376 261 | }, 262 | "search": { 263 | "threads": 0, 264 | "queue": 0, 265 | "active": 0, 266 | "rejected": 0, 267 | "largest": 0, 268 | "completed": 0 269 | }, 270 | "flush": { 271 | "threads": 0, 272 | "queue": 0, 273 | "active": 0, 274 | "rejected": 0, 275 | "largest": 0, 276 | "completed": 0 277 | }, 278 | "optimize": { 279 | "threads": 0, 280 | "queue": 0, 281 | "active": 0, 282 | "rejected": 0, 283 | "largest": 0, 284 | "completed": 0 285 | }, 286 | "management": { 287 | "threads": 5, 288 | "queue": 0, 289 | "active": 1, 290 | "rejected": 0, 291 | "largest": 5, 292 | "completed": 174 293 | }, 294 | "get": { 295 | "threads": 0, 296 | "queue": 0, 297 | "active": 0, 298 | "rejected": 0, 299 | "largest": 0, 300 | "completed": 0 301 | }, 302 | "merge": { 303 | "threads": 0, 304 | "queue": 0, 305 | "active": 0, 306 | "rejected": 0, 307 | "largest": 0, 308 | "completed": 0 309 | }, 310 | "bulk": { 311 | "threads": 0, 312 | "queue": 0, 313 | "active": 0, 314 | "rejected": 0, 315 | "largest": 0, 316 | "completed": 0 317 | }, 318 | "snapshot": { 319 | "threads": 0, 320 | "queue": 0, 321 | "active": 0, 322 | "rejected": 0, 323 | "largest": 0, 324 | "completed": 0 325 | } 326 | }, 327 | "network": { 328 | "tcp": { 329 | "active_opens": 242233, 330 | "passive_opens": 99299, 331 | "curr_estab": 115, 332 | "in_segs": 47228375, 333 | "out_segs": 26705512, 334 | "retrans_segs": 140959, 335 | "estab_resets": 3722, 336 | "attempt_fails": 51622, 337 | "in_errs": 408, 338 | "out_rsts": -1 339 | } 340 | }, 341 | "fs": { 342 | "timestamp": 1425675889339, 343 | "total": { 344 | "total_in_bytes": 318877626368, 345 | "free_in_bytes": 16657862656, 346 | "available_in_bytes": 16395718656, 347 | "disk_reads": 0, 348 | "disk_writes": 0, 349 | "disk_io_op": 0, 350 | "disk_read_size_in_bytes": 0, 351 | "disk_write_size_in_bytes": 0, 352 | "disk_io_size_in_bytes": 0 353 | }, 354 | "data": [ 355 | { 356 | "path": "/usr/local/var/elasticsearch/elasticsearch_snov/nodes/0", 357 | "mount": "/", 358 | "dev": "/dev/disk1", 359 | "total_in_bytes": 318877626368, 360 | "free_in_bytes": 16657862656, 361 | "available_in_bytes": 16395718656, 362 | "disk_reads": 0, 363 | "disk_writes": 0, 364 | "disk_io_op": 0, 365 | "disk_read_size_in_bytes": 0, 366 | "disk_write_size_in_bytes": 0, 367 | "disk_io_size_in_bytes": 0 368 | } 369 | ] 370 | }, 371 | "transport": { 372 | "server_open": 13, 373 | "rx_count": 6, 374 | "rx_size_in_bytes": 1644, 375 | "tx_count": 6, 376 | "tx_size_in_bytes": 1644 377 | }, 378 | "http": { 379 | "current_open": 6, 380 | "total_opened": 6 381 | }, 382 | "breakers": { 383 | "fielddata": { 384 | "limit_size_in_bytes": 155713536, 385 | "limit_size": "148.5mb", 386 | "estimated_size_in_bytes": 93944, 387 | "estimated_size": "91.7kb", 388 | "overhead": 1.03, 389 | "tripped": 0 390 | }, 391 | "request": { 392 | "limit_size_in_bytes": 103809024, 393 | "limit_size": "99mb", 394 | "estimated_size_in_bytes": 0, 395 | "estimated_size": "0b", 396 | "overhead": 1, 397 | "tripped": 0 398 | }, 399 | "parent": { 400 | "limit_size_in_bytes": 181665792, 401 | "limit_size": "173.2mb", 402 | "estimated_size_in_bytes": 93944, 403 | "estimated_size": "91.7kb", 404 | "overhead": 1, 405 | "tripped": 0 406 | } 407 | } 408 | } 409 | } 410 | } -------------------------------------------------------------------------------- /src/test/resources/nodes_stats_1.5.1.json: -------------------------------------------------------------------------------- 1 | { 2 | "cluster_name": "elasticsearch", 3 | "nodes": { 4 | "_ombiecYRe-pD49RT_XsdQ": { 5 | "timestamp": 1429638174211, 6 | "name": "Obadiah Stane", 7 | "transport_address": "inet[/172.17.0.18:9300]", 8 | "host": "03eb0cbbeb76", 9 | "ip": [ 10 | "inet[/172.17.0.18:9300]", 11 | "NONE" 12 | ], 13 | "indices": { 14 | "docs": { 15 | "count": 0, 16 | "deleted": 0 17 | }, 18 | "store": { 19 | "size_in_bytes": 0, 20 | "throttle_time_in_millis": 0 21 | }, 22 | "indexing": { 23 | "index_total": 0, 24 | "index_time_in_millis": 0, 25 | "index_current": 0, 26 | "delete_total": 0, 27 | "delete_time_in_millis": 0, 28 | "delete_current": 0, 29 | "noop_update_total": 0, 30 | "is_throttled": false, 31 | "throttle_time_in_millis": 0 32 | }, 33 | "get": { 34 | "total": 0, 35 | "time_in_millis": 0, 36 | "exists_total": 0, 37 | "exists_time_in_millis": 0, 38 | "missing_total": 0, 39 | "missing_time_in_millis": 0, 40 | "current": 0 41 | }, 42 | "search": { 43 | "open_contexts": 0, 44 | "query_total": 0, 45 | "query_time_in_millis": 0, 46 | "query_current": 0, 47 | "fetch_total": 0, 48 | "fetch_time_in_millis": 0, 49 | "fetch_current": 0 50 | }, 51 | "merges": { 52 | "current": 0, 53 | "current_docs": 0, 54 | "current_size_in_bytes": 0, 55 | "total": 0, 56 | "total_time_in_millis": 0, 57 | "total_docs": 0, 58 | "total_size_in_bytes": 0 59 | }, 60 | "refresh": { 61 | "total": 0, 62 | "total_time_in_millis": 0 63 | }, 64 | "flush": { 65 | "total": 0, 66 | "total_time_in_millis": 0 67 | }, 68 | "warmer": { 69 | "current": 0, 70 | "total": 0, 71 | "total_time_in_millis": 0 72 | }, 73 | "filter_cache": { 74 | "memory_size_in_bytes": 0, 75 | "evictions": 0 76 | }, 77 | "id_cache": { 78 | "memory_size_in_bytes": 0 79 | }, 80 | "fielddata": { 81 | "memory_size_in_bytes": 0, 82 | "evictions": 0 83 | }, 84 | "percolate": { 85 | "total": 0, 86 | "time_in_millis": 0, 87 | "current": 0, 88 | "memory_size_in_bytes": -1, 89 | "memory_size": "-1b", 90 | "queries": 0 91 | }, 92 | "completion": { 93 | "size_in_bytes": 0 94 | }, 95 | "segments": { 96 | "count": 0, 97 | "memory_in_bytes": 0, 98 | "index_writer_memory_in_bytes": 0, 99 | "index_writer_max_memory_in_bytes": 0, 100 | "version_map_memory_in_bytes": 0, 101 | "fixed_bit_set_memory_in_bytes": 0 102 | }, 103 | "translog": { 104 | "operations": 0, 105 | "size_in_bytes": 0 106 | }, 107 | "suggest": { 108 | "total": 0, 109 | "time_in_millis": 0, 110 | "current": 0 111 | }, 112 | "query_cache": { 113 | "memory_size_in_bytes": 0, 114 | "evictions": 0, 115 | "hit_count": 0, 116 | "miss_count": 0 117 | }, 118 | "recovery": { 119 | "current_as_source": 0, 120 | "current_as_target": 0, 121 | "throttle_time_in_millis": 0 122 | } 123 | }, 124 | "os": { 125 | "timestamp": 1429638174211, 126 | "uptime_in_millis": 3155, 127 | "load_average": [ 128 | 0.15, 129 | 0.11, 130 | 0.07 131 | ], 132 | "cpu": { 133 | "sys": 0, 134 | "user": 1, 135 | "idle": 98, 136 | "usage": 1, 137 | "stolen": 0 138 | }, 139 | "mem": { 140 | "free_in_bytes": 277716992, 141 | "used_in_bytes": 1827684352, 142 | "free_percent": 80, 143 | "used_percent": 19, 144 | "actual_free_in_bytes": 1688621056, 145 | "actual_used_in_bytes": 416780288 146 | }, 147 | "swap": { 148 | "used_in_bytes": 0, 149 | "free_in_bytes": 494632960 150 | } 151 | }, 152 | "process": { 153 | "timestamp": 1429638174211, 154 | "open_file_descriptors": 223, 155 | "cpu": { 156 | "percent": 3, 157 | "sys_in_millis": 380, 158 | "user_in_millis": 4750, 159 | "total_in_millis": 5130 160 | }, 161 | "mem": { 162 | "resident_in_bytes": 240254976, 163 | "share_in_bytes": 18501632, 164 | "total_virtual_in_bytes": 5832884224 165 | } 166 | }, 167 | "jvm": { 168 | "timestamp": 1429638174211, 169 | "uptime_in_millis": 39855, 170 | "mem": { 171 | "heap_used_in_bytes": 53142384, 172 | "heap_used_percent": 5, 173 | "heap_committed_in_bytes": 259522560, 174 | "heap_max_in_bytes": 1037959168, 175 | "non_heap_used_in_bytes": 30904008, 176 | "non_heap_committed_in_bytes": 32571392, 177 | "pools": { 178 | "young": { 179 | "used_in_bytes": 29713384, 180 | "max_in_bytes": 286326784, 181 | "peak_used_in_bytes": 71630848, 182 | "peak_max_in_bytes": 286326784 183 | }, 184 | "survivor": { 185 | "used_in_bytes": 8912888, 186 | "max_in_bytes": 35782656, 187 | "peak_used_in_bytes": 8912896, 188 | "peak_max_in_bytes": 35782656 189 | }, 190 | "old": { 191 | "used_in_bytes": 14516112, 192 | "max_in_bytes": 715849728, 193 | "peak_used_in_bytes": 14516112, 194 | "peak_max_in_bytes": 715849728 195 | } 196 | } 197 | }, 198 | "threads": { 199 | "count": 68, 200 | "peak_count": 68 201 | }, 202 | "gc": { 203 | "collectors": { 204 | "young": { 205 | "collection_count": 2, 206 | "collection_time_in_millis": 40 207 | }, 208 | "old": { 209 | "collection_count": 0, 210 | "collection_time_in_millis": 0 211 | } 212 | } 213 | }, 214 | "buffer_pools": { 215 | "direct": { 216 | "count": 60, 217 | "used_in_bytes": 7870586, 218 | "total_capacity_in_bytes": 7870586 219 | }, 220 | "mapped": { 221 | "count": 0, 222 | "used_in_bytes": 0, 223 | "total_capacity_in_bytes": 0 224 | } 225 | } 226 | }, 227 | "thread_pool": { 228 | "generic": { 229 | "threads": 1, 230 | "queue": 0, 231 | "active": 0, 232 | "rejected": 0, 233 | "largest": 2, 234 | "completed": 11 235 | }, 236 | "index": { 237 | "threads": 0, 238 | "queue": 0, 239 | "active": 0, 240 | "rejected": 0, 241 | "largest": 0, 242 | "completed": 0 243 | }, 244 | "get": { 245 | "threads": 0, 246 | "queue": 0, 247 | "active": 0, 248 | "rejected": 0, 249 | "largest": 0, 250 | "completed": 0 251 | }, 252 | "snapshot": { 253 | "threads": 0, 254 | "queue": 0, 255 | "active": 0, 256 | "rejected": 0, 257 | "largest": 0, 258 | "completed": 0 259 | }, 260 | "merge": { 261 | "threads": 0, 262 | "queue": 0, 263 | "active": 0, 264 | "rejected": 0, 265 | "largest": 0, 266 | "completed": 0 267 | }, 268 | "suggest": { 269 | "threads": 0, 270 | "queue": 0, 271 | "active": 0, 272 | "rejected": 0, 273 | "largest": 0, 274 | "completed": 0 275 | }, 276 | "bulk": { 277 | "threads": 0, 278 | "queue": 0, 279 | "active": 0, 280 | "rejected": 0, 281 | "largest": 0, 282 | "completed": 0 283 | }, 284 | "optimize": { 285 | "threads": 0, 286 | "queue": 0, 287 | "active": 0, 288 | "rejected": 0, 289 | "largest": 0, 290 | "completed": 0 291 | }, 292 | "warmer": { 293 | "threads": 0, 294 | "queue": 0, 295 | "active": 0, 296 | "rejected": 0, 297 | "largest": 0, 298 | "completed": 0 299 | }, 300 | "flush": { 301 | "threads": 0, 302 | "queue": 0, 303 | "active": 0, 304 | "rejected": 0, 305 | "largest": 0, 306 | "completed": 0 307 | }, 308 | "search": { 309 | "threads": 0, 310 | "queue": 0, 311 | "active": 0, 312 | "rejected": 0, 313 | "largest": 0, 314 | "completed": 0 315 | }, 316 | "listener": { 317 | "threads": 0, 318 | "queue": 0, 319 | "active": 0, 320 | "rejected": 0, 321 | "largest": 0, 322 | "completed": 0 323 | }, 324 | "percolate": { 325 | "threads": 0, 326 | "queue": 0, 327 | "active": 0, 328 | "rejected": 0, 329 | "largest": 0, 330 | "completed": 0 331 | }, 332 | "management": { 333 | "threads": 2, 334 | "queue": 0, 335 | "active": 1, 336 | "rejected": 0, 337 | "largest": 2, 338 | "completed": 6 339 | }, 340 | "refresh": { 341 | "threads": 0, 342 | "queue": 0, 343 | "active": 0, 344 | "rejected": 0, 345 | "largest": 0, 346 | "completed": 0 347 | } 348 | }, 349 | "network": { 350 | "tcp": { 351 | "active_opens": 13, 352 | "passive_opens": 16, 353 | "curr_estab": 27, 354 | "in_segs": 79, 355 | "out_segs": 73, 356 | "retrans_segs": 0, 357 | "estab_resets": 0, 358 | "attempt_fails": 0, 359 | "in_errs": 0, 360 | "out_rsts": 6 361 | } 362 | }, 363 | "fs": { 364 | "timestamp": 1429638174212, 365 | "total": { 366 | "total_in_bytes": 19507089408, 367 | "free_in_bytes": 18157953024, 368 | "available_in_bytes": 17143451648 369 | }, 370 | "data": [ 371 | { 372 | "path": "/usr/share/elasticsearch/data/elasticsearch/nodes/0", 373 | "mount": "/usr/share/elasticsearch/data", 374 | "dev": "/dev/sda1", 375 | "total_in_bytes": 19507089408, 376 | "free_in_bytes": 18157953024, 377 | "available_in_bytes": 17143451648 378 | } 379 | ] 380 | }, 381 | "transport": { 382 | "server_open": 13, 383 | "rx_count": 6, 384 | "rx_size_in_bytes": 1500, 385 | "tx_count": 6, 386 | "tx_size_in_bytes": 1500 387 | }, 388 | "http": { 389 | "current_open": 1, 390 | "total_opened": 3 391 | }, 392 | "breakers": { 393 | "request": { 394 | "limit_size_in_bytes": 415183667, 395 | "limit_size": "395.9mb", 396 | "estimated_size_in_bytes": 0, 397 | "estimated_size": "0b", 398 | "overhead": 1, 399 | "tripped": 0 400 | }, 401 | "fielddata": { 402 | "limit_size_in_bytes": 622775500, 403 | "limit_size": "593.9mb", 404 | "estimated_size_in_bytes": 0, 405 | "estimated_size": "0b", 406 | "overhead": 1.03, 407 | "tripped": 0 408 | }, 409 | "parent": { 410 | "limit_size_in_bytes": 726571417, 411 | "limit_size": "692.9mb", 412 | "estimated_size_in_bytes": 0, 413 | "estimated_size": "0b", 414 | "overhead": 1, 415 | "tripped": 0 416 | } 417 | } 418 | } 419 | } 420 | } -------------------------------------------------------------------------------- /src/test/resources/nodes_stats_2.1.1.json: -------------------------------------------------------------------------------- 1 | { 2 | "cluster_name" : "elasticsearch", 3 | "nodes" : { 4 | "nfxaGjN8QLqmru6bA2RoxQ" : { 5 | "timestamp" : 1459467547006, 6 | "name" : "Everyman", 7 | "transport_address" : "127.0.0.1:9300", 8 | "host" : "127.0.0.1", 9 | "ip" : [ "127.0.0.1:9300", "NONE" ], 10 | "indices" : { 11 | "docs" : { 12 | "count" : 0, 13 | "deleted" : 0 14 | }, 15 | "store" : { 16 | "size_in_bytes" : 0, 17 | "throttle_time_in_millis" : 0 18 | }, 19 | "indexing" : { 20 | "index_total" : 0, 21 | "index_time_in_millis" : 0, 22 | "index_current" : 0, 23 | "index_failed" : 0, 24 | "delete_total" : 0, 25 | "delete_time_in_millis" : 0, 26 | "delete_current" : 0, 27 | "noop_update_total" : 0, 28 | "is_throttled" : false, 29 | "throttle_time_in_millis" : 0 30 | }, 31 | "get" : { 32 | "total" : 0, 33 | "time_in_millis" : 0, 34 | "exists_total" : 0, 35 | "exists_time_in_millis" : 0, 36 | "missing_total" : 0, 37 | "missing_time_in_millis" : 0, 38 | "current" : 0 39 | }, 40 | "search" : { 41 | "open_contexts" : 0, 42 | "query_total" : 0, 43 | "query_time_in_millis" : 0, 44 | "query_current" : 0, 45 | "fetch_total" : 0, 46 | "fetch_time_in_millis" : 0, 47 | "fetch_current" : 0, 48 | "scroll_total" : 0, 49 | "scroll_time_in_millis" : 0, 50 | "scroll_current" : 0 51 | }, 52 | "merges" : { 53 | "current" : 0, 54 | "current_docs" : 0, 55 | "current_size_in_bytes" : 0, 56 | "total" : 0, 57 | "total_time_in_millis" : 0, 58 | "total_docs" : 0, 59 | "total_size_in_bytes" : 0, 60 | "total_stopped_time_in_millis" : 0, 61 | "total_throttled_time_in_millis" : 0, 62 | "total_auto_throttle_in_bytes" : 0 63 | }, 64 | "refresh" : { 65 | "total" : 0, 66 | "total_time_in_millis" : 0 67 | }, 68 | "flush" : { 69 | "total" : 0, 70 | "total_time_in_millis" : 0 71 | }, 72 | "warmer" : { 73 | "current" : 0, 74 | "total" : 0, 75 | "total_time_in_millis" : 0 76 | }, 77 | "query_cache" : { 78 | "memory_size_in_bytes" : 0, 79 | "total_count" : 0, 80 | "hit_count" : 0, 81 | "miss_count" : 0, 82 | "cache_size" : 0, 83 | "cache_count" : 0, 84 | "evictions" : 0 85 | }, 86 | "fielddata" : { 87 | "memory_size_in_bytes" : 0, 88 | "evictions" : 0 89 | }, 90 | "percolate" : { 91 | "total" : 0, 92 | "time_in_millis" : 0, 93 | "current" : 0, 94 | "memory_size_in_bytes" : -1, 95 | "memory_size" : "-1b", 96 | "queries" : 0 97 | }, 98 | "completion" : { 99 | "size_in_bytes" : 0 100 | }, 101 | "segments" : { 102 | "count" : 0, 103 | "memory_in_bytes" : 0, 104 | "terms_memory_in_bytes" : 0, 105 | "stored_fields_memory_in_bytes" : 0, 106 | "term_vectors_memory_in_bytes" : 0, 107 | "norms_memory_in_bytes" : 0, 108 | "doc_values_memory_in_bytes" : 0, 109 | "index_writer_memory_in_bytes" : 0, 110 | "index_writer_max_memory_in_bytes" : 0, 111 | "version_map_memory_in_bytes" : 0, 112 | "fixed_bit_set_memory_in_bytes" : 0 113 | }, 114 | "translog" : { 115 | "operations" : 0, 116 | "size_in_bytes" : 0 117 | }, 118 | "suggest" : { 119 | "total" : 0, 120 | "time_in_millis" : 0, 121 | "current" : 0 122 | }, 123 | "request_cache" : { 124 | "memory_size_in_bytes" : 0, 125 | "evictions" : 0, 126 | "hit_count" : 0, 127 | "miss_count" : 0 128 | }, 129 | "recovery" : { 130 | "current_as_source" : 0, 131 | "current_as_target" : 0, 132 | "throttle_time_in_millis" : 0 133 | } 134 | }, 135 | "os" : { 136 | "timestamp" : 1459467547006, 137 | "load_average" : 2.67333984375, 138 | "mem" : { 139 | "total_in_bytes" : 17179869184, 140 | "free_in_bytes" : 746844160, 141 | "used_in_bytes" : 16433025024, 142 | "free_percent" : 4, 143 | "used_percent" : 96 144 | }, 145 | "swap" : { 146 | "total_in_bytes" : 1073741824, 147 | "free_in_bytes" : 1073741824, 148 | "used_in_bytes" : 0 149 | } 150 | }, 151 | "process" : { 152 | "timestamp" : 1459467547006, 153 | "open_file_descriptors" : 259, 154 | "max_file_descriptors" : 10240, 155 | "cpu" : { 156 | "percent" : 0, 157 | "total_in_millis" : 8677 158 | }, 159 | "mem" : { 160 | "total_virtual_in_bytes" : 5247422464 161 | } 162 | }, 163 | "jvm" : { 164 | "timestamp" : 1459467547006, 165 | "uptime_in_millis" : 54257, 166 | "mem" : { 167 | "heap_used_in_bytes" : 26313208, 168 | "heap_used_percent" : 2, 169 | "heap_committed_in_bytes" : 259522560, 170 | "heap_max_in_bytes" : 1037959168, 171 | "non_heap_used_in_bytes" : 42172864, 172 | "non_heap_committed_in_bytes" : 43663360, 173 | "pools" : { 174 | "young" : { 175 | "used_in_bytes" : 8736960, 176 | "max_in_bytes" : 286326784, 177 | "peak_used_in_bytes" : 71630848, 178 | "peak_max_in_bytes" : 286326784 179 | }, 180 | "survivor" : { 181 | "used_in_bytes" : 8426272, 182 | "max_in_bytes" : 35782656, 183 | "peak_used_in_bytes" : 8912896, 184 | "peak_max_in_bytes" : 35782656 185 | }, 186 | "old" : { 187 | "used_in_bytes" : 9149976, 188 | "max_in_bytes" : 715849728, 189 | "peak_used_in_bytes" : 9441008, 190 | "peak_max_in_bytes" : 715849728 191 | } 192 | } 193 | }, 194 | "threads" : { 195 | "count" : 74, 196 | "peak_count" : 77 197 | }, 198 | "gc" : { 199 | "collectors" : { 200 | "young" : { 201 | "collection_count" : 4, 202 | "collection_time_in_millis" : 47 203 | }, 204 | "old" : { 205 | "collection_count" : 1, 206 | "collection_time_in_millis" : 14 207 | } 208 | } 209 | }, 210 | "buffer_pools" : { 211 | "direct" : { 212 | "count" : 69, 213 | "used_in_bytes" : 10516294, 214 | "total_capacity_in_bytes" : 10516294 215 | }, 216 | "mapped" : { 217 | "count" : 0, 218 | "used_in_bytes" : 0, 219 | "total_capacity_in_bytes" : 0 220 | } 221 | }, 222 | "classes" : { 223 | "current_loaded_count" : 6138, 224 | "total_loaded_count" : 6138, 225 | "total_unloaded_count" : 0 226 | } 227 | }, 228 | "thread_pool" : { 229 | "bulk" : { 230 | "threads" : 0, 231 | "queue" : 0, 232 | "active" : 0, 233 | "rejected" : 0, 234 | "largest" : 0, 235 | "completed" : 0 236 | }, 237 | "fetch_shard_started" : { 238 | "threads" : 0, 239 | "queue" : 0, 240 | "active" : 0, 241 | "rejected" : 0, 242 | "largest" : 0, 243 | "completed" : 0 244 | }, 245 | "fetch_shard_store" : { 246 | "threads" : 0, 247 | "queue" : 0, 248 | "active" : 0, 249 | "rejected" : 0, 250 | "largest" : 0, 251 | "completed" : 0 252 | }, 253 | "flush" : { 254 | "threads" : 0, 255 | "queue" : 0, 256 | "active" : 0, 257 | "rejected" : 0, 258 | "largest" : 0, 259 | "completed" : 0 260 | }, 261 | "force_merge" : { 262 | "threads" : 0, 263 | "queue" : 0, 264 | "active" : 0, 265 | "rejected" : 0, 266 | "largest" : 0, 267 | "completed" : 0 268 | }, 269 | "generic" : { 270 | "threads" : 1, 271 | "queue" : 0, 272 | "active" : 0, 273 | "rejected" : 0, 274 | "largest" : 4, 275 | "completed" : 39 276 | }, 277 | "get" : { 278 | "threads" : 0, 279 | "queue" : 0, 280 | "active" : 0, 281 | "rejected" : 0, 282 | "largest" : 0, 283 | "completed" : 0 284 | }, 285 | "index" : { 286 | "threads" : 0, 287 | "queue" : 0, 288 | "active" : 0, 289 | "rejected" : 0, 290 | "largest" : 0, 291 | "completed" : 0 292 | }, 293 | "listener" : { 294 | "threads" : 1, 295 | "queue" : 0, 296 | "active" : 0, 297 | "rejected" : 0, 298 | "largest" : 1, 299 | "completed" : 1 300 | }, 301 | "management" : { 302 | "threads" : 2, 303 | "queue" : 0, 304 | "active" : 1, 305 | "rejected" : 0, 306 | "largest" : 2, 307 | "completed" : 7 308 | }, 309 | "percolate" : { 310 | "threads" : 0, 311 | "queue" : 0, 312 | "active" : 0, 313 | "rejected" : 0, 314 | "largest" : 0, 315 | "completed" : 0 316 | }, 317 | "refresh" : { 318 | "threads" : 0, 319 | "queue" : 0, 320 | "active" : 0, 321 | "rejected" : 0, 322 | "largest" : 0, 323 | "completed" : 0 324 | }, 325 | "search" : { 326 | "threads" : 0, 327 | "queue" : 0, 328 | "active" : 0, 329 | "rejected" : 0, 330 | "largest" : 0, 331 | "completed" : 0 332 | }, 333 | "snapshot" : { 334 | "threads" : 0, 335 | "queue" : 0, 336 | "active" : 0, 337 | "rejected" : 0, 338 | "largest" : 0, 339 | "completed" : 0 340 | }, 341 | "suggest" : { 342 | "threads" : 0, 343 | "queue" : 0, 344 | "active" : 0, 345 | "rejected" : 0, 346 | "largest" : 0, 347 | "completed" : 0 348 | }, 349 | "warmer" : { 350 | "threads" : 0, 351 | "queue" : 0, 352 | "active" : 0, 353 | "rejected" : 0, 354 | "largest" : 0, 355 | "completed" : 0 356 | } 357 | }, 358 | "fs" : { 359 | "timestamp" : 1459467547006, 360 | "total" : { 361 | "total_in_bytes" : 239063433216, 362 | "free_in_bytes" : 9278656512, 363 | "available_in_bytes" : 9016512512 364 | }, 365 | "data" : [ { 366 | "path" : "/usr/local/var/elasticsearch/elasticsearch/nodes/0", 367 | "mount" : "/ (/dev/disk0s2)", 368 | "type" : "hfs", 369 | "total_in_bytes" : 239063433216, 370 | "free_in_bytes" : 9278656512, 371 | "available_in_bytes" : 9016512512 372 | } ] 373 | }, 374 | "transport" : { 375 | "server_open" : 13, 376 | "rx_count" : 108, 377 | "rx_size_in_bytes" : 11579, 378 | "tx_count" : 109, 379 | "tx_size_in_bytes" : 18989 380 | }, 381 | "http" : { 382 | "current_open" : 1, 383 | "total_opened" : 2 384 | }, 385 | "breakers" : { 386 | "request" : { 387 | "limit_size_in_bytes" : 415183667, 388 | "limit_size" : "395.9mb", 389 | "estimated_size_in_bytes" : 0, 390 | "estimated_size" : "0b", 391 | "overhead" : 1.0, 392 | "tripped" : 0 393 | }, 394 | "fielddata" : { 395 | "limit_size_in_bytes" : 622775500, 396 | "limit_size" : "593.9mb", 397 | "estimated_size_in_bytes" : 0, 398 | "estimated_size" : "0b", 399 | "overhead" : 1.03, 400 | "tripped" : 0 401 | }, 402 | "parent" : { 403 | "limit_size_in_bytes" : 726571417, 404 | "limit_size" : "692.9mb", 405 | "estimated_size_in_bytes" : 0, 406 | "estimated_size" : "0b", 407 | "overhead" : 1.0, 408 | "tripped" : 0 409 | } 410 | }, 411 | "script" : { 412 | "compilations" : 0, 413 | "cache_evictions" : 0 414 | } 415 | }, 416 | "88CFbaIcRLql01dB6I0FCw" : { 417 | "timestamp" : 1459467547007, 418 | "name" : "Foolkiller", 419 | "transport_address" : "127.0.0.1:9301", 420 | "host" : "127.0.0.1", 421 | "ip" : [ "127.0.0.1:9301", "NONE" ], 422 | "indices" : { 423 | "docs" : { 424 | "count" : 0, 425 | "deleted" : 0 426 | }, 427 | "store" : { 428 | "size_in_bytes" : 0, 429 | "throttle_time_in_millis" : 0 430 | }, 431 | "indexing" : { 432 | "index_total" : 0, 433 | "index_time_in_millis" : 0, 434 | "index_current" : 0, 435 | "index_failed" : 0, 436 | "delete_total" : 0, 437 | "delete_time_in_millis" : 0, 438 | "delete_current" : 0, 439 | "noop_update_total" : 0, 440 | "is_throttled" : false, 441 | "throttle_time_in_millis" : 0 442 | }, 443 | "get" : { 444 | "total" : 0, 445 | "time_in_millis" : 0, 446 | "exists_total" : 0, 447 | "exists_time_in_millis" : 0, 448 | "missing_total" : 0, 449 | "missing_time_in_millis" : 0, 450 | "current" : 0 451 | }, 452 | "search" : { 453 | "open_contexts" : 0, 454 | "query_total" : 0, 455 | "query_time_in_millis" : 0, 456 | "query_current" : 0, 457 | "fetch_total" : 0, 458 | "fetch_time_in_millis" : 0, 459 | "fetch_current" : 0, 460 | "scroll_total" : 0, 461 | "scroll_time_in_millis" : 0, 462 | "scroll_current" : 0 463 | }, 464 | "merges" : { 465 | "current" : 0, 466 | "current_docs" : 0, 467 | "current_size_in_bytes" : 0, 468 | "total" : 0, 469 | "total_time_in_millis" : 0, 470 | "total_docs" : 0, 471 | "total_size_in_bytes" : 0, 472 | "total_stopped_time_in_millis" : 0, 473 | "total_throttled_time_in_millis" : 0, 474 | "total_auto_throttle_in_bytes" : 0 475 | }, 476 | "refresh" : { 477 | "total" : 0, 478 | "total_time_in_millis" : 0 479 | }, 480 | "flush" : { 481 | "total" : 0, 482 | "total_time_in_millis" : 0 483 | }, 484 | "warmer" : { 485 | "current" : 0, 486 | "total" : 0, 487 | "total_time_in_millis" : 0 488 | }, 489 | "query_cache" : { 490 | "memory_size_in_bytes" : 0, 491 | "total_count" : 0, 492 | "hit_count" : 0, 493 | "miss_count" : 0, 494 | "cache_size" : 0, 495 | "cache_count" : 0, 496 | "evictions" : 0 497 | }, 498 | "fielddata" : { 499 | "memory_size_in_bytes" : 0, 500 | "evictions" : 0 501 | }, 502 | "percolate" : { 503 | "total" : 0, 504 | "time_in_millis" : 0, 505 | "current" : 0, 506 | "memory_size_in_bytes" : -1, 507 | "memory_size" : "-1b", 508 | "queries" : 0 509 | }, 510 | "completion" : { 511 | "size_in_bytes" : 0 512 | }, 513 | "segments" : { 514 | "count" : 0, 515 | "memory_in_bytes" : 0, 516 | "terms_memory_in_bytes" : 0, 517 | "stored_fields_memory_in_bytes" : 0, 518 | "term_vectors_memory_in_bytes" : 0, 519 | "norms_memory_in_bytes" : 0, 520 | "doc_values_memory_in_bytes" : 0, 521 | "index_writer_memory_in_bytes" : 0, 522 | "index_writer_max_memory_in_bytes" : 0, 523 | "version_map_memory_in_bytes" : 0, 524 | "fixed_bit_set_memory_in_bytes" : 0 525 | }, 526 | "translog" : { 527 | "operations" : 0, 528 | "size_in_bytes" : 0 529 | }, 530 | "suggest" : { 531 | "total" : 0, 532 | "time_in_millis" : 0, 533 | "current" : 0 534 | }, 535 | "request_cache" : { 536 | "memory_size_in_bytes" : 0, 537 | "evictions" : 0, 538 | "hit_count" : 0, 539 | "miss_count" : 0 540 | }, 541 | "recovery" : { 542 | "current_as_source" : 0, 543 | "current_as_target" : 0, 544 | "throttle_time_in_millis" : 0 545 | } 546 | }, 547 | "os" : { 548 | "timestamp" : 1459467547007, 549 | "load_average" : 2.67333984375, 550 | "mem" : { 551 | "total_in_bytes" : 17179869184, 552 | "free_in_bytes" : 746893312, 553 | "used_in_bytes" : 16432975872, 554 | "free_percent" : 4, 555 | "used_percent" : 96 556 | }, 557 | "swap" : { 558 | "total_in_bytes" : 1073741824, 559 | "free_in_bytes" : 1073741824, 560 | "used_in_bytes" : 0 561 | } 562 | }, 563 | "process" : { 564 | "timestamp" : 1459467547007, 565 | "open_file_descriptors" : 258, 566 | "max_file_descriptors" : 10240, 567 | "cpu" : { 568 | "percent" : 0, 569 | "total_in_millis" : 8580 570 | }, 571 | "mem" : { 572 | "total_virtual_in_bytes" : 5244633088 573 | } 574 | }, 575 | "jvm" : { 576 | "timestamp" : 1459467547007, 577 | "uptime_in_millis" : 51129, 578 | "mem" : { 579 | "heap_used_in_bytes" : 26052720, 580 | "heap_used_percent" : 2, 581 | "heap_committed_in_bytes" : 259522560, 582 | "heap_max_in_bytes" : 1037959168, 583 | "non_heap_used_in_bytes" : 41476512, 584 | "non_heap_committed_in_bytes" : 42942464, 585 | "pools" : { 586 | "young" : { 587 | "used_in_bytes" : 9156176, 588 | "max_in_bytes" : 286326784, 589 | "peak_used_in_bytes" : 71630848, 590 | "peak_max_in_bytes" : 286326784 591 | }, 592 | "survivor" : { 593 | "used_in_bytes" : 7619176, 594 | "max_in_bytes" : 35782656, 595 | "peak_used_in_bytes" : 8912888, 596 | "peak_max_in_bytes" : 35782656 597 | }, 598 | "old" : { 599 | "used_in_bytes" : 9277368, 600 | "max_in_bytes" : 715849728, 601 | "peak_used_in_bytes" : 9765824, 602 | "peak_max_in_bytes" : 715849728 603 | } 604 | } 605 | }, 606 | "threads" : { 607 | "count" : 72, 608 | "peak_count" : 75 609 | }, 610 | "gc" : { 611 | "collectors" : { 612 | "young" : { 613 | "collection_count" : 4, 614 | "collection_time_in_millis" : 49 615 | }, 616 | "old" : { 617 | "collection_count" : 1, 618 | "collection_time_in_millis" : 12 619 | } 620 | } 621 | }, 622 | "buffer_pools" : { 623 | "direct" : { 624 | "count" : 63, 625 | "used_in_bytes" : 9969773, 626 | "total_capacity_in_bytes" : 9969773 627 | }, 628 | "mapped" : { 629 | "count" : 0, 630 | "used_in_bytes" : 0, 631 | "total_capacity_in_bytes" : 0 632 | } 633 | } 634 | }, 635 | "thread_pool" : { 636 | "bulk" : { 637 | "threads" : 0, 638 | "queue" : 0, 639 | "active" : 0, 640 | "rejected" : 0, 641 | "largest" : 0, 642 | "completed" : 0 643 | }, 644 | "fetch_shard_started" : { 645 | "threads" : 0, 646 | "queue" : 0, 647 | "active" : 0, 648 | "rejected" : 0, 649 | "largest" : 0, 650 | "completed" : 0 651 | }, 652 | "fetch_shard_store" : { 653 | "threads" : 0, 654 | "queue" : 0, 655 | "active" : 0, 656 | "rejected" : 0, 657 | "largest" : 0, 658 | "completed" : 0 659 | }, 660 | "flush" : { 661 | "threads" : 0, 662 | "queue" : 0, 663 | "active" : 0, 664 | "rejected" : 0, 665 | "largest" : 0, 666 | "completed" : 0 667 | }, 668 | "force_merge" : { 669 | "threads" : 0, 670 | "queue" : 0, 671 | "active" : 0, 672 | "rejected" : 0, 673 | "largest" : 0, 674 | "completed" : 0 675 | }, 676 | "generic" : { 677 | "threads" : 1, 678 | "queue" : 0, 679 | "active" : 0, 680 | "rejected" : 0, 681 | "largest" : 4, 682 | "completed" : 81 683 | }, 684 | "get" : { 685 | "threads" : 0, 686 | "queue" : 0, 687 | "active" : 0, 688 | "rejected" : 0, 689 | "largest" : 0, 690 | "completed" : 0 691 | }, 692 | "index" : { 693 | "threads" : 0, 694 | "queue" : 0, 695 | "active" : 0, 696 | "rejected" : 0, 697 | "largest" : 0, 698 | "completed" : 0 699 | }, 700 | "listener" : { 701 | "threads" : 0, 702 | "queue" : 0, 703 | "active" : 0, 704 | "rejected" : 0, 705 | "largest" : 0, 706 | "completed" : 0 707 | }, 708 | "management" : { 709 | "threads" : 1, 710 | "queue" : 0, 711 | "active" : 1, 712 | "rejected" : 0, 713 | "largest" : 1, 714 | "completed" : 3 715 | }, 716 | "percolate" : { 717 | "threads" : 0, 718 | "queue" : 0, 719 | "active" : 0, 720 | "rejected" : 0, 721 | "largest" : 0, 722 | "completed" : 0 723 | }, 724 | "refresh" : { 725 | "threads" : 0, 726 | "queue" : 0, 727 | "active" : 0, 728 | "rejected" : 0, 729 | "largest" : 0, 730 | "completed" : 0 731 | }, 732 | "search" : { 733 | "threads" : 0, 734 | "queue" : 0, 735 | "active" : 0, 736 | "rejected" : 0, 737 | "largest" : 0, 738 | "completed" : 0 739 | }, 740 | "snapshot" : { 741 | "threads" : 0, 742 | "queue" : 0, 743 | "active" : 0, 744 | "rejected" : 0, 745 | "largest" : 0, 746 | "completed" : 0 747 | }, 748 | "suggest" : { 749 | "threads" : 0, 750 | "queue" : 0, 751 | "active" : 0, 752 | "rejected" : 0, 753 | "largest" : 0, 754 | "completed" : 0 755 | }, 756 | "warmer" : { 757 | "threads" : 0, 758 | "queue" : 0, 759 | "active" : 0, 760 | "rejected" : 0, 761 | "largest" : 0, 762 | "completed" : 0 763 | } 764 | }, 765 | "fs" : { 766 | "timestamp" : 1459467547007, 767 | "total" : { 768 | "total_in_bytes" : 239063433216, 769 | "free_in_bytes" : 9278656512, 770 | "available_in_bytes" : 9016512512 771 | }, 772 | "data" : [ { 773 | "path" : "/usr/local/var/elasticsearch/elasticsearch/nodes/1", 774 | "mount" : "/ (/dev/disk0s2)", 775 | "type" : "hfs", 776 | "total_in_bytes" : 239063433216, 777 | "free_in_bytes" : 9278656512, 778 | "available_in_bytes" : 9016512512 779 | } ] 780 | }, 781 | "transport" : { 782 | "server_open" : 13, 783 | "rx_count" : 109, 784 | "rx_size_in_bytes" : 19037, 785 | "tx_count" : 108, 786 | "tx_size_in_bytes" : 11627 787 | }, 788 | "http" : { 789 | "current_open" : 0, 790 | "total_opened" : 0 791 | }, 792 | "breakers" : { 793 | "request" : { 794 | "limit_size_in_bytes" : 415183667, 795 | "limit_size" : "395.9mb", 796 | "estimated_size_in_bytes" : 0, 797 | "estimated_size" : "0b", 798 | "overhead" : 1.0, 799 | "tripped" : 0 800 | }, 801 | "fielddata" : { 802 | "limit_size_in_bytes" : 622775500, 803 | "limit_size" : "593.9mb", 804 | "estimated_size_in_bytes" : 0, 805 | "estimated_size" : "0b", 806 | "overhead" : 1.03, 807 | "tripped" : 0 808 | }, 809 | "parent" : { 810 | "limit_size_in_bytes" : 726571417, 811 | "limit_size" : "692.9mb", 812 | "estimated_size_in_bytes" : 0, 813 | "estimated_size" : "0b", 814 | "overhead" : 1.0, 815 | "tripped" : 0 816 | } 817 | }, 818 | "script" : { 819 | "compilations" : 0, 820 | "cache_evictions" : 0 821 | } 822 | } 823 | } 824 | } 825 | -------------------------------------------------------------------------------- /src/test/resources/nodes_stats_5.1.1.json: -------------------------------------------------------------------------------- 1 | { 2 | "_nodes": { 3 | "total": 1, 4 | "successful": 1, 5 | "failed": 0 6 | }, 7 | "cluster_name": "elasticsearch", 8 | "nodes": { 9 | "foobart-xxx": { 10 | "timestamp": 1482735534707, 11 | "name": "foobar", 12 | "transport_address": "127.0.0.1:9300", 13 | "host": "127.0.0.1", 14 | "ip": "127.0.0.1:9300", 15 | "roles": [ 16 | "master", 17 | "data", 18 | "ingest" 19 | ], 20 | "indices": { 21 | "docs": { 22 | "count": 165937, 23 | "deleted": 240 24 | }, 25 | "store": { 26 | "size_in_bytes": 127377112, 27 | "throttle_time_in_millis": 0 28 | }, 29 | "indexing": { 30 | "index_total": 914327, 31 | "index_time_in_millis": 393764, 32 | "index_current": 0, 33 | "index_failed": 0, 34 | "delete_total": 1956, 35 | "delete_time_in_millis": 87, 36 | "delete_current": 0, 37 | "noop_update_total": 0, 38 | "is_throttled": false, 39 | "throttle_time_in_millis": 0 40 | }, 41 | "get": { 42 | "total": 687, 43 | "time_in_millis": 115, 44 | "exists_total": 26, 45 | "exists_time_in_millis": 7, 46 | "missing_total": 661, 47 | "missing_time_in_millis": 108, 48 | "current": 0 49 | }, 50 | "search": { 51 | "open_contexts": 0, 52 | "query_total": 460, 53 | "query_time_in_millis": 2066, 54 | "query_current": 0, 55 | "fetch_total": 204, 56 | "fetch_time_in_millis": 83, 57 | "fetch_current": 0, 58 | "scroll_total": 0, 59 | "scroll_time_in_millis": 0, 60 | "scroll_current": 0, 61 | "suggest_total": 0, 62 | "suggest_time_in_millis": 0, 63 | "suggest_current": 0 64 | }, 65 | "merges": { 66 | "current": 0, 67 | "current_docs": 0, 68 | "current_size_in_bytes": 0, 69 | "total": 851, 70 | "total_time_in_millis": 277046, 71 | "total_docs": 2648171, 72 | "total_size_in_bytes": 4785273895, 73 | "total_stopped_time_in_millis": 0, 74 | "total_throttled_time_in_millis": 6226, 75 | "total_auto_throttle_in_bytes": 305040290 76 | }, 77 | "refresh": { 78 | "total": 16547, 79 | "total_time_in_millis": 241742 80 | }, 81 | "flush": { 82 | "total": 208, 83 | "total_time_in_millis": 2698 84 | }, 85 | "warmer": { 86 | "current": 0, 87 | "total": 16761, 88 | "total_time_in_millis": 3826 89 | }, 90 | "query_cache": { 91 | "memory_size_in_bytes": 480, 92 | "total_count": 1719, 93 | "hit_count": 818, 94 | "miss_count": 901, 95 | "cache_size": 30, 96 | "cache_count": 35, 97 | "evictions": 5 98 | }, 99 | "fielddata": { 100 | "memory_size_in_bytes": 0, 101 | "evictions": 0 102 | }, 103 | "completion": { 104 | "size_in_bytes": 0 105 | }, 106 | "segments": { 107 | "count": 96, 108 | "memory_in_bytes": 7507505, 109 | "terms_memory_in_bytes": 7239777, 110 | "stored_fields_memory_in_bytes": 147296, 111 | "term_vectors_memory_in_bytes": 0, 112 | "norms_memory_in_bytes": 29376, 113 | "points_memory_in_bytes": 8720, 114 | "doc_values_memory_in_bytes": 82336, 115 | "index_writer_memory_in_bytes": 0, 116 | "version_map_memory_in_bytes": 0, 117 | "fixed_bit_set_memory_in_bytes": 0, 118 | "max_unsafe_auto_id_timestamp": -1, 119 | "file_sizes": { 120 | 121 | } 122 | }, 123 | "translog": { 124 | "operations": 39, 125 | "size_in_bytes": 20123 126 | }, 127 | "request_cache": { 128 | "memory_size_in_bytes": 0, 129 | "evictions": 0, 130 | "hit_count": 0, 131 | "miss_count": 0 132 | }, 133 | "recovery": { 134 | "current_as_source": 0, 135 | "current_as_target": 0, 136 | "throttle_time_in_millis": 0 137 | } 138 | }, 139 | "os": { 140 | "timestamp": 1482735534709, 141 | "cpu": { 142 | "percent": 0, 143 | "load_average": { 144 | "1m": 0.2, 145 | "5m": 0.19, 146 | "15m": 0.16 147 | } 148 | }, 149 | "mem": { 150 | "total_in_bytes": 67442466816, 151 | "free_in_bytes": 435744768, 152 | "used_in_bytes": 67006722048, 153 | "free_percent": 1, 154 | "used_percent": 99 155 | }, 156 | "swap": { 157 | "total_in_bytes": 19305328640, 158 | "free_in_bytes": 14221918208, 159 | "used_in_bytes": 5083410432 160 | } 161 | }, 162 | "process": { 163 | "timestamp": 1482735534710, 164 | "open_file_descriptors": 474, 165 | "max_file_descriptors": 65536, 166 | "cpu": { 167 | "percent": 0, 168 | "total_in_millis": 1920780 169 | }, 170 | "mem": { 171 | "total_virtual_in_bytes": 16207618048 172 | } 173 | }, 174 | "jvm": { 175 | "timestamp": 1482735534710, 176 | "uptime_in_millis": 228760893, 177 | "mem": { 178 | "heap_used_in_bytes": 915978232, 179 | "heap_used_percent": 44, 180 | "heap_committed_in_bytes": 2075918336, 181 | "heap_max_in_bytes": 2075918336, 182 | "non_heap_used_in_bytes": 118175592, 183 | "non_heap_committed_in_bytes": 124145664, 184 | "pools": { 185 | "young": { 186 | "used_in_bytes": 182728344, 187 | "max_in_bytes": 572653568, 188 | "peak_used_in_bytes": 572653568, 189 | "peak_max_in_bytes": 572653568 190 | }, 191 | "survivor": { 192 | "used_in_bytes": 6705952, 193 | "max_in_bytes": 71565312, 194 | "peak_used_in_bytes": 71565312, 195 | "peak_max_in_bytes": 71565312 196 | }, 197 | "old": { 198 | "used_in_bytes": 726543936, 199 | "max_in_bytes": 1431699456, 200 | "peak_used_in_bytes": 1139298568, 201 | "peak_max_in_bytes": 1431699456 202 | } 203 | } 204 | }, 205 | "threads": { 206 | "count": 183, 207 | "peak_count": 189 208 | }, 209 | "gc": { 210 | "collectors": { 211 | "young": { 212 | "collection_count": 530, 213 | "collection_time_in_millis": 5764 214 | }, 215 | "old": { 216 | "collection_count": 26, 217 | "collection_time_in_millis": 1238 218 | } 219 | } 220 | }, 221 | "buffer_pools": { 222 | "direct": { 223 | "count": 124, 224 | "used_in_bytes": 357993242, 225 | "total_capacity_in_bytes": 357993241 226 | }, 227 | "mapped": { 228 | "count": 264, 229 | "used_in_bytes": 1261319260, 230 | "total_capacity_in_bytes": 1261319260 231 | } 232 | }, 233 | "classes": { 234 | "current_loaded_count": 10956, 235 | "total_loaded_count": 11098, 236 | "total_unloaded_count": 142 237 | } 238 | }, 239 | "thread_pool": { 240 | "bulk": { 241 | "threads": 20, 242 | "queue": 0, 243 | "active": 0, 244 | "rejected": 0, 245 | "largest": 20, 246 | "completed": 69123 247 | }, 248 | "fetch_shard_started": { 249 | "threads": 0, 250 | "queue": 0, 251 | "active": 0, 252 | "rejected": 0, 253 | "largest": 0, 254 | "completed": 0 255 | }, 256 | "fetch_shard_store": { 257 | "threads": 0, 258 | "queue": 0, 259 | "active": 0, 260 | "rejected": 0, 261 | "largest": 0, 262 | "completed": 0 263 | }, 264 | "flush": { 265 | "threads": 2, 266 | "queue": 0, 267 | "active": 0, 268 | "rejected": 0, 269 | "largest": 5, 270 | "completed": 416 271 | }, 272 | "force_merge": { 273 | "threads": 0, 274 | "queue": 0, 275 | "active": 0, 276 | "rejected": 0, 277 | "largest": 0, 278 | "completed": 0 279 | }, 280 | "generic": { 281 | "threads": 4, 282 | "queue": 0, 283 | "active": 0, 284 | "rejected": 0, 285 | "largest": 4, 286 | "completed": 22893 287 | }, 288 | "get": { 289 | "threads": 20, 290 | "queue": 0, 291 | "active": 0, 292 | "rejected": 0, 293 | "largest": 20, 294 | "completed": 687 295 | }, 296 | "index": { 297 | "threads": 20, 298 | "queue": 0, 299 | "active": 0, 300 | "rejected": 0, 301 | "largest": 20, 302 | "completed": 1960 303 | }, 304 | "listener": { 305 | "threads": 0, 306 | "queue": 0, 307 | "active": 0, 308 | "rejected": 0, 309 | "largest": 0, 310 | "completed": 0 311 | }, 312 | "management": { 313 | "threads": 5, 314 | "queue": 0, 315 | "active": 1, 316 | "rejected": 0, 317 | "largest": 5, 318 | "completed": 59301 319 | }, 320 | "refresh": { 321 | "threads": 2, 322 | "queue": 0, 323 | "active": 0, 324 | "rejected": 0, 325 | "largest": 2, 326 | "completed": 151733 327 | }, 328 | "search": { 329 | "threads": 31, 330 | "queue": 0, 331 | "active": 0, 332 | "rejected": 0, 333 | "largest": 31, 334 | "completed": 710 335 | }, 336 | "snapshot": { 337 | "threads": 0, 338 | "queue": 0, 339 | "active": 0, 340 | "rejected": 0, 341 | "largest": 0, 342 | "completed": 0 343 | }, 344 | "warmer": { 345 | "threads": 1, 346 | "queue": 0, 347 | "active": 0, 348 | "rejected": 0, 349 | "largest": 4, 350 | "completed": 16766 351 | } 352 | }, 353 | "fs": { 354 | "timestamp": 1482735534711, 355 | "total": { 356 | "total_in_bytes": 1948795334656, 357 | "free_in_bytes": 754493739008, 358 | "available_in_bytes": 655477022720, 359 | "spins": "true" 360 | }, 361 | "data": [ 362 | { 363 | "path": "/var/lib/elasticsearch/nodes/0", 364 | "mount": "/ (/dev/sda1)", 365 | "type": "ext4", 366 | "total_in_bytes": 1948795334656, 367 | "free_in_bytes": 754493739008, 368 | "available_in_bytes": 655477022720, 369 | "spins": "true" 370 | } 371 | ], 372 | "io_stats": { 373 | "devices": [ 374 | { 375 | "device_name": "sda1", 376 | "operations": 3090318, 377 | "read_operations": 968668, 378 | "write_operations": 2121650, 379 | "read_kilobytes": 56165732, 380 | "write_kilobytes": 54719620 381 | } 382 | ], 383 | "total": { 384 | "operations": 3090318, 385 | "read_operations": 968668, 386 | "write_operations": 2121650, 387 | "read_kilobytes": 56165732, 388 | "write_kilobytes": 54719620 389 | } 390 | } 391 | }, 392 | "transport": { 393 | "server_open": 0, 394 | "rx_count": 8, 395 | "rx_size_in_bytes": 3607, 396 | "tx_count": 8, 397 | "tx_size_in_bytes": 3607 398 | }, 399 | "http": { 400 | "current_open": 2, 401 | "total_opened": 1384 402 | }, 403 | "breakers": { 404 | "request": { 405 | "limit_size_in_bytes": 1245551001, 406 | "limit_size": "1.1gb", 407 | "estimated_size_in_bytes": 0, 408 | "estimated_size": "0b", 409 | "overhead": 1.0, 410 | "tripped": 0 411 | }, 412 | "fielddata": { 413 | "limit_size_in_bytes": 1245551001, 414 | "limit_size": "1.1gb", 415 | "estimated_size_in_bytes": 0, 416 | "estimated_size": "0b", 417 | "overhead": 1.03, 418 | "tripped": 0 419 | }, 420 | "in_flight_requests": { 421 | "limit_size_in_bytes": 2075918336, 422 | "limit_size": "1.9gb", 423 | "estimated_size_in_bytes": 0, 424 | "estimated_size": "0b", 425 | "overhead": 1.0, 426 | "tripped": 0 427 | }, 428 | "parent": { 429 | "limit_size_in_bytes": 1453142835, 430 | "limit_size": "1.3gb", 431 | "estimated_size_in_bytes": 0, 432 | "estimated_size": "0b", 433 | "overhead": 1.0, 434 | "tripped": 0 435 | } 436 | }, 437 | "script": { 438 | "compilations": 0, 439 | "cache_evictions": 0 440 | }, 441 | "discovery": { 442 | "cluster_state_queue": { 443 | "total": 0, 444 | "pending": 0, 445 | "committed": 0 446 | } 447 | }, 448 | "ingest": { 449 | "total": { 450 | "count": 0, 451 | "time_in_millis": 0, 452 | "current": 0, 453 | "failed": 0 454 | }, 455 | "pipelines": { 456 | 457 | } 458 | } 459 | } 460 | } 461 | } -------------------------------------------------------------------------------- /src/test/resources/nodes_stats_6.6.1.json: -------------------------------------------------------------------------------- 1 | { 2 | "_nodes" : { 3 | "total" : 1, 4 | "successful" : 1, 5 | "failed" : 0 6 | }, 7 | "cluster_name" : "docker-cluster", 8 | "nodes" : { 9 | "lFqpXn95Svafe5G5TGk6TQ" : { 10 | "timestamp" : 1551110864866, 11 | "name" : "lFqpXn9", 12 | "transport_address" : "172.25.0.2:9300", 13 | "host" : "172.25.0.2", 14 | "ip" : "172.25.0.2:9300", 15 | "roles" : [ 16 | "master", 17 | "data", 18 | "ingest" 19 | ], 20 | "attributes" : { 21 | "ml.machine_memory" : "2095869952", 22 | "xpack.installed" : "true", 23 | "ml.max_open_jobs" : "20", 24 | "ml.enabled" : "true" 25 | }, 26 | "indices" : { 27 | "docs" : { 28 | "count" : 0, 29 | "deleted" : 0 30 | }, 31 | "store" : { 32 | "size_in_bytes" : 0 33 | }, 34 | "indexing" : { 35 | "index_total" : 0, 36 | "index_time_in_millis" : 0, 37 | "index_current" : 0, 38 | "index_failed" : 0, 39 | "delete_total" : 0, 40 | "delete_time_in_millis" : 0, 41 | "delete_current" : 0, 42 | "noop_update_total" : 0, 43 | "is_throttled" : false, 44 | "throttle_time_in_millis" : 0 45 | }, 46 | "get" : { 47 | "total" : 0, 48 | "time_in_millis" : 0, 49 | "exists_total" : 0, 50 | "exists_time_in_millis" : 0, 51 | "missing_total" : 0, 52 | "missing_time_in_millis" : 0, 53 | "current" : 0 54 | }, 55 | "search" : { 56 | "open_contexts" : 0, 57 | "query_total" : 0, 58 | "query_time_in_millis" : 0, 59 | "query_current" : 0, 60 | "fetch_total" : 0, 61 | "fetch_time_in_millis" : 0, 62 | "fetch_current" : 0, 63 | "scroll_total" : 0, 64 | "scroll_time_in_millis" : 0, 65 | "scroll_current" : 0, 66 | "suggest_total" : 0, 67 | "suggest_time_in_millis" : 0, 68 | "suggest_current" : 0 69 | }, 70 | "merges" : { 71 | "current" : 0, 72 | "current_docs" : 0, 73 | "current_size_in_bytes" : 0, 74 | "total" : 0, 75 | "total_time_in_millis" : 0, 76 | "total_docs" : 0, 77 | "total_size_in_bytes" : 0, 78 | "total_stopped_time_in_millis" : 0, 79 | "total_throttled_time_in_millis" : 0, 80 | "total_auto_throttle_in_bytes" : 0 81 | }, 82 | "refresh" : { 83 | "total" : 0, 84 | "total_time_in_millis" : 0, 85 | "listeners" : 0 86 | }, 87 | "flush" : { 88 | "total" : 0, 89 | "periodic" : 0, 90 | "total_time_in_millis" : 0 91 | }, 92 | "warmer" : { 93 | "current" : 0, 94 | "total" : 0, 95 | "total_time_in_millis" : 0 96 | }, 97 | "query_cache" : { 98 | "memory_size_in_bytes" : 0, 99 | "total_count" : 0, 100 | "hit_count" : 0, 101 | "miss_count" : 0, 102 | "cache_size" : 0, 103 | "cache_count" : 0, 104 | "evictions" : 0 105 | }, 106 | "fielddata" : { 107 | "memory_size_in_bytes" : 0, 108 | "evictions" : 0 109 | }, 110 | "completion" : { 111 | "size_in_bytes" : 0 112 | }, 113 | "segments" : { 114 | "count" : 0, 115 | "memory_in_bytes" : 0, 116 | "terms_memory_in_bytes" : 0, 117 | "stored_fields_memory_in_bytes" : 0, 118 | "term_vectors_memory_in_bytes" : 0, 119 | "norms_memory_in_bytes" : 0, 120 | "points_memory_in_bytes" : 0, 121 | "doc_values_memory_in_bytes" : 0, 122 | "index_writer_memory_in_bytes" : 0, 123 | "version_map_memory_in_bytes" : 0, 124 | "fixed_bit_set_memory_in_bytes" : 0, 125 | "max_unsafe_auto_id_timestamp" : -9223372036854775808, 126 | "file_sizes" : { } 127 | }, 128 | "translog" : { 129 | "operations" : 0, 130 | "size_in_bytes" : 0, 131 | "uncommitted_operations" : 0, 132 | "uncommitted_size_in_bytes" : 0, 133 | "earliest_last_modified_age" : 0 134 | }, 135 | "request_cache" : { 136 | "memory_size_in_bytes" : 0, 137 | "evictions" : 0, 138 | "hit_count" : 0, 139 | "miss_count" : 0 140 | }, 141 | "recovery" : { 142 | "current_as_source" : 0, 143 | "current_as_target" : 0, 144 | "throttle_time_in_millis" : 0 145 | } 146 | }, 147 | "os" : { 148 | "timestamp" : 1551110864874, 149 | "cpu" : { 150 | "percent" : 0, 151 | "load_average" : { 152 | "1m" : 0.0, 153 | "5m" : 0.04, 154 | "15m" : 0.01 155 | } 156 | }, 157 | "mem" : { 158 | "total_in_bytes" : 2095869952, 159 | "free_in_bytes" : 74330112, 160 | "used_in_bytes" : 2021539840, 161 | "free_percent" : 4, 162 | "used_percent" : 96 163 | }, 164 | "swap" : { 165 | "total_in_bytes" : 1073737728, 166 | "free_in_bytes" : 875069440, 167 | "used_in_bytes" : 198668288 168 | }, 169 | "cgroup" : { 170 | "cpuacct" : { 171 | "control_group" : "/", 172 | "usage_nanos" : 51111267281 173 | }, 174 | "cpu" : { 175 | "control_group" : "/", 176 | "cfs_period_micros" : 100000, 177 | "cfs_quota_micros" : -1, 178 | "stat" : { 179 | "number_of_elapsed_periods" : 0, 180 | "number_of_times_throttled" : 0, 181 | "time_throttled_nanos" : 0 182 | } 183 | }, 184 | "memory" : { 185 | "control_group" : "/", 186 | "limit_in_bytes" : "9223372036854771712", 187 | "usage_in_bytes" : "1557659648" 188 | } 189 | } 190 | }, 191 | "process" : { 192 | "timestamp" : 1551110864875, 193 | "open_file_descriptors" : 217, 194 | "max_file_descriptors" : 1048576, 195 | "cpu" : { 196 | "percent" : 0, 197 | "total_in_millis" : 50460 198 | }, 199 | "mem" : { 200 | "total_virtual_in_bytes" : 5013487616 201 | } 202 | }, 203 | "jvm" : { 204 | "timestamp" : 1551110864875, 205 | "uptime_in_millis" : 2110755, 206 | "mem" : { 207 | "heap_used_in_bytes" : 413395792, 208 | "heap_used_percent" : 39, 209 | "heap_committed_in_bytes" : 1038876672, 210 | "heap_max_in_bytes" : 1038876672, 211 | "non_heap_used_in_bytes" : 107936352, 212 | "non_heap_committed_in_bytes" : 117129216, 213 | "pools" : { 214 | "young" : { 215 | "used_in_bytes" : 206074248, 216 | "max_in_bytes" : 279183360, 217 | "peak_used_in_bytes" : 279183360, 218 | "peak_max_in_bytes" : 279183360 219 | }, 220 | "survivor" : { 221 | "used_in_bytes" : 237088, 222 | "max_in_bytes" : 34865152, 223 | "peak_used_in_bytes" : 34865152, 224 | "peak_max_in_bytes" : 34865152 225 | }, 226 | "old" : { 227 | "used_in_bytes" : 207084456, 228 | "max_in_bytes" : 724828160, 229 | "peak_used_in_bytes" : 207084456, 230 | "peak_max_in_bytes" : 724828160 231 | } 232 | } 233 | }, 234 | "threads" : { 235 | "count" : 39, 236 | "peak_count" : 46 237 | }, 238 | "gc" : { 239 | "collectors" : { 240 | "young" : { 241 | "collection_count" : 10, 242 | "collection_time_in_millis" : 305 243 | }, 244 | "old" : { 245 | "collection_count" : 2, 246 | "collection_time_in_millis" : 126 247 | } 248 | } 249 | }, 250 | "buffer_pools" : { 251 | "mapped" : { 252 | "count" : 0, 253 | "used_in_bytes" : 0, 254 | "total_capacity_in_bytes" : 0 255 | }, 256 | "direct" : { 257 | "count" : 25, 258 | "used_in_bytes" : 134904978, 259 | "total_capacity_in_bytes" : 134904977 260 | } 261 | }, 262 | "classes" : { 263 | "current_loaded_count" : 15238, 264 | "total_loaded_count" : 15238, 265 | "total_unloaded_count" : 0 266 | } 267 | }, 268 | "thread_pool" : { 269 | "analyze" : { 270 | "threads" : 0, 271 | "queue" : 0, 272 | "active" : 0, 273 | "rejected" : 0, 274 | "largest" : 0, 275 | "completed" : 0 276 | }, 277 | "ccr" : { 278 | "threads" : 0, 279 | "queue" : 0, 280 | "active" : 0, 281 | "rejected" : 0, 282 | "largest" : 0, 283 | "completed" : 0 284 | }, 285 | "fetch_shard_started" : { 286 | "threads" : 0, 287 | "queue" : 0, 288 | "active" : 0, 289 | "rejected" : 0, 290 | "largest" : 0, 291 | "completed" : 0 292 | }, 293 | "fetch_shard_store" : { 294 | "threads" : 0, 295 | "queue" : 0, 296 | "active" : 0, 297 | "rejected" : 0, 298 | "largest" : 0, 299 | "completed" : 0 300 | }, 301 | "flush" : { 302 | "threads" : 0, 303 | "queue" : 0, 304 | "active" : 0, 305 | "rejected" : 0, 306 | "largest" : 0, 307 | "completed" : 0 308 | }, 309 | "force_merge" : { 310 | "threads" : 0, 311 | "queue" : 0, 312 | "active" : 0, 313 | "rejected" : 0, 314 | "largest" : 0, 315 | "completed" : 0 316 | }, 317 | "generic" : { 318 | "threads" : 4, 319 | "queue" : 0, 320 | "active" : 0, 321 | "rejected" : 0, 322 | "largest" : 4, 323 | "completed" : 4431 324 | }, 325 | "get" : { 326 | "threads" : 0, 327 | "queue" : 0, 328 | "active" : 0, 329 | "rejected" : 0, 330 | "largest" : 0, 331 | "completed" : 0 332 | }, 333 | "index" : { 334 | "threads" : 0, 335 | "queue" : 0, 336 | "active" : 0, 337 | "rejected" : 0, 338 | "largest" : 0, 339 | "completed" : 0 340 | }, 341 | "listener" : { 342 | "threads" : 0, 343 | "queue" : 0, 344 | "active" : 0, 345 | "rejected" : 0, 346 | "largest" : 0, 347 | "completed" : 0 348 | }, 349 | "management" : { 350 | "threads" : 2, 351 | "queue" : 0, 352 | "active" : 1, 353 | "rejected" : 0, 354 | "largest" : 2, 355 | "completed" : 214 356 | }, 357 | "ml_autodetect" : { 358 | "threads" : 0, 359 | "queue" : 0, 360 | "active" : 0, 361 | "rejected" : 0, 362 | "largest" : 0, 363 | "completed" : 0 364 | }, 365 | "ml_datafeed" : { 366 | "threads" : 0, 367 | "queue" : 0, 368 | "active" : 0, 369 | "rejected" : 0, 370 | "largest" : 0, 371 | "completed" : 0 372 | }, 373 | "ml_utility" : { 374 | "threads" : 1, 375 | "queue" : 0, 376 | "active" : 0, 377 | "rejected" : 0, 378 | "largest" : 1, 379 | "completed" : 1 380 | }, 381 | "refresh" : { 382 | "threads" : 0, 383 | "queue" : 0, 384 | "active" : 0, 385 | "rejected" : 0, 386 | "largest" : 0, 387 | "completed" : 0 388 | }, 389 | "rollup_indexing" : { 390 | "threads" : 0, 391 | "queue" : 0, 392 | "active" : 0, 393 | "rejected" : 0, 394 | "largest" : 0, 395 | "completed" : 0 396 | }, 397 | "search" : { 398 | "threads" : 0, 399 | "queue" : 0, 400 | "active" : 0, 401 | "rejected" : 0, 402 | "largest" : 0, 403 | "completed" : 0 404 | }, 405 | "search_throttled" : { 406 | "threads" : 0, 407 | "queue" : 0, 408 | "active" : 0, 409 | "rejected" : 0, 410 | "largest" : 0, 411 | "completed" : 0 412 | }, 413 | "security-token-key" : { 414 | "threads" : 0, 415 | "queue" : 0, 416 | "active" : 0, 417 | "rejected" : 0, 418 | "largest" : 0, 419 | "completed" : 0 420 | }, 421 | "snapshot" : { 422 | "threads" : 0, 423 | "queue" : 0, 424 | "active" : 0, 425 | "rejected" : 0, 426 | "largest" : 0, 427 | "completed" : 0 428 | }, 429 | "warmer" : { 430 | "threads" : 0, 431 | "queue" : 0, 432 | "active" : 0, 433 | "rejected" : 0, 434 | "largest" : 0, 435 | "completed" : 0 436 | }, 437 | "watcher" : { 438 | "threads" : 0, 439 | "queue" : 0, 440 | "active" : 0, 441 | "rejected" : 0, 442 | "largest" : 0, 443 | "completed" : 0 444 | }, 445 | "write" : { 446 | "threads" : 0, 447 | "queue" : 0, 448 | "active" : 0, 449 | "rejected" : 0, 450 | "largest" : 0, 451 | "completed" : 0 452 | } 453 | }, 454 | "fs" : { 455 | "timestamp" : 1551110864876, 456 | "total" : { 457 | "total_in_bytes" : 62722478080, 458 | "free_in_bytes" : 49454977024, 459 | "available_in_bytes" : 46238420992 460 | }, 461 | "least_usage_estimate" : { 462 | "path" : "/usr/share/elasticsearch/data/nodes/0", 463 | "total_in_bytes" : 62722478080, 464 | "available_in_bytes" : 46238433280, 465 | "used_disk_percent" : 26.280920819128454 466 | }, 467 | "most_usage_estimate" : { 468 | "path" : "/usr/share/elasticsearch/data/nodes/0", 469 | "total_in_bytes" : 62722478080, 470 | "available_in_bytes" : 46238433280, 471 | "used_disk_percent" : 26.280920819128454 472 | }, 473 | "data" : [ 474 | { 475 | "path" : "/usr/share/elasticsearch/data/nodes/0", 476 | "mount" : "/ (overlay)", 477 | "type" : "overlay", 478 | "total_in_bytes" : 62722478080, 479 | "free_in_bytes" : 49454977024, 480 | "available_in_bytes" : 46238420992 481 | } 482 | ], 483 | "io_stats" : { } 484 | }, 485 | "transport" : { 486 | "server_open" : 0, 487 | "rx_count" : 10, 488 | "rx_size_in_bytes" : 5363, 489 | "tx_count" : 10, 490 | "tx_size_in_bytes" : 5363 491 | }, 492 | "http" : { 493 | "current_open" : 1, 494 | "total_opened" : 8 495 | }, 496 | "breakers" : { 497 | "request" : { 498 | "limit_size_in_bytes" : 623326003, 499 | "limit_size" : "594.4mb", 500 | "estimated_size_in_bytes" : 0, 501 | "estimated_size" : "0b", 502 | "overhead" : 1.0, 503 | "tripped" : 0 504 | }, 505 | "fielddata" : { 506 | "limit_size_in_bytes" : 623326003, 507 | "limit_size" : "594.4mb", 508 | "estimated_size_in_bytes" : 0, 509 | "estimated_size" : "0b", 510 | "overhead" : 1.03, 511 | "tripped" : 0 512 | }, 513 | "in_flight_requests" : { 514 | "limit_size_in_bytes" : 1038876672, 515 | "limit_size" : "990.7mb", 516 | "estimated_size_in_bytes" : 0, 517 | "estimated_size" : "0b", 518 | "overhead" : 1.0, 519 | "tripped" : 0 520 | }, 521 | "accounting" : { 522 | "limit_size_in_bytes" : 1038876672, 523 | "limit_size" : "990.7mb", 524 | "estimated_size_in_bytes" : 0, 525 | "estimated_size" : "0b", 526 | "overhead" : 1.0, 527 | "tripped" : 0 528 | }, 529 | "parent" : { 530 | "limit_size_in_bytes" : 727213670, 531 | "limit_size" : "693.5mb", 532 | "estimated_size_in_bytes" : 0, 533 | "estimated_size" : "0b", 534 | "overhead" : 1.0, 535 | "tripped" : 0 536 | } 537 | }, 538 | "script" : { 539 | "compilations" : 4, 540 | "cache_evictions" : 0 541 | }, 542 | "discovery" : { 543 | "cluster_state_queue" : { 544 | "total" : 0, 545 | "pending" : 0, 546 | "committed" : 0 547 | }, 548 | "published_cluster_states" : { 549 | "full_states" : 0, 550 | "incompatible_diffs" : 0, 551 | "compatible_diffs" : 0 552 | } 553 | }, 554 | "ingest" : { 555 | "total" : { 556 | "count" : 0, 557 | "time_in_millis" : 0, 558 | "current" : 0, 559 | "failed" : 0 560 | }, 561 | "pipelines" : { 562 | "xpack_monitoring_2" : { 563 | "count" : 0, 564 | "time_in_millis" : 0, 565 | "current" : 0, 566 | "failed" : 0, 567 | "processors" : [ 568 | { 569 | "script" : { 570 | "count" : 0, 571 | "time_in_millis" : 0, 572 | "current" : 0, 573 | "failed" : 0 574 | } 575 | }, 576 | { 577 | "rename" : { 578 | "count" : 0, 579 | "time_in_millis" : 0, 580 | "current" : 0, 581 | "failed" : 0 582 | } 583 | }, 584 | { 585 | "set" : { 586 | "count" : 0, 587 | "time_in_millis" : 0, 588 | "current" : 0, 589 | "failed" : 0 590 | } 591 | }, 592 | { 593 | "gsub" : { 594 | "count" : 0, 595 | "time_in_millis" : 0, 596 | "current" : 0, 597 | "failed" : 0 598 | } 599 | } 600 | ] 601 | }, 602 | "xpack_monitoring_6" : { 603 | "count" : 0, 604 | "time_in_millis" : 0, 605 | "current" : 0, 606 | "failed" : 0, 607 | "processors" : [ ] 608 | } 609 | } 610 | }, 611 | "adaptive_selection" : { } 612 | } 613 | } 614 | } 615 | --------------------------------------------------------------------------------