我目前正在尝试使用google代码项目的wiki上的一些文档来解决Caliper的问题。在设法运行了几个基准测试之后,我现在想在网上发布结果,这样我就可以比在命令行上更清楚地阅读它们。
我按照维基上的说明,访问了microbenchmarks.appspot.com网站,并在我的".caliperrc“文件中复制了API。作为附注,这个网页告诉我".caliperrc“文件应该是"on Windows: C:.caliperrc”,但实际上,Caliper搜索的是windows上的%HOME%.caliperrc (至少七年):c:\users\%login%.caliperrc。
有了这个,Caliper确实尝试上传结果...但它失败了,并显示消息"Posting到http://microbenchmarks.appspot.com:80/run/失败:内部服务器错误“。当我修改Runner.run方法的代码,使其也打印RuntimeException的堆栈跟踪时,它看起来如下所示(在我的.caliperrc文件中有一个'APIKey‘的字符串%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我是不是错过了一个我应该遵循的步骤?如果重要的话,我在Windows7 64位上使用以下Java版本直接从svn运行Caliper源代码:
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)发布于 2011-01-30 08:00:42
我已经将此报告为Caliper bug 113。在这个问题得到解决之前,您应该在美国地区运行您的JVM,这是一个(糟糕的)解决办法。在main方法中,调用Locale.setDefault(Locale.US)。
https://stackoverflow.com/questions/4838414
复制相似问题