mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Setting human_readable to false while exporting node stats.
This commit is contained in:
parent
1e786c7c94
commit
8bce30d892
1 changed files with 10 additions and 2 deletions
|
@ -20,6 +20,7 @@ package com.elasticsearch.dash.exporters;
|
|||
|
||||
|
||||
import com.elasticsearch.dash.Exporter;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import org.elasticsearch.ElasticSearchException;
|
||||
import org.elasticsearch.ElasticSearchIllegalArgumentException;
|
||||
import org.elasticsearch.action.admin.cluster.node.stats.NodeStats;
|
||||
|
@ -40,7 +41,7 @@ import java.net.HttpURLConnection;
|
|||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.Date;
|
||||
import java.util.*;
|
||||
|
||||
public class ESExporter extends AbstractLifecycleComponent<ESExporter> implements Exporter<ESExporter> {
|
||||
|
||||
|
@ -52,6 +53,9 @@ public class ESExporter extends AbstractLifecycleComponent<ESExporter> implement
|
|||
|
||||
final ESLogger logger = ESLoggerFactory.getLogger(ESExporter.class.getName());
|
||||
|
||||
final ToXContent.Params xContentParams;
|
||||
|
||||
|
||||
public ESExporter(Settings settings, ClusterName clusterName) {
|
||||
super(settings);
|
||||
|
||||
|
@ -72,6 +76,9 @@ public class ESExporter extends AbstractLifecycleComponent<ESExporter> implement
|
|||
}
|
||||
|
||||
|
||||
xContentParams = new ToXContent.MapParams(ImmutableMap.of("human_readable","false"));
|
||||
|
||||
|
||||
logger.info("ESExporter initialized. Target: {}:{} Index prefix set to {}", targetHost, targetPort, targetIndexPrefix );
|
||||
// explode early on broken settings
|
||||
getTargetURL("test");
|
||||
|
@ -92,6 +99,7 @@ public class ESExporter extends AbstractLifecycleComponent<ESExporter> implement
|
|||
return "ESExporter";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void exportNodeStats(NodeStats nodeStats) {
|
||||
URL url = getTargetURL("nodestats");
|
||||
|
@ -106,7 +114,7 @@ public class ESExporter extends AbstractLifecycleComponent<ESExporter> implement
|
|||
XContentBuilder builder = XContentFactory.smileBuilder(os);
|
||||
|
||||
builder.startObject();
|
||||
nodeStats.toXContent(builder, ToXContent.EMPTY_PARAMS);
|
||||
nodeStats.toXContent(builder, xContentParams);
|
||||
builder.endObject();
|
||||
|
||||
builder.close();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue