org.elasticsearch.index.indexing.IndexingStats Java Examples

The following examples show how to use org.elasticsearch.index.indexing.IndexingStats. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GraphiteReporter.java    From elasticsearch-graphite-plugin with Do What The F*ck You Want To Public License 5 votes vote down vote up
private void sendIndexingStats(String type, IndexingStats indexingStats) {
    IndexingStats.Stats totalStats = indexingStats.getTotal();
    sendStats(type + "._all", totalStats);

    Map<String, IndexingStats.Stats> typeStats = indexingStats.getTypeStats();
    if (typeStats != null) {
        for (Map.Entry<String, IndexingStats.Stats> statsEntry : typeStats.entrySet()) {
            sendStats(type + "." + statsEntry.getKey(), statsEntry.getValue());
        }
    }
}
 
Example #2
Source File: GraphiteReporter.java    From elasticsearch-graphite-plugin with Do What The F*ck You Want To Public License 5 votes vote down vote up
private void sendStats(String type, IndexingStats.Stats stats) {
    sendInt(type, "indexCount", stats.getIndexCount());
    sendInt(type, "indexTimeInMillis", stats.getIndexTimeInMillis());
    sendInt(type, "indexCurrent", stats.getIndexCount());
    sendInt(type, "deleteCount", stats.getDeleteCount());
    sendInt(type, "deleteTimeInMillis", stats.getDeleteTimeInMillis());
    sendInt(type, "deleteCurrent", stats.getDeleteCurrent());
}
 
Example #3
Source File: NodeIndicesStats.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Nullable
public IndexingStats getIndexing() {
    return stats.getIndexing();
}
 
Example #4
Source File: IndexShard.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
public IndexingStats indexingStats(String... types) {
    return indexingService.stats(types);
}
 
Example #5
Source File: CommonStats.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
public CommonStats(CommonStatsFlags flags) {
    CommonStatsFlags.Flag[] setFlags = flags.getFlags();

    for (CommonStatsFlags.Flag flag : setFlags) {
        switch (flag) {
            case Docs:
                docs = new DocsStats();
                break;
            case Store:
                store = new StoreStats();
                break;
            case Indexing:
                indexing = new IndexingStats();
                break;
            case Get:
                get = new GetStats();
                break;
            case Search:
                search = new SearchStats();
                break;
            case Merge:
                merge = new MergeStats();
                break;
            case Refresh:
                refresh = new RefreshStats();
                break;
            case Flush:
                flush = new FlushStats();
                break;
            case Warmer:
                warmer = new WarmerStats();
                break;
            case QueryCache:
                queryCache = new QueryCacheStats();
                break;
            case FieldData:
                fieldData = new FieldDataStats();
                break;
            case Completion:
                completion = new CompletionStats();
                break;
            case Segments:
                segments = new SegmentsStats();
                break;
            case Percolate:
                percolate = new PercolateStats();
                break;
            case Translog:
                translog = new TranslogStats();
                break;
            case Suggest:
                suggest = new SuggestStats();
                break;
            case RequestCache:
                requestCache = new RequestCacheStats();
                break;
            case Recovery:
                recoveryStats = new RecoveryStats();
                break;
            case DL:
                dlStats = new DLStats();
                break;
            case Reindex:
                reindexStats = new ReindexStats();
                break;
            default:
                throw new IllegalStateException("Unknown Flag: " + flag);
        }
    }
}
 
Example #6
Source File: CommonStats.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Nullable
public IndexingStats getIndexing() {
    return indexing;
}
 
Example #7
Source File: CommonStats.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    if (in.readBoolean()) {
        docs = DocsStats.readDocStats(in);
    }
    if (in.readBoolean()) {
        store = StoreStats.readStoreStats(in);
    }
    if (in.readBoolean()) {
        indexing = IndexingStats.readIndexingStats(in);
    }
    if (in.readBoolean()) {
        get = GetStats.readGetStats(in);
    }
    if (in.readBoolean()) {
        search = SearchStats.readSearchStats(in);
    }
    if (in.readBoolean()) {
        merge = MergeStats.readMergeStats(in);
    }
    if (in.readBoolean()) {
        refresh = RefreshStats.readRefreshStats(in);
    }
    if (in.readBoolean()) {
        flush = FlushStats.readFlushStats(in);
    }
    if (in.readBoolean()) {
        warmer = WarmerStats.readWarmerStats(in);
    }
    if (in.readBoolean()) {
        queryCache = QueryCacheStats.readQueryCacheStats(in);
    }
    if (in.readBoolean()) {
        fieldData = FieldDataStats.readFieldDataStats(in);
    }
    if (in.readBoolean()) {
        percolate = PercolateStats.readPercolateStats(in);
    }
    if (in.readBoolean()) {
        completion = CompletionStats.readCompletionStats(in);
    }
    if (in.readBoolean()) {
        segments = SegmentsStats.readSegmentsStats(in);
    }
    if (in.readBoolean()) {
        dlStats = DLStats.readDLStats(in);
    }
    if (in.readBoolean()) {
        reindexStats = ReindexStats.readReindexStats(in);
    }
    translog = in.readOptionalStreamable(new TranslogStats());
    suggest = in.readOptionalStreamable(new SuggestStats());
    requestCache = in.readOptionalStreamable(new RequestCacheStats());
    recoveryStats = in.readOptionalStreamable(new RecoveryStats());
}