本文整理汇总了Java中org.HdrHistogram.HistogramLogWriter类的典型用法代码示例。如果您正苦于以下问题:Java HistogramLogWriter类的具体用法?Java HistogramLogWriter怎么用?Java HistogramLogWriter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HistogramLogWriter类属于org.HdrHistogram包,在下文中一共展示了HistogramLogWriter类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: encodedHistogram
import org.HdrHistogram.HistogramLogWriter; //导入依赖的package包/类
private void encodedHistogram(final Histogram histogram, final String histogramTitle, final PrintStream out, final String testLabel)
{
try
{
final File histogramOutputFile = getHistogramOutputFile(outputDir, histogramTitle, testLabel);
out.println("Writing full encoded histogram to " + histogramOutputFile.getAbsolutePath() + "\n");
try (final PrintStream printStream = new PrintStream(histogramOutputFile))
{
new HistogramLogWriter(printStream).outputIntervalHistogram(0, 1, histogram, 1d);
}
}
catch (FileNotFoundException e)
{
throw new RuntimeException("Failed to write histogram", e);
}
}
开发者ID:epickrram,项目名称:perf-workshop,代码行数:17,代码来源:HistogramReporter.java
示例2: persist
import org.HdrHistogram.HistogramLogWriter; //导入依赖的package包/类
void persist(long currentTimeMillis, String currentTimeString) {
performanceLogWriter.write(
currentTimeMillis,
currentTimeString,
totalOperationCount,
intervalOperationCount,
intervalThroughput);
// dumps all the Histograms that have been collected to file.
for (Map.Entry<String, Histogram> histogramEntry : intervalHistogramMap.entrySet()) {
String probeName = histogramEntry.getKey();
HistogramLogWriter histogramLogWriter = histogramLogWriterMap.get(probeName);
if (histogramLogWriter == null) {
histogramLogWriter = createHistogramLogWriter(probeName);
histogramLogWriterMap.put(probeName, histogramLogWriter);
}
Histogram intervalHistogram = histogramEntry.getValue();
histogramLogWriter.outputIntervalHistogram(intervalHistogram);
}
}
开发者ID:hazelcast,项目名称:hazelcast-simulator,代码行数:21,代码来源:TestPerformanceTracker.java
示例3: HdrHistLatencyCollector
import org.HdrHistogram.HistogramLogWriter; //导入依赖的package包/类
/** @param outputFileName output file name (in *.hlot format) */
public HdrHistLatencyCollector (String outputFileName) throws FileNotFoundException {
PrintStream log = new PrintStream(new FileOutputStream(outputFileName), false);
histogramLogWriter = new HistogramLogWriter(log);
// Header
//histogramLogWriter.outputComment("[Logged with " + getVersionString() + "]");
histogramLogWriter.outputLogFormatVersion();
histogramLogWriter.outputStartTime(System.currentTimeMillis());
histogramLogWriter.setBaseTime(System.currentTimeMillis());
histogramLogWriter.outputLegend();
Timer timer = new Timer(true);
timer.schedule(new TimerTask() {
@Override
public void run() {
histogramLogWriter.outputIntervalHistogram(histogram);
}
}, OUTPUT_INTERVAL_MSEC);
}
开发者ID:andymalakov,项目名称:libpcap-latency-meter,代码行数:22,代码来源:HdrHistLatencyCollector.java
示例4: outputHistogram
import org.HdrHistogram.HistogramLogWriter; //导入依赖的package包/类
private void outputHistogram(final Histogram histogram, final int streamNumber, final String qualifier)
{
try
{
try(final PrintStream printStream = new PrintStream(getHistogramOutputFile(commandLineArgs, streamNumber, qualifier)))
{
new HistogramLogWriter(printStream).outputIntervalHistogram(streamNumber, streamNumber + 1, histogram, 1d);
}
}
catch (FileNotFoundException e)
{
throw new RuntimeException("Failed to write histogram", e);
}
}
开发者ID:epickrram,项目名称:perf-workshop,代码行数:15,代码来源:Accumulator.java
示例5: report
import org.HdrHistogram.HistogramLogWriter; //导入依赖的package包/类
@Override
public void report(final StatisticsPeekHolder<E> statisticsHolder) {
long now = System.currentTimeMillis();
Enum<E>[] results = statisticsHolder.getResultsReported();
for (Enum<E> result : results) {
Histogram histogram = statisticsHolder.fetchHistogram(result);
Histogram copy = histogram.copy();
histogram.setEndTimeStamp(now);
Holder previous = this.previous.get(result);
if (previous == null) {
try {
histogram.setStartTimeStamp(startTs);
previous = new Holder();
previous.previousTs = startTs;
File hlogFile = new File(this.basedir + File.separatorChar + buildHlogFilename(result.name()));
hlogFile.getParentFile().mkdirs();
previous.writer = new HistogramLogWriter(new PrintStream(hlogFile));
previous.writer.setBaseTime(startTs);
previous.writer.outputLogFormatVersion();
previous.writer.outputBaseTime(previous.writer.getBaseTime());
previous.writer.outputLegend();
this.previous.put(result, previous);
} catch (FileNotFoundException e) {
throw new RuntimeException(e);
}
} else {
histogram.setStartTimeStamp(previous.previousTs);
histogram.subtract(previous.histogram);
}
previous.histogram = copy;
previous.writer.outputIntervalHistogram(histogram);
previous.previousTs = now;
}
}
开发者ID:aurbroszniowski,项目名称:Rainfall-core,代码行数:38,代码来源:PeriodicHlogReporter.java
示例6: summarize
import org.HdrHistogram.HistogramLogWriter; //导入依赖的package包/类
@Override
public void summarize(final StatisticsHolder<E> statisticsHolder) {
// dump raw histograms as hlog files
long startTime = ManagementFactory.getRuntimeMXBean().getStartTime();
long endTime = System.currentTimeMillis();
try {
Enum<E>[] results = statisticsHolder.getResultsReported();
for (Enum<E> result : results) {
Histogram rawHistogram = statisticsHolder.fetchHistogram(result);
rawHistogram.setStartTimeStamp(startTime);
rawHistogram.setEndTimeStamp(endTime);
File hlogFile = new File(this.basedir + File.separatorChar + buildHlogFilename(result.name()));
hlogFile.getParentFile().mkdirs();
HistogramLogWriter writer = new HistogramLogWriter(new PrintStream(hlogFile));
writer.setBaseTime(startTime);
writer.outputLogFormatVersion();
writer.outputBaseTime(writer.getBaseTime());
writer.outputLegend();
writer.outputIntervalHistogram(rawHistogram);
writer.close();
}
} catch (Exception e) {
throw new RuntimeException("Can not report to hlog", e);
}
}
开发者ID:aurbroszniowski,项目名称:Rainfall-core,代码行数:29,代码来源:HlogReporter.java
示例7: main
import org.HdrHistogram.HistogramLogWriter; //导入依赖的package包/类
public static void main(String[] args) throws IOException {
File outputFile = new File(args[0]);
deleteQuiet(outputFile);
ensureExistingFile(outputFile);
HistogramLogReader[] readers = new HistogramLogReader[args.length - 1];
for (int k = 1; k < args.length; k++) {
String inputFile = args[k];
readers[k - 1] = new HistogramLogReader(inputFile);
}
HistogramLogWriter writer = new HistogramLogWriter(outputFile);
writer.outputComment("[Latency histograms for " + getBaseName(outputFile) + ']');
writer.outputLogFormatVersion();
writer.outputLegend();
for (; ; ) {
Histogram merged = null;
for (HistogramLogReader reader : readers) {
Histogram histogram = (Histogram) reader.nextIntervalHistogram();
if (histogram == null) {
continue;
}
if (merged == null) {
merged = new Histogram(
histogram.getLowestDiscernibleValue(),
histogram.getHighestTrackableValue(),
histogram.getNumberOfSignificantValueDigits());
}
merged.add(histogram);
}
if (merged == null) {
break;
}
writer.outputIntervalHistogram(merged);
}
}
开发者ID:hazelcast,项目名称:hazelcast-simulator,代码行数:41,代码来源:HistogramLogMerger.java
示例8: createHistogramLogWriter
import org.HdrHistogram.HistogramLogWriter; //导入依赖的package包/类
HistogramLogWriter createHistogramLogWriter(String probeName) {
String testId = testContainer.getTestCase().getId();
try {
File latencyFile = getLatencyFile(testId, probeName);
HistogramLogWriter histogramLogWriter = new HistogramLogWriter(latencyFile);
histogramLogWriter.setBaseTime(startMeasuringTime());
histogramLogWriter.outputStartTime(startMeasuringTime());
histogramLogWriter.outputComment("[Latency histograms for " + testId + '.' + probeName + ']');
histogramLogWriter.outputLogFormatVersion();
histogramLogWriter.outputLegend();
return histogramLogWriter;
} catch (IOException e) {
throw new TestException("Could not initialize HistogramLogWriter for test " + testId, e);
}
}
开发者ID:hazelcast,项目名称:hazelcast-simulator,代码行数:16,代码来源:TestPerformanceTracker.java
注:本文中的org.HdrHistogram.HistogramLogWriter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论