当前位置: 首页>>代码示例>>Java>>正文


Java DoubleHistogram类代码示例

本文整理汇总了Java中org.HdrHistogram.DoubleHistogram的典型用法代码示例。如果您正苦于以下问题:Java DoubleHistogram类的具体用法?Java DoubleHistogram怎么用?Java DoubleHistogram使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DoubleHistogram类属于org.HdrHistogram包,在下文中一共展示了DoubleHistogram类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: AbstractInternalHDRPercentiles

import org.HdrHistogram.DoubleHistogram; //导入依赖的package包/类
/**
 * Read from a stream.
 */
protected AbstractInternalHDRPercentiles(StreamInput in) throws IOException {
    super(in);
    format = in.readNamedWriteable(DocValueFormat.class);
    keys = in.readDoubleArray();
    long minBarForHighestToLowestValueRatio = in.readLong();
    final int serializedLen = in.readVInt();
    byte[] bytes = new byte[serializedLen];
    in.readBytes(bytes, 0, serializedLen);
    ByteBuffer stateBuffer = ByteBuffer.wrap(bytes);
    try {
        state = DoubleHistogram.decodeFromCompressedByteBuffer(stateBuffer, minBarForHighestToLowestValueRatio);
    } catch (DataFormatException e) {
        throw new IOException("Failed to decode DoubleHistogram for aggregation [" + name + "]", e);
    }
    keyed = in.readBoolean();
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:20,代码来源:AbstractInternalHDRPercentiles.java

示例2: doReadFrom

import org.HdrHistogram.DoubleHistogram; //导入依赖的package包/类
@Override
protected void doReadFrom(StreamInput in) throws IOException {
    valueFormatter = ValueFormatterStreams.readOptional(in);
    keys = new double[in.readInt()];
    for (int i = 0; i < keys.length; ++i) {
        keys[i] = in.readDouble();
    }
    long minBarForHighestToLowestValueRatio = in.readLong();
    final int serializedLen = in.readVInt();
    byte[] bytes = new byte[serializedLen];
    in.readBytes(bytes, 0, serializedLen);
    ByteBuffer stateBuffer = ByteBuffer.wrap(bytes);
    try {
        state = DoubleHistogram.decodeFromCompressedByteBuffer(stateBuffer, minBarForHighestToLowestValueRatio);
    } catch (DataFormatException e) {
        throw new IOException("Failed to decode DoubleHistogram for aggregation [" + name + "]", e);
    }
    keyed = in.readBoolean();
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:20,代码来源:AbstractInternalHDRPercentiles.java

示例3: outputHistograms

import org.HdrHistogram.DoubleHistogram; //导入依赖的package包/类
void outputHistograms(PrintStream output) {
    boolean gotHistogram = false;
    for (Map.Entry<Identifier, UntypedMetric> entry : snapshot.entrySet()) {
        if (entry.getValue().getHistogram() == null) {
            continue;
        }
        gotHistogram = true;
        DoubleHistogram histogram = entry.getValue().getHistogram();
        Identifier id = entry.getKey();
        String metricIdentifier = getIdentifierString(id);
        output.println("# start of metric " + metricIdentifier);
        histogram.outputPercentileDistribution(output, 4, 1.0d, true);
        output.println("# end of metric " + metricIdentifier);
    }
    if (!gotHistogram) {
        output.println("# No histograms currently available.");
    }
}
 
开发者ID:vespa-engine,项目名称:vespa,代码行数:19,代码来源:SnapshotConverter.java

示例4: fromBinary

import org.HdrHistogram.DoubleHistogram; //导入依赖的package包/类
@Override
public void fromBinary(
		final byte[] bytes ) {
	final ByteBuffer buffer = super.binaryBuffer(bytes);
	final int endPosition = buffer.getInt();
	try {
		positiveHistogram = DoubleHistogram.decodeFromCompressedByteBuffer(
				buffer,
				LocalInternalHistogram.class,
				0);
		buffer.position(endPosition);
		positiveHistogram.setAutoResize(true);
		if (buffer.get() == (byte) 0x01) {
			negativeHistogram = DoubleHistogram.decodeFromCompressedByteBuffer(
					buffer,
					LocalInternalHistogram.class,
					0);
			negativeHistogram.setAutoResize(true);
		}
	}
	catch (final DataFormatException e) {
		throw new RuntimeException(
				"Cannot decode statistic",
				e);
	}
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:27,代码来源:FeatureNumericHistogramStatistics.java

示例5: buildDoubleHistogramStatistics

import org.HdrHistogram.DoubleHistogram; //导入依赖的package包/类
protected Object[] buildDoubleHistogramStatistics(DoubleHistogram doubleIntervalHistogram, DoubleHistogram accumulatedDoubleHistogram) {
    return new Object[]{((doubleIntervalHistogram.getEndTimeStamp() / 1000.0) - logReader.getStartTimeSec()),
            // values recorded during the last reporting interval
            doubleIntervalHistogram.getTotalCount(),
            doubleIntervalHistogram.getValueAtPercentile(50.0) / config.outputValueUnitRatio,
            doubleIntervalHistogram.getValueAtPercentile(90.0) / config.outputValueUnitRatio,
            doubleIntervalHistogram.getMaxValue() / config.outputValueUnitRatio,
            // values recorded from the beginning until now
            accumulatedDoubleHistogram.getTotalCount(),
            accumulatedDoubleHistogram.getValueAtPercentile(50.0) / config.outputValueUnitRatio,
            accumulatedDoubleHistogram.getValueAtPercentile(90.0) / config.outputValueUnitRatio,
            accumulatedDoubleHistogram.getValueAtPercentile(99.0) / config.outputValueUnitRatio,
            accumulatedDoubleHistogram.getValueAtPercentile(99.9) / config.outputValueUnitRatio,
            accumulatedDoubleHistogram.getValueAtPercentile(99.99) / config.outputValueUnitRatio,
            accumulatedDoubleHistogram.getMaxValue() / config.outputValueUnitRatio};
}
 
开发者ID:hazelcast,项目名称:hazelcast-simulator,代码行数:17,代码来源:HistogramLogProcessor.java

示例6: buildAggregation

import org.HdrHistogram.DoubleHistogram; //导入依赖的package包/类
@Override
public InternalAggregation buildAggregation(long owningBucketOrdinal) {
    DoubleHistogram state = getState(owningBucketOrdinal);
    if (state == null) {
        return buildEmptyAggregation();
    } else {
        return new InternalHDRPercentileRanks(name, keys, state, keyed, format, pipelineAggregators(), metaData());
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:10,代码来源:HDRPercentileRanksAggregator.java

示例7: metric

import org.HdrHistogram.DoubleHistogram; //导入依赖的package包/类
@Override
public double metric(String name, long bucketOrd) {
    DoubleHistogram state = getState(bucketOrd);
    if (state == null) {
        return Double.NaN;
    } else {
        return InternalHDRPercentileRanks.percentileRank(state, Double.valueOf(name));
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:10,代码来源:HDRPercentileRanksAggregator.java

示例8: buildAggregation

import org.HdrHistogram.DoubleHistogram; //导入依赖的package包/类
@Override
public InternalAggregation buildAggregation(long owningBucketOrdinal) {
    DoubleHistogram state = getState(owningBucketOrdinal);
    if (state == null) {
        return buildEmptyAggregation();
    } else {
        return new InternalHDRPercentiles(name, keys, state, keyed, format, pipelineAggregators(), metaData());
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:10,代码来源:HDRPercentilesAggregator.java

示例9: metric

import org.HdrHistogram.DoubleHistogram; //导入依赖的package包/类
@Override
public double metric(String name, long bucketOrd) {
    DoubleHistogram state = getState(bucketOrd);
    if (state == null) {
        return Double.NaN;
    } else {
        return state.getValueAtPercentile(Double.parseDouble(name));
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:10,代码来源:HDRPercentilesAggregator.java

示例10: getState

import org.HdrHistogram.DoubleHistogram; //导入依赖的package包/类
protected DoubleHistogram getState(long bucketOrd) {
    if (bucketOrd >= states.size()) {
        return null;
    }
    final DoubleHistogram state = states.get(bucketOrd);
    return state;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:8,代码来源:AbstractHDRPercentilesAggregator.java

示例11: createTestInstance

import org.HdrHistogram.DoubleHistogram; //导入依赖的package包/类
@Override
protected InternalHDRPercentileRanks createTestInstance(String name, List<PipelineAggregator> pipelineAggregators,
        Map<String, Object> metaData) {
    double[] cdfValues = new double[] { 0.5 };
    int numberOfSignificantValueDigits = 3;
    DoubleHistogram state = new DoubleHistogram(numberOfSignificantValueDigits);
    int numValues = randomInt(100);
    for (int i = 0; i < numValues; ++i) {
        state.recordValue(randomDouble());
    }
    boolean keyed = false;
    DocValueFormat format = DocValueFormat.RAW;
    return new InternalHDRPercentileRanks(name, cdfValues, state, keyed, format, pipelineAggregators, metaData);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:15,代码来源:InternalHDRPercentilesRanksTests.java

示例12: buildAggregation

import org.HdrHistogram.DoubleHistogram; //导入依赖的package包/类
@Override
public InternalAggregation buildAggregation(long owningBucketOrdinal) {
    DoubleHistogram state = getState(owningBucketOrdinal);
    if (state == null) {
        return buildEmptyAggregation();
    } else {
        return new InternalHDRPercentileRanks(name, keys, state, keyed, formatter, pipelineAggregators(), metaData());
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:10,代码来源:HDRPercentileRanksAggregator.java

示例13: buildAggregation

import org.HdrHistogram.DoubleHistogram; //导入依赖的package包/类
@Override
public InternalAggregation buildAggregation(long owningBucketOrdinal) {
    DoubleHistogram state = getState(owningBucketOrdinal);
    if (state == null) {
        return buildEmptyAggregation();
    } else {
        return new InternalHDRPercentiles(name, keys, state, keyed, formatter, pipelineAggregators(), metaData());
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:10,代码来源:HDRPercentilesAggregator.java

示例14: AbstractInternalHDRPercentiles

import org.HdrHistogram.DoubleHistogram; //导入依赖的package包/类
public AbstractInternalHDRPercentiles(String name, double[] keys, DoubleHistogram state, boolean keyed, ValueFormatter formatter,
        List<PipelineAggregator> pipelineAggregators,
        Map<String, Object> metaData) {
    super(name, pipelineAggregators, metaData);
    this.keys = keys;
    this.state = state;
    this.keyed = keyed;
    this.valueFormatter = formatter;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:10,代码来源:AbstractInternalHDRPercentiles.java

示例15: InternalHDRPercentileRanks

import org.HdrHistogram.DoubleHistogram; //导入依赖的package包/类
public InternalHDRPercentileRanks(String name, double[] cdfValues, DoubleHistogram state, boolean keyed, DocValueFormat formatter,
        List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData) {
    super(name, cdfValues, state, keyed, formatter, pipelineAggregators, metaData);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:InternalHDRPercentileRanks.java


注:本文中的org.HdrHistogram.DoubleHistogram类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。