• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DoubleHistogram类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: createReduced

import org.HdrHistogram.DoubleHistogram; //导入依赖的package包/类
@Override
protected AbstractInternalHDRPercentiles createReduced(String name, double[] keys, DoubleHistogram merged, boolean keyed,
        List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData) {
    return new InternalHDRPercentileRanks(name, keys, merged, keyed, format, pipelineAggregators, metaData);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:6,代码来源:InternalHDRPercentileRanks.java


示例17: Iter

import org.HdrHistogram.DoubleHistogram; //导入依赖的package包/类
public Iter(double[] values, DoubleHistogram state) {
    this.values = values;
    this.state = state;
    i = 0;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:6,代码来源:InternalHDRPercentileRanks.java


示例18: createReduced

import org.HdrHistogram.DoubleHistogram; //导入依赖的package包/类
protected abstract AbstractInternalHDRPercentiles createReduced(String name, double[] keys, DoubleHistogram merged, boolean keyed,
List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData);
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:3,代码来源:AbstractInternalHDRPercentiles.java


示例19: InternalHDRPercentiles

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


示例20: createReduced

import org.HdrHistogram.DoubleHistogram; //导入依赖的package包/类
@Override
protected AbstractInternalHDRPercentiles createReduced(String name, double[] keys, DoubleHistogram merged, boolean keyed,
        List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData) {
    return new InternalHDRPercentiles(name, keys, merged, keyed, format, pipelineAggregators, metaData);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:6,代码来源:InternalHDRPercentiles.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PanHandlerFX类代码示例发布时间:2022-05-22
下一篇:
Java CustomizationSpec类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap