Java Code Examples for org.elasticsearch.common.xcontent.XContentBuilder#timeValueField()

The following examples show how to use org.elasticsearch.common.xcontent.XContentBuilder#timeValueField() . 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: ProcessStats.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
    builder.startObject(Fields.PROCESS);
    builder.field(Fields.TIMESTAMP, timestamp);
    builder.field(Fields.OPEN_FILE_DESCRIPTORS, openFileDescriptors);
    builder.field(Fields.MAX_FILE_DESCRIPTORS, maxFileDescriptors);
    if (cpu != null) {
        builder.startObject(Fields.CPU);
        builder.field(Fields.PERCENT, cpu.percent);
        builder.timeValueField(Fields.TOTAL_IN_MILLIS, Fields.TOTAL, cpu.total);
        builder.endObject();
    }
    if (mem != null) {
        builder.startObject(Fields.MEM);
        builder.byteSizeField(Fields.TOTAL_VIRTUAL_IN_BYTES, Fields.TOTAL_VIRTUAL, mem.totalVirtual);
        builder.endObject();
    }
    builder.endObject();
    return builder;
}
 
Example 2
Source File: TaskInfo.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
    builder.field("node", node.getId());
    builder.field("id", taskId.getId());
    builder.field("type", type);
    builder.field("action", action);
    if (status != null) {
        builder.field("status", status, params);
    }
    if (description != null) {
        builder.field("description", description);
    }
    builder.dateValueField("start_time_in_millis", "start_time", startTime);
    builder.timeValueField("running_time_in_nanos", "running_time", runningTimeNanos, TimeUnit.NANOSECONDS);
    if (parentTaskId.isSet()) {
        builder.field("parent_task_id", parentTaskId.toString());
    }
    return builder;
}
 
Example 3
Source File: ClusterStatsNodes.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
    builder.timeValueField(Fields.MAX_UPTIME_IN_MILLIS, Fields.MAX_UPTIME, maxUptime);
    builder.startArray(Fields.VERSIONS);
    for (ObjectIntCursor<JvmVersion> v : versions) {
        builder.startObject();
        builder.field(Fields.VERSION, v.key.version);
        builder.field(Fields.VM_NAME, v.key.vmName);
        builder.field(Fields.VM_VERSION, v.key.vmVersion);
        builder.field(Fields.VM_VENDOR, v.key.vmVendor);
        builder.field(Fields.COUNT, v.value);
        builder.endObject();
    }
    builder.endArray();
    builder.startObject(Fields.MEM);
    builder.byteSizeField(Fields.HEAP_USED_IN_BYTES, Fields.HEAP_USED, heapUsed);
    builder.byteSizeField(Fields.HEAP_MAX_IN_BYTES, Fields.HEAP_MAX, heapMax);
    builder.endObject();

    builder.field(Fields.THREADS, threads);
    return builder;
}
 
Example 4
Source File: IndexingStats.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
    builder.field(Fields.INDEX_TOTAL, indexCount);
    builder.timeValueField(Fields.INDEX_TIME_IN_MILLIS, Fields.INDEX_TIME, indexTimeInMillis);
    builder.field(Fields.INDEX_CURRENT, indexCurrent);
    builder.field(Fields.INDEX_FAILED, indexFailedCount);

    builder.field(Fields.DELETE_TOTAL, deleteCount);
    builder.timeValueField(Fields.DELETE_TIME_IN_MILLIS, Fields.DELETE_TIME, deleteTimeInMillis);
    builder.field(Fields.DELETE_CURRENT, deleteCurrent);

    builder.field(Fields.NOOP_UPDATE_TOTAL, noopUpdateCount);

    builder.field(Fields.IS_THROTTLED, isThrottled);
    builder.timeValueField(Fields.THROTTLED_TIME_IN_MILLIS, Fields.THROTTLED_TIME, throttleTimeInMillis);
    return builder;
}
 
Example 5
Source File: SearchStats.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
    builder.field(Fields.QUERY_TOTAL, queryCount);
    builder.timeValueField(Fields.QUERY_TIME_IN_MILLIS, Fields.QUERY_TIME, queryTimeInMillis);
    builder.field(Fields.QUERY_CURRENT, queryCurrent);

    builder.field(Fields.FETCH_TOTAL, fetchCount);
    builder.timeValueField(Fields.FETCH_TIME_IN_MILLIS, Fields.FETCH_TIME, fetchTimeInMillis);
    builder.field(Fields.FETCH_CURRENT, fetchCurrent);

    builder.field(Fields.SCROLL_TOTAL, scrollCount);
    builder.timeValueField(Fields.SCROLL_TIME_IN_MILLIS, Fields.SCROLL_TIME, scrollTimeInMillis);
    builder.field(Fields.SCROLL_CURRENT, scrollCurrent);

    return builder;
}
 
Example 6
Source File: MergeStats.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
    builder.startObject(Fields.MERGES);
    builder.field(Fields.CURRENT, current);
    builder.field(Fields.CURRENT_DOCS, currentNumDocs);
    builder.byteSizeField(Fields.CURRENT_SIZE_IN_BYTES, Fields.CURRENT_SIZE, currentSizeInBytes);
    builder.field(Fields.TOTAL, total);
    builder.timeValueField(Fields.TOTAL_TIME_IN_MILLIS, Fields.TOTAL_TIME, totalTimeInMillis);
    builder.field(Fields.TOTAL_DOCS, totalNumDocs);
    builder.byteSizeField(Fields.TOTAL_SIZE_IN_BYTES, Fields.TOTAL_SIZE, totalSizeInBytes);
    builder.timeValueField(Fields.TOTAL_STOPPED_TIME_IN_MILLIS, Fields.TOTAL_STOPPED_TIME, totalStoppedTimeInMillis);
    builder.timeValueField(Fields.TOTAL_THROTTLED_TIME_IN_MILLIS, Fields.TOTAL_THROTTLED_TIME, totalThrottledTimeInMillis);
    builder.byteSizeField(Fields.TOTAL_THROTTLE_BYTES_PER_SEC_IN_BYTES, Fields.TOTAL_THROTTLE_BYTES_PER_SEC, totalBytesPerSecAutoThrottle);
    builder.endObject();
    return builder;
}
 
Example 7
Source File: SuggestStats.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
    builder.startObject(Fields.SUGGEST);
    builder.field(Fields.TOTAL, suggestCount);
    builder.timeValueField(Fields.TIME_IN_MILLIS, Fields.TIME, suggestTimeInMillis);
    builder.field(Fields.CURRENT, current);
    builder.endObject();
    return builder;
}
 
Example 8
Source File: SnapshotsInProgress.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
public void toXContent(Entry entry, XContentBuilder builder, ToXContent.Params params) throws IOException {
    builder.startObject();
    builder.field(Fields.REPOSITORY, entry.snapshotId().getRepository());
    builder.field(Fields.SNAPSHOT, entry.snapshotId().getSnapshot());
    builder.field(Fields.INCLUDE_GLOBAL_STATE, entry.includeGlobalState());
    builder.field(Fields.STATE, entry.state());
    builder.startArray(Fields.INDICES);
    {
        for (String index : entry.indices()) {
            builder.value(index);
        }
    }
    builder.endArray();
    builder.timeValueField(Fields.START_TIME_MILLIS, Fields.START_TIME, entry.startTime());
    builder.startArray(Fields.SHARDS);
    {
        for (Map.Entry<ShardId, ShardSnapshotStatus> shardEntry : entry.shards.entrySet()) {
            ShardId shardId = shardEntry.getKey();
            ShardSnapshotStatus status = shardEntry.getValue();
            builder.startObject();
            {
                builder.field(Fields.INDEX, shardId.getIndex());
                builder.field(Fields.SHARD, shardId.getId());
                builder.field(Fields.STATE, status.state());
                builder.field(Fields.NODE, status.nodeId());
            }
            builder.endObject();
        }
    }
    builder.endArray();
    builder.endObject();
}
 
Example 9
Source File: StoreStats.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
    builder.startObject(Fields.STORE);
    builder.byteSizeField(Fields.SIZE_IN_BYTES, Fields.SIZE, sizeInBytes);
    builder.timeValueField(Fields.THROTTLE_TIME_IN_MILLIS, Fields.THROTTLE_TIME, throttleTime());
    builder.endObject();
    return builder;
}
 
Example 10
Source File: RecoveryStats.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
    builder.startObject(Fields.RECOVERY);
    builder.field(Fields.CURRENT_AS_SOURCE, currentAsSource());
    builder.field(Fields.CURRENT_AS_TARGET, currentAsTarget());
    builder.timeValueField(Fields.THROTTLE_TIME_IN_MILLIS, Fields.THROTTLE_TIME, throttleTime());
    builder.endObject();
    return builder;
}
 
Example 11
Source File: RefreshStats.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
    builder.startObject(Fields.REFRESH);
    builder.field(Fields.TOTAL, total);
    builder.timeValueField(Fields.TOTAL_TIME_IN_MILLIS, Fields.TOTAL_TIME, totalTimeInMillis);
    builder.endObject();
    return builder;
}
 
Example 12
Source File: FlushStats.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
    builder.startObject(Fields.FLUSH);
    builder.field(Fields.TOTAL, total);
    builder.timeValueField(Fields.TOTAL_TIME_IN_MILLIS, Fields.TOTAL_TIME, totalTimeInMillis);
    builder.endObject();
    return builder;
}
 
Example 13
Source File: SnapshotStats.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException {
    builder.startObject(Fields.STATS);
    builder.field(Fields.NUMBER_OF_FILES, getNumberOfFiles());
    builder.field(Fields.PROCESSED_FILES, getProcessedFiles());
    builder.byteSizeField(Fields.TOTAL_SIZE_IN_BYTES, Fields.TOTAL_SIZE, getTotalSize());
    builder.byteSizeField(Fields.PROCESSED_SIZE_IN_BYTES, Fields.PROCESSED_SIZE, getProcessedSize());
    builder.field(Fields.START_TIME_IN_MILLIS, getStartTime());
    builder.timeValueField(Fields.TIME_IN_MILLIS, Fields.TIME, getTime());
    builder.endObject();
    return builder;
}
 
Example 14
Source File: GetStats.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
    builder.startObject(Fields.GET);
    builder.field(Fields.TOTAL, getCount());
    builder.timeValueField(Fields.TIME_IN_MILLIS, Fields.TIME, getTimeInMillis());
    builder.field(Fields.EXISTS_TOTAL, existsCount);
    builder.timeValueField(Fields.EXISTS_TIME_IN_MILLIS, Fields.EXISTS_TIME, existsTimeInMillis);
    builder.field(Fields.MISSING_TOTAL, missingCount);
    builder.timeValueField(Fields.MISSING_TIME_IN_MILLIS, Fields.MISSING_TIME, missingTimeInMillis);
    builder.field(Fields.CURRENT, current);
    builder.endObject();
    return builder;
}
 
Example 15
Source File: ProcessInfo.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
    builder.startObject(Fields.PROCESS);
    builder.timeValueField(Fields.REFRESH_INTERVAL_IN_MILLIS, Fields.REFRESH_INTERVAL, refreshInterval);
    builder.field(Fields.ID, id);
    builder.field(Fields.MLOCKALL, mlockall);
    builder.endObject();
    return builder;
}
 
Example 16
Source File: RecoveryState.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public synchronized XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
    builder.field(Fields.RECOVERED, recovered);
    builder.field(Fields.TOTAL, total);
    builder.field(Fields.PERCENT, String.format(Locale.ROOT, "%1.1f%%", recoveredPercent()));
    builder.field(Fields.TOTAL_ON_START, totalOnStart);
    builder.timeValueField(Fields.TOTAL_TIME_IN_MILLIS, Fields.TOTAL_TIME, time());
    return builder;
}
 
Example 17
Source File: RecoveryState.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {

    builder.field(Fields.ID, shardId.id());
    builder.field(Fields.TYPE, type.toString());
    builder.field(Fields.STAGE, stage.toString());
    builder.field(Fields.PRIMARY, primary);
    builder.dateValueField(Fields.START_TIME_IN_MILLIS, Fields.START_TIME, timer.startTime);
    if (timer.stopTime > 0) {
        builder.dateValueField(Fields.STOP_TIME_IN_MILLIS, Fields.STOP_TIME, timer.stopTime);
    }
    builder.timeValueField(Fields.TOTAL_TIME_IN_MILLIS, Fields.TOTAL_TIME, timer.time());

    if (restoreSource != null) {
        builder.field(Fields.SOURCE);
        restoreSource.toXContent(builder, params);
    } else {
        builder.startObject(Fields.SOURCE);
        builder.field(Fields.ID, sourceNode.id());
        builder.field(Fields.HOST, sourceNode.getHostName());
        builder.field(Fields.TRANSPORT_ADDRESS, sourceNode.address().toString());
        builder.field(Fields.IP, sourceNode.getHostAddress());
        builder.field(Fields.NAME, sourceNode.name());
        builder.endObject();
    }

    builder.startObject(Fields.TARGET);
    builder.field(Fields.ID, targetNode.id());
    builder.field(Fields.HOST, targetNode.getHostName());
    builder.field(Fields.TRANSPORT_ADDRESS, targetNode.address().toString());
    builder.field(Fields.IP, targetNode.getHostAddress());
    builder.field(Fields.NAME, targetNode.name());
    builder.endObject();

    builder.startObject(Fields.INDEX);
    index.toXContent(builder, params);
    builder.endObject();

    builder.startObject(Fields.TRANSLOG);
    translog.toXContent(builder, params);
    builder.endObject();

    builder.startObject(Fields.VERIFY_INDEX);
    verifyIndex.toXContent(builder, params);
    builder.endObject();

    return builder;
}
 
Example 18
Source File: JvmInfo.java    From elasticsearch-helper with Apache License 2.0 4 votes vote down vote up
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
    builder.startObject(Fields.JVM);
    builder.field(Fields.TIMESTAMP, stats.timestamp);
    builder.dateValueField(Fields.START_TIME_IN_MILLIS, Fields.START_TIME, startTime);
    builder.timeValueField(Fields.UPTIME_IN_MILLIS, Fields.UPTIME, stats.uptime);
    builder.field(Fields.PID, pid);
    builder.field(Fields.VERSION, version);
    builder.field(Fields.VM_NAME, vmName);
    builder.field(Fields.VM_VERSION, vmVersion);
    builder.field(Fields.VM_VENDOR, vmVendor);

    if (stats.threads != null) {
        builder.startObject(Fields.THREADS);
        builder.field(Fields.COUNT, stats.threads.getCount());
        builder.field(Fields.PEAK_COUNT, stats.threads.getPeakCount());
        builder.endObject();
    }

    builder.field(Fields.MEMORY_POOLS, memoryPools);

    if (stats.mem != null) {
        builder.startObject(Fields.MEM);
        builder.startObject(Fields.POOLS);
        for (MemoryPool pool : stats.mem) {
            builder.startObject(pool.getName(), XContentBuilder.FieldCaseConversion.NONE);
            builder.byteSizeField(Fields.USED_IN_BYTES, Fields.USED, pool.used);
            builder.byteSizeField(Fields.MAX_IN_BYTES, Fields.MAX, pool.max);
            builder.byteSizeField(Fields.PEAK_USED_IN_BYTES, Fields.PEAK_USED, pool.peakUsed);
            builder.byteSizeField(Fields.PEAK_MAX_IN_BYTES, Fields.PEAK_MAX, pool.peakMax);
            builder.endObject();
        }
        builder.endObject();
        if (stats.mem.getHeapUsedPercent() >= 0) {
            builder.field(Fields.HEAP_USED_PERCENT, stats.mem.getHeapUsedPercent());
        }
        builder.byteSizeField(Fields.HEAP_INIT_IN_BYTES, Fields.HEAP_INIT, stats.mem.heapInit);
        builder.byteSizeField(Fields.HEAP_USED_IN_BYTES, Fields.HEAP_USED, stats.mem.heapUsed);
        builder.byteSizeField(Fields.HEAP_COMMITTED_IN_BYTES, Fields.HEAP_COMMITTED, stats.mem.heapCommitted);
        builder.byteSizeField(Fields.HEAP_MAX_IN_BYTES, Fields.HEAP_MAX, stats.mem.heapMax);
        builder.byteSizeField(Fields.NON_HEAP_INIT_IN_BYTES, Fields.NON_HEAP_INIT, stats.mem.nonHeapInit);
        builder.byteSizeField(Fields.NON_HEAP_USED_IN_BYTES, Fields.NON_HEAP_USED, stats.mem.nonHeapUsed);
        builder.byteSizeField(Fields.NON_HEAP_COMMITTED_IN_BYTES, Fields.NON_HEAP_COMMITTED, stats.mem.nonHeapCommitted);
        builder.byteSizeField(Fields.NON_HEAP_MAX_IN_BYTES, Fields.NON_HEAP_MAX, stats.mem.nonHeapMax);
        builder.byteSizeField(Fields.DIRECT_MAX_IN_BYTES, Fields.DIRECT_MAX, stats.mem.directMemoryMax);
        builder.endObject();
    }

    builder.field(Fields.GC_COLLECTORS, gcCollectors);

    if (stats.gc != null) {
        builder.startObject(Fields.GC);

        builder.startObject(Fields.COLLECTORS);
        for (GarbageCollector collector : stats.gc) {
            builder.startObject(collector.getName(), XContentBuilder.FieldCaseConversion.NONE);
            builder.field(Fields.COLLECTION_COUNT, collector.getCollectionCount());
            builder.timeValueField(Fields.COLLECTION_TIME_IN_MILLIS, Fields.COLLECTION_TIME, collector.collectionTime);
            builder.endObject();
        }
        builder.endObject();

        builder.endObject();
    }

    if (stats.bufferPools != null) {
        builder.startObject(Fields.BUFFER_POOLS);
        for (BufferPool bufferPool : stats.bufferPools) {
            builder.startObject(bufferPool.getName(), XContentBuilder.FieldCaseConversion.NONE);
            builder.field(Fields.COUNT, bufferPool.getCount());
            builder.byteSizeField(Fields.USED_IN_BYTES, Fields.USED, bufferPool.used);
            builder.byteSizeField(Fields.TOTAL_CAPACITY_IN_BYTES, Fields.TOTAL_CAPACITY, bufferPool.totalCapacity);
            builder.endObject();
        }
        builder.endObject();
    }

    if (stats.classes != null) {
        builder.startObject(Fields.CLASSES);
        builder.field(Fields.CURRENT_LOADED_COUNT, stats.classes.getLoadedClassCount());
        builder.field(Fields.TOTAL_LOADED_COUNT, stats.classes.getTotalLoadedClassCount());
        builder.field(Fields.TOTAL_UNLOADED_COUNT, stats.classes.getUnloadedClassCount());
        builder.endObject();
    }

    builder.endObject();
    return builder;
}
 
Example 19
Source File: JvmStats.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
    builder.startObject(Fields.JVM);
    builder.field(Fields.TIMESTAMP, timestamp);
    builder.timeValueField(Fields.UPTIME_IN_MILLIS, Fields.UPTIME, uptime);
    if (mem != null) {
        builder.startObject(Fields.MEM);

        builder.byteSizeField(Fields.HEAP_USED_IN_BYTES, Fields.HEAP_USED, mem.heapUsed);
        if (mem.getHeapUsedPercent() >= 0) {
            builder.field(Fields.HEAP_USED_PERCENT, mem.getHeapUsedPercent());
        }
        builder.byteSizeField(Fields.HEAP_COMMITTED_IN_BYTES, Fields.HEAP_COMMITTED, mem.heapCommitted);
        builder.byteSizeField(Fields.HEAP_MAX_IN_BYTES, Fields.HEAP_MAX, mem.heapMax);
        builder.byteSizeField(Fields.NON_HEAP_USED_IN_BYTES, Fields.NON_HEAP_USED, mem.nonHeapUsed);
        builder.byteSizeField(Fields.NON_HEAP_COMMITTED_IN_BYTES, Fields.NON_HEAP_COMMITTED, mem.nonHeapCommitted);

        builder.startObject(Fields.POOLS);
        for (MemoryPool pool : mem) {
            builder.startObject(pool.getName(), XContentBuilder.FieldCaseConversion.NONE);
            builder.byteSizeField(Fields.USED_IN_BYTES, Fields.USED, pool.used);
            builder.byteSizeField(Fields.MAX_IN_BYTES, Fields.MAX, pool.max);

            builder.byteSizeField(Fields.PEAK_USED_IN_BYTES, Fields.PEAK_USED, pool.peakUsed);
            builder.byteSizeField(Fields.PEAK_MAX_IN_BYTES, Fields.PEAK_MAX, pool.peakMax);

            builder.endObject();
        }
        builder.endObject();

        builder.endObject();
    }
    if (threads != null) {
        builder.startObject(Fields.THREADS);
        builder.field(Fields.COUNT, threads.getCount());
        builder.field(Fields.PEAK_COUNT, threads.getPeakCount());
        builder.endObject();
    }
    if (gc != null) {
        builder.startObject(Fields.GC);

        builder.startObject(Fields.COLLECTORS);
        for (GarbageCollector collector : gc) {
            builder.startObject(collector.getName(), XContentBuilder.FieldCaseConversion.NONE);
            builder.field(Fields.COLLECTION_COUNT, collector.getCollectionCount());
            builder.timeValueField(Fields.COLLECTION_TIME_IN_MILLIS, Fields.COLLECTION_TIME, collector.collectionTime);
            builder.endObject();
        }
        builder.endObject();

        builder.endObject();
    }

    if (bufferPools != null) {
        builder.startObject(Fields.BUFFER_POOLS);
        for (BufferPool bufferPool : bufferPools) {
            builder.startObject(bufferPool.getName(), XContentBuilder.FieldCaseConversion.NONE);
            builder.field(Fields.COUNT, bufferPool.getCount());
            builder.byteSizeField(Fields.USED_IN_BYTES, Fields.USED, bufferPool.used);
            builder.byteSizeField(Fields.TOTAL_CAPACITY_IN_BYTES, Fields.TOTAL_CAPACITY, bufferPool.totalCapacity);
            builder.endObject();
        }
        builder.endObject();
    }

    if (classes != null) {
        builder.startObject(Fields.CLASSES);
        builder.field(Fields.CURRENT_LOADED_COUNT, classes.getLoadedClassCount());
        builder.field(Fields.TOTAL_LOADED_COUNT, classes.getTotalLoadedClassCount());
        builder.field(Fields.TOTAL_UNLOADED_COUNT, classes.getUnloadedClassCount());
        builder.endObject();
    }

    builder.endObject();
    return builder;
}
 
Example 20
Source File: RecoveryState.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
    builder.timeValueField(Fields.CHECK_INDEX_TIME_IN_MILLIS, Fields.CHECK_INDEX_TIME, checkIndexTime);
    builder.timeValueField(Fields.TOTAL_TIME_IN_MILLIS, Fields.TOTAL_TIME, time());
    return builder;
}