本文整理了Java中com.carrotsearch.junitbenchmarks.XMLConsumer
类的一些代码示例,展示了XMLConsumer
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLConsumer
类的具体详情如下:
包路径:com.carrotsearch.junitbenchmarks.XMLConsumer
类名称:XMLConsumer
[英]IResultsConsumer that writes XML files for each benchmark.
[中]IResultsConsumer,为每个基准编写XML文件。
代码示例来源:origin: thinkaurelius/titan
private static IResultsConsumer[] getConsumersUnsafe(IResultsConsumer... additional) throws IOException {
List<IResultsConsumer> consumers = new ArrayList<IResultsConsumer>();
consumers.add(new XMLConsumer(new File("jub." + Math.abs(System.nanoTime()) + ".xml")));
consumers.add(new WriterConsumer()); // defaults to System.out
consumers.add(new CsvConsumer("target/jub.csv"));
if (null != System.getenv(ENV_EFFORT_GENERATE)) {
String file = getEffortFilePath();
Writer writer = new FileWriter(file, true);
log.info("Opened " + file + " for appending");
consumers.add(new TimeScaleConsumer(writer));
}
for (IResultsConsumer c : additional) {
consumers.add(c);
}
return consumers.toArray(new IResultsConsumer[consumers.size()]);
}
代码示例来源:origin: com.carrotsearch/junit-benchmarks
public XMLConsumer(File fileName) throws IOException
{
writer = new OutputStreamWriter(new FileOutputStream(fileName), "UTF-8");
addAutoclose(this);
writer.write("<benchmark-results tstamp=\"" + tstamp() + "\">\n\n");
nf = NumberFormat.getInstance(Locale.ENGLISH);
nf.setMaximumFractionDigits(3);
nf.setGroupingUsed(false);
}
代码示例来源:origin: org.scijava/junit-benchmarks
/**
* Instantiate from global options.
*/
public XMLConsumer() throws IOException
{
this(getDefaultOutputFile());
}
代码示例来源:origin: org.scijava/junit-benchmarks
/**
* Close the output XML stream.
*/
public void close()
{
try
{
if (this.writer != null)
{
writer.write("</benchmark-results>");
writer.close();
writer = null;
removeAutoclose(this);
}
}
catch (IOException e)
{
// Ignore.
}
}
代码示例来源:origin: com.carrotsearch/junit-benchmarks
attribute(b, "classname", result.getTestClassName());
attribute(b, "name", result.getTestMethodName());
attribute(b, "benchmark-rounds", Integer.toString(result.benchmarkRounds));
attribute(b, "warmup-rounds", Integer.toString(result.warmupRounds));
attribute(b, "round-avg", nf.format(result.roundAverage.avg));
attribute(b, "round-stddev", nf.format(result.roundAverage.stddev));
attribute(b, "gc-avg", nf.format(result.gcAverage.avg));
attribute(b, "gc-stddev", nf.format(result.gcAverage.stddev));
attribute(b, "gc-invocations", Long.toString(result.gcInfo.accumulatedInvocations()));
attribute(b, "gc-time", nf.format(result.gcInfo.accumulatedTime() / 1000.0));
attribute(b, "benchmark-time-total", nf.format(result.benchmarkTime * 0.001));
attribute(b, "warmup-time-total", nf.format(result.warmupTime * 0.001));
attribute(b, "threads", Integer.toString(result.getThreadCount()));
代码示例来源:origin: org.scijava/junit-benchmarks
public XMLConsumer(File fileName) throws IOException
{
writer = new OutputStreamWriter(new FileOutputStream(fileName), "UTF-8");
addAutoclose(this);
writer.write("<benchmark-results tstamp=\"" + tstamp() + "\">\n\n");
nf = NumberFormat.getInstance(Locale.ENGLISH);
nf.setMaximumFractionDigits(3);
nf.setGroupingUsed(false);
}
代码示例来源:origin: com.carrotsearch/junit-benchmarks
/**
* Instantiate from global options.
*/
public XMLConsumer() throws IOException
{
this(getDefaultOutputFile());
}
代码示例来源:origin: com.carrotsearch/junit-benchmarks
/**
* Close the output XML stream.
*/
public void close()
{
try
{
if (this.writer != null)
{
writer.write("</benchmark-results>");
writer.close();
writer = null;
removeAutoclose(this);
}
}
catch (IOException e)
{
// Ignore.
}
}
代码示例来源:origin: org.scijava/junit-benchmarks
attribute(b, "classname", result.getTestClassName());
attribute(b, "name", result.getTestMethodName());
attribute(b, "benchmark-rounds", Integer.toString(result.benchmarkRounds));
attribute(b, "warmup-rounds", Integer.toString(result.warmupRounds));
attribute(b, "round-avg", nf.format(result.roundAverage.avg));
attribute(b, "round-stddev", nf.format(result.roundAverage.stddev));
attribute(b, "gc-avg", nf.format(result.gcAverage.avg));
attribute(b, "gc-stddev", nf.format(result.gcAverage.stddev));
attribute(b, "gc-invocations", Long.toString(result.gcInfo.accumulatedInvocations()));
attribute(b, "gc-time", nf.format(result.gcInfo.accumulatedTime() / 1000.0));
attribute(b, "benchmark-time-total", nf.format(result.benchmarkTime * 0.001));
attribute(b, "warmup-time-total", nf.format(result.warmupTime * 0.001));
attribute(b, "threads", Integer.toString(result.getThreadCount()));
代码示例来源:origin: JanusGraph/janusgraph
private static IResultsConsumer[] getConsumersUnsafe(IResultsConsumer... additional) throws IOException {
final List<IResultsConsumer> consumers = new ArrayList<>();
consumers.add(new XMLConsumer(new File("jub." + Math.abs(System.nanoTime()) + ".xml")));
consumers.add(new WriterConsumer()); // defaults to System.out
consumers.add(new CsvConsumer("target/jub.csv"));
if (null != System.getenv(ENV_EFFORT_GENERATE)) {
String file = getEffortFilePath();
Writer writer = new FileWriter(file, true);
log.info("Opened " + file + " for appending");
consumers.add(new TimeScaleConsumer(writer));
}
consumers.addAll(Arrays.asList(additional));
return consumers.toArray(new IResultsConsumer[consumers.size()]);
}
代码示例来源:origin: com.thinkaurelius.titan/titan-test-jre6
private static IResultsConsumer[] getConsumersUnsafe(IResultsConsumer... additional) throws IOException {
List<IResultsConsumer> consumers = new ArrayList<IResultsConsumer>();
consumers.add(new XMLConsumer(new File("jub." + Math.abs(System.nanoTime()) + ".xml")));
consumers.add(new WriterConsumer()); // defaults to System.out
if (null != System.getenv(ENV_EFFORT_GENERATE)) {
String file = getEffortFilePath();
Writer writer = new FileWriter(file, true);
log.info("Opened " + file + " for appending");
consumers.add(new TimeScaleConsumer(writer));
}
for (IResultsConsumer c : additional) {
consumers.add(c);
}
return consumers.toArray(new IResultsConsumer[consumers.size()]);
}
代码示例来源:origin: org.hawkular.titan/titan-test
private static IResultsConsumer[] getConsumersUnsafe(IResultsConsumer... additional) throws IOException {
List<IResultsConsumer> consumers = new ArrayList<IResultsConsumer>();
consumers.add(new XMLConsumer(new File("jub." + Math.abs(System.nanoTime()) + ".xml")));
consumers.add(new WriterConsumer()); // defaults to System.out
consumers.add(new CsvConsumer("target/jub.csv"));
if (null != System.getenv(ENV_EFFORT_GENERATE)) {
String file = getEffortFilePath();
Writer writer = new FileWriter(file, true);
log.info("Opened " + file + " for appending");
consumers.add(new TimeScaleConsumer(writer));
}
for (IResultsConsumer c : additional) {
consumers.add(c);
}
return consumers.toArray(new IResultsConsumer[consumers.size()]);
}
内容来源于网络,如有侵权,请联系作者删除!