slachiewicz / caliper

Automatically exported from code.google.com/p/caliper
Apache License 2.0
0 stars 0 forks source link

-JanyOption should be allowed even without @VmParam present in the benchmark class #143

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Build any example (ArraySortBenchmark) with Runner.main replaced by 
com.google.caliper.runner.CaliperMain.main .
2. Start new caliper with VM argument -Jmemory=-Xmx64m

What is the expected output? What do you see instead?
I expect something like this:
=======
This selection yields 16 scenarios.
Measuring 1 trials each of 16 scenarios. Estimated runtime: 4m.
Results for com.google.caliper.runner.MicrobenchmarkInstrument:
length distribution         ns runtime
    10   INCREASING     34,941 =
    . . . .
=======
Instead I see:
=====
This selection yields 16 scenarios.
Measuring 1 trials each of 16 scenarios. Estimated runtime: 4m.
java.lang.RuntimeException: Got no response!
    at com.google.caliper.runner.CaliperRun.measure(CaliperRun.java:234)
    at com.google.caliper.runner.CaliperRun.run(CaliperRun.java:132)
    at com.google.caliper.runner.CaliperMain.exitlessMain(CaliperMain.java:88)
    at com.google.caliper.runner.CaliperMain.main(CaliperMain.java:58)
    at com.google.caliper.runner.CaliperMain.main(CaliperMain.java:47)
    at examples.ArraySortBenchmark.main(ArraySortBenchmark.java:100)
=====

What version of the product are you using? On what operating system?
I use caliper-read-only revision 356 on Ubuntu Linux .

Please provide any additional information below.
If I set breakpoint at CaliperRun:230, I see that eventLog contains lines
=========
Exception in thread "main"
java.lang.NoSuchFieldException: memory
    at java.lang.Class.getDeclaredField(Class.java:1899)
    at com.google.caliper.worker.WorkerMain.main(WorkerMain.java:50)
==========

Original issue reported on code.google.com by dmitry.n...@gmail.com on 23 Dec 2011 at 1:11

GoogleCodeExporter commented 9 years ago
I'm sorry for too quick bug report.
Now I see in DemoBenchmark the @VmParam annotation.
I must define "@VmParam String memory;" in the Benchmark class.

Original comment by dmitry.n...@gmail.com on 23 Dec 2011 at 2:43

GoogleCodeExporter commented 9 years ago
No, you're right!  We don't mean to *force* you to have a @VmParam. That is 
just a way to specify the defaults that you want your benchmark to have, but 
you should always be able to set these at the command line anyway.

This could be as simple as catching NoSuchFieldException and doing nothing.

Original comment by kevinb@google.com on 8 Feb 2012 at 9:56

GoogleCodeExporter commented 9 years ago

Original comment by kevinb@google.com on 1 Nov 2012 at 8:32

GoogleCodeExporter commented 9 years ago
@VmParam is gone.

Original comment by kevinb@google.com on 1 Nov 2012 at 8:57