卡尺:如何发布在线结果?

时间:2011-01-29 17:48:26

标签: java benchmarking caliper

我目前正试图通过谷歌代码项目维基上提供的少量文档来解决问题。设法运行一些基准测试后,我现在想在线发布结果,以便我可以比在命令行上更清楚地阅读它们。

我按照维基上的说明,访问了microbenchmarks.appspot.com网站并将API密钥复制到我的“.caliperrc”文件中。作为旁注,这个网页告诉我“.caliperrc”文件应该是“在Windows上:C:\。caliperrc”,但实际上,Caliper在%HOME%\。caliperrc中搜索,这是在Windows上(至少对于七):c:\ users \%login%\。caliperrc。

有了这个,Caliper确实试图上传结果......但是它失败并显示“发送到http://microbenchmarks.appspot.com:80/run/失败:内部服务器错误”的消息。当我更改Runner.run方法的代码以便它还打印RuntimeException的堆栈跟踪时,它显示如下所示(%APIKey%在我的.caliperrc文件中有'APIKey'字符串):

java.lang.RuntimeException: Posting to http://microbenchmarks.appspot.com:80/run/ failed.
    at com.google.caliper.Runner.postResults(Runner.java:206)
    at com.google.caliper.Runner.run(Runner.java:96)
    at com.google.caliper.Runner.main(Runner.java:405)
    at com.google.caliper.Runner.main(Runner.java:417)
    at collections.ArrayListBenchmark.main(ArrayListBenchmark.java:119)
Caused by: java.io.IOException: Server returned HTTP response code: 500 for URL: http://microbenchmarks.appspot.com:80/run/%APIKey%/collections.ArrayListBenchmark
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.net.www.protocol.http.HttpURLConnection.getChainedException(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at com.google.caliper.Runner.postResults(Runner.java:200)
    ... 4 more
Caused by: java.io.IOException: Server returned HTTP response code: 500 for URL: http://microbenchmarks.appspot.com:80/run/%APIKey%/collections.ArrayListBenchmark
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at java.net.HttpURLConnection.getResponseCode(Unknown Source)
    at com.google.caliper.Runner.postResults(Runner.java:188)
    ... 4 more

我错过了应该遵循的步骤吗?如果重要的话,我使用以下Java版本直接从svn运行Caliper源代码的Windows 7 64位:

java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01, mixed mode)

1 个答案:

答案 0 :(得分:3)

我已将此报告为Caliper bug 113。作为(跛脚)解决方法,直到修复此问题,您应该在美国语言环境中运行JVM。在您的主要方法中,请致电Locale.setDefault(Locale.US)

相关问题