Package org.elasticsearch.action.admin.indices.stats

Examples of org.elasticsearch.action.admin.indices.stats.CommonStats


    public void testRotate() throws IndexNotFoundException {
        final Configuration configuration = mock(Configuration.class);
        final Indices indices = mock(Indices.class);

        final IndexStatistics stats = new IndexStatistics();
        final CommonStats commonStats = new CommonStats();
        commonStats.store = new StoreStats(1000, 0);
        stats.setPrimaries(commonStats);

        when(indices.getIndexStats("name")).thenReturn(stats);
        when(configuration.getElasticSearchMaxSizePerIndex()).thenReturn(100L);
View Full Code Here


    public void testDontRotate() throws IndexNotFoundException {
        final Configuration configuration = mock(Configuration.class);
        final Indices indices = mock(Indices.class);

        final IndexStatistics stats = new IndexStatistics();
        final CommonStats commonStats = new CommonStats();
        commonStats.store = new StoreStats(1000, 0);
        stats.setPrimaries(commonStats);

        when(indices.getIndexStats("name")).thenReturn(stats);
        when(configuration.getElasticSearchMaxSizePerIndex()).thenReturn(100000L);
View Full Code Here

        return stats(true, new CommonStatsFlags().all());
    }

    @Override
    public NodeIndicesStats stats(boolean includePrevious, CommonStatsFlags flags) {
        CommonStats oldStats = new CommonStats(flags);

        if (includePrevious) {
            Flag[] setFlags = flags.getFlags();
            for (Flag flag : setFlags) {
                switch (flag) {
View Full Code Here

    private Map<Index, CommonStats> createStatsByIndex() {
        Map<Index, CommonStats> statsMap = Maps.newHashMap();
        for (Map.Entry<Index, List<IndexShardStats>> entry : statsByShard.entrySet()) {
            if (!statsMap.containsKey(entry.getKey())) {
                statsMap.put(entry.getKey(), new CommonStats());
            }

            for (IndexShardStats indexShardStats : entry.getValue()) {
                for (ShardStats shardStats : indexShardStats.getShards()) {
                    statsMap.get(entry.getKey()).add(shardStats.getStats());
View Full Code Here

    private Table buildTable(RestRequest request, ClusterStateResponse state, IndicesStatsResponse stats) {
        Table table = getTableWithHeader(request);

        for (ShardRouting shard : state.getState().routingTable().allShards()) {
            CommonStats shardStats = stats.asMap().get(shard);

            table.startRow();

            table.addCell(shard.index());
            table.addCell(shard.id());
            table.addCell(shard.primary() ? "p" : "r");
            table.addCell(shard.state());
            table.addCell(shardStats == null ? null : shardStats.getDocs().getCount());
            table.addCell(shardStats == null ? null : shardStats.getStore().getSize());
            if (shard.assignedToNode()) {
                String ip = state.getState().nodes().get(shard.currentNodeId()).getHostAddress();
                StringBuilder name = new StringBuilder();
                name.append(state.getState().nodes().get(shard.currentNodeId()).name());
                if (shard.relocating()) {
                    String reloIp = state.getState().nodes().get(shard.relocatingNodeId()).getHostAddress();
                    String reloNme = state.getState().nodes().get(shard.relocatingNodeId()).name();
                    name.append(" -> ");
                    name.append(reloIp);
                    name.append(" ");
                    name.append(reloNme);
                }
                table.addCell(ip);
                table.addCell(name);
            } else {
                table.addCell(null);
                table.addCell(null);
            }

            table.addCell(shardStats == null ? null : shardStats.getCompletion().getSize());

            table.addCell(shardStats == null ? null : shardStats.getFieldData().getMemorySize());
            table.addCell(shardStats == null ? null : shardStats.getFieldData().getEvictions());

            table.addCell(shardStats == null ? null : shardStats.getFilterCache().getMemorySize());
            table.addCell(shardStats == null ? null : shardStats.getFilterCache().getEvictions());

            table.addCell(shardStats == null ? null : shardStats.getFlush().getTotal());
            table.addCell(shardStats == null ? null : shardStats.getFlush().getTotalTime());

            table.addCell(shardStats == null ? null : shardStats.getGet().current());
            table.addCell(shardStats == null ? null : shardStats.getGet().getTime());
            table.addCell(shardStats == null ? null : shardStats.getGet().getCount());
            table.addCell(shardStats == null ? null : shardStats.getGet().getExistsTime());
            table.addCell(shardStats == null ? null : shardStats.getGet().getExistsCount());
            table.addCell(shardStats == null ? null : shardStats.getGet().getMissingTime());
            table.addCell(shardStats == null ? null : shardStats.getGet().getMissingCount());

            table.addCell(shardStats == null ? null : shardStats.getIdCache().getMemorySize());

            table.addCell(shardStats == null ? null : shardStats.getIndexing().getTotal().getDeleteCurrent());
            table.addCell(shardStats == null ? null : shardStats.getIndexing().getTotal().getDeleteTime());
            table.addCell(shardStats == null ? null : shardStats.getIndexing().getTotal().getDeleteCount());
            table.addCell(shardStats == null ? null : shardStats.getIndexing().getTotal().getIndexCurrent());
            table.addCell(shardStats == null ? null : shardStats.getIndexing().getTotal().getIndexTime());
            table.addCell(shardStats == null ? null : shardStats.getIndexing().getTotal().getIndexCount());

            table.addCell(shardStats == null ? null : shardStats.getMerge().getCurrent());
            table.addCell(shardStats == null ? null : shardStats.getMerge().getCurrentNumDocs());
            table.addCell(shardStats == null ? null : shardStats.getMerge().getCurrentSize());
            table.addCell(shardStats == null ? null : shardStats.getMerge().getTotal());
            table.addCell(shardStats == null ? null : shardStats.getMerge().getTotalNumDocs());
            table.addCell(shardStats == null ? null : shardStats.getMerge().getTotalSize());
            table.addCell(shardStats == null ? null : shardStats.getMerge().getTotalTime());

            table.addCell(shardStats == null ? null : shardStats.getPercolate().getCurrent());
            table.addCell(shardStats == null ? null : shardStats.getPercolate().getMemorySize());
            table.addCell(shardStats == null ? null : shardStats.getPercolate().getNumQueries());
            table.addCell(shardStats == null ? null : shardStats.getPercolate().getTime());
            table.addCell(shardStats == null ? null : shardStats.getPercolate().getCount());

            table.addCell(shardStats == null ? null : shardStats.getRefresh().getTotal());
            table.addCell(shardStats == null ? null : shardStats.getRefresh().getTotalTime());

            table.addCell(shardStats == null ? null : shardStats.getSearch().getTotal().getFetchCurrent());
            table.addCell(shardStats == null ? null : shardStats.getSearch().getTotal().getFetchTime());
            table.addCell(shardStats == null ? null : shardStats.getSearch().getTotal().getFetchCount());
            table.addCell(shardStats == null ? null : shardStats.getSearch().getOpenContexts());
            table.addCell(shardStats == null ? null : shardStats.getSearch().getTotal().getQueryCurrent());
            table.addCell(shardStats == null ? null : shardStats.getSearch().getTotal().getQueryTime());
            table.addCell(shardStats == null ? null : shardStats.getSearch().getTotal().getQueryCount());

            table.addCell(shardStats == null ? null : shardStats.getSegments().getCount());
            table.addCell(shardStats == null ? null : shardStats.getSegments().getMemory());
            table.addCell(shardStats == null ? null : shardStats.getSegments().getIndexWriterMemory());
            table.addCell(shardStats == null ? null : shardStats.getSegments().getIndexWriterMaxMemory());
            table.addCell(shardStats == null ? null : shardStats.getSegments().getVersionMapMemory());
            table.addCell(shardStats == null ? null : shardStats.getSegments().getBitsetMemory());

            table.addCell(shardStats == null ? null : shardStats.getWarmer().current());
            table.addCell(shardStats == null ? null : shardStats.getWarmer().total());
            table.addCell(shardStats == null ? null : shardStats.getWarmer().totalTime());

            table.endRow();
        }

        return table;
View Full Code Here

                    countsPerIndex.put(shardStats.getIndex(), indexShardStats);
                }

                indexShardStats.total++;

                CommonStats shardCommonStats = shardStats.getStats();

                if (shardStats.getShardRouting().primary()) {
                    indexShardStats.primaries++;
                    docs.add(shardCommonStats.docs);
                }
View Full Code Here

TOP

Related Classes of org.elasticsearch.action.admin.indices.stats.CommonStats

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.