Marvel: Add stats for primary shards

closes elastic/elasticsearch#1198

Original commit: elastic/x-pack-elasticsearch@e823d01397
This commit is contained in:
Tanguy Leroux 2016-02-21 14:39:52 -08:00
parent e3f53be3ef
commit b5f40adb12
4 changed files with 114 additions and 10 deletions

View File

@ -19,6 +19,17 @@ public class IndexStatsRenderer extends AbstractRenderer<IndexStatsMarvelDoc> {
public static final String[] FILTERS = {
"index_stats.index",
"index_stats.primaries.docs.count",
"index_stats.primaries.fielddata.memory_size_in_bytes",
"index_stats.primaries.indexing.index_total",
"index_stats.primaries.indexing.index_time_in_millis",
"index_stats.primaries.indexing.throttle_time_in_millis",
"index_stats.primaries.merges.total_size_in_bytes",
"index_stats.primaries.search.query_total",
"index_stats.primaries.search.query_time_in_millis",
"index_stats.primaries.segments.memory_in_bytes",
"index_stats.primaries.store.size_in_bytes",
"index_stats.primaries.store.throttle_time_in_millis",
"index_stats.primaries.refresh.total_time_in_millis",
"index_stats.total.docs.count",
"index_stats.total.fielddata.memory_size_in_bytes",
"index_stats.total.indexing.index_total",

View File

@ -112,6 +112,67 @@
"type": "long"
}
}
},
"fielddata" : {
"properties": {
"memory_size_in_bytes": {
"type": "long"
}
}
},
"store": {
"properties": {
"size_in_bytes": {
"type": "long"
},
"throttle_time_in_millis": {
"type": "long"
}
}
},
"indexing": {
"properties": {
"index_total": {
"type": "long"
},
"index_time_in_millis": {
"type": "long"
},
"throttle_time_in_millis": {
"type": "long"
}
}
},
"merges": {
"properties": {
"total_size_in_bytes": {
"type": "long"
}
}
},
"search": {
"properties": {
"query_total": {
"type": "long"
},
"query_time_in_millis": {
"type": "long"
}
}
},
"segments": {
"properties": {
"memory_in_bytes": {
"type": "long"
}
}
},
"refresh": {
"properties": {
"total_time_in_millis": {
"type": "long"
}
}
}
}
},

View File

@ -49,16 +49,23 @@ public class IndexStatsRendererTests extends ESTestCase {
return stats;
}
@Override
public CommonStats getPrimaries() {
// Primaries will be filtered out by the renderer
CommonStats stats = new CommonStats();
stats.docs = new DocsStats(345678L, randomLong());
stats.store = new StoreStats(randomLong(), randomLong());
stats.indexing = new IndexingStats(new IndexingStats.Stats(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, true, randomLong()), null);
return stats;
}
});
@Override
public CommonStats getPrimaries() {
// Primaries will be filtered out by the renderer
CommonStats stats = new CommonStats();
stats.docs = new DocsStats(345678L, randomLong());
stats.store = new StoreStats(randomLong(), randomLong());
stats.indexing = new IndexingStats(new IndexingStats.Stats(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, true, randomLong()), null);
stats.search = new SearchStats(new SearchStats.Stats(1L, 7L, 0L, 0L, 0L, 0L, 0L, 0L, 0L), 0L, null);
stats.merge = new MergeStats();
stats.merge.add(0L, 0L, 0L, 42L, 0L, 0L, 0L, 0L, 0L, 0L);
stats.refresh = new RefreshStats(0L, 978L);
stats.fieldData = new FieldDataStats(123456L, 0L, null);
stats.segments = new SegmentsStats();
stats.segments.add(0, 87965412L);
return stats;
}
});
logger.debug("--> rendering the document");
Renderer renderer = new IndexStatsRenderer();

View File

@ -36,6 +36,31 @@
"primaries" : {
"docs" : {
"count" : 345678
},
"store": {
"size_in_bytes": 5761573,
"throttle_time_in_millis": 0
},
"indexing": {
"index_total" : 3,
"index_time_in_millis" : 71,
"throttle_time_in_millis": 302
},
"search" : {
"query_total" : 1,
"query_time_in_millis" : 7
},
"merges" : {
"total_size_in_bytes" : 42
},
"refresh" : {
"total_time_in_millis" : 978
},
"fielddata" : {
"memory_size_in_bytes" : 123456
},
"segments" : {
"memory_in_bytes" : 87965412
}
}
}