GithubHelp home page GithubHelp logo

cappi's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cappi's Issues

Exception caused by: com.google.caliper.ConfigurationException: No benchmarks defined

Having

package mypack.math

class MedianBenchmark extends com.google.caliper.SimpleBenchmark {
  def increment(reps: Int): Unit =
    for (i <- 0 to reps)
      (1 to 1000).sorted.apply(500)
}

and while running cappi::benchmark causes error:

> cappi::benchmark
[info] Running com.google.caliper.Runner mypack.math.MedianBenchmark
[error] An exception was thrown from the benchmark code.
[error] com.google.caliper.UserException$ExceptionFromUserCodeException: An exception was thrown from the benchmark code.
[error]     at com.google.caliper.ScenarioSelection.prepareSuite(ScenarioSelection.java:142)
[error]     at com.google.caliper.ScenarioSelection.select(ScenarioSelection.java:83)
[error]     at com.google.caliper.Runner.runOutOfProcess(Runner.java:373)
[error]     at com.google.caliper.Runner.run(Runner.java:97)
[error]     at com.google.caliper.Runner.main(Runner.java:423)
[error] Caused by: com.google.caliper.ConfigurationException: No benchmarks defined in mypack.math.MedianBenchmark
[error]     at com.google.caliper.SimpleBenchmark.<init>(SimpleBenchmark.java:54)
[error]     at mypack.math.MedianBenchmark.<init>(MedianBenchmark.scala:3)
[error]     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[error]     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
[error]     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[error]     at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
[error]     at com.google.caliper.ScenarioSelection.prepareSuite(ScenarioSelection.java:134)
[error]     ... 4 more
[trace] Stack trace suppressed: run last *:cappi for the full output.
[error] (*:cappi::benchmark) Nonzero exit code returned from runner: 1
[error] Total time: 0 s, completed May 15, 2014 1:22:12 PM

I am using sbt 0.13 and scala 2.11.0.

How to fix it?

cappi does not work with more than one benchmark

Hi,
I am trying to use cappi in my project (jandom-devel/jandom). When there is more than one benchmark, the command cappi::benchmark does not work, since the com.google.caliper.Runner class does not allow more than one benchmark class.

This is the output I get:

> show cappi::benchmarks
[info] ArrayBuffer(it.unich.sci.jandom.JandomBenchmark, it.unich.sci.jandom.BoxDoubleBenchmark)
[success] Total time: 0 s, completed Sep 3, 2013 1:01:01 PM
> cappi::benchmark
[info] Compiling 1 Scala source to /home/amato/git/Jandom/core/target/scala-2.10/classes...
[info] Running com.google.caliper.Runner it.unich.sci.jandom.JandomBenchmark it.unich.sci.jandom.BoxDoubleBenchmark
[error] Error: Multiple benchmark classes specified: [it.unich.sci.jandom.JandomBenchmark, it.unich.sci.jandom.BoxDoubleBenchmark]
[info] 
[info] Usage: Runner [OPTIONS...] <benchmark>
[info] 
[info]   <benchmark>: a benchmark class or suite
[info] 
[info] OPTIONS
[info] 
[info]   -D<param>=<value>: fix a benchmark parameter to a given value.
[info]         Multiple values can be supplied by separating them with the
[info]         delimiter specified in the --delimiter argument.
[info] 
[info]         For example: "-Dfoo=bar,baz,bat"
[info] 
[info]         "benchmark" is a special parameter that can be used to specify
[info]         which benchmark methods to run. For example, if a benchmark has
[info]         the method "timeFoo", it can be run alone by using
[info]         "-Dbenchmark=Foo". "benchmark" also accepts a delimiter
[info]         separated list of methods to run.
[info] 
[info]   -J<param>=<value>: set a JVM argument to the given value.
[info]         Multiple values can be supplied by separating them with the
[info]         delimiter specified in the --delimiter argument.
[info] 
[info]         For example: "-JmemoryMax=-Xmx32M,-Xmx512M"
[info] 
[info]   --delimiter <delimiter>: character or string to use as a delimiter
[info]         for parameter and vm values.
[info]         Default: ","
[info] 
[info]   --warmupMillis <millis>: duration to warmup each benchmark
[info] 
[info]   --runMillis <millis>: duration to execute each benchmark
[info] 
[info]   --captureVmLog: record the VM's just-in-time compiler and GC logs.
[info]         This may slow down or break benchmark display tools.
[info] 
[info]   --measureMemory: measure the number of allocations done and the amount of
[info]         memory used by invocations of the benchmark.
[info]         Default: off
[info] 
[info]   --vm <vm>: executable to test benchmark on. Multiple VMs may be passed
[info]         in as a list separated by the delimiter specified in the
[info]         --delimiter argument.
[info] 
[info]   --timeUnit <unit>: unit of time to use for result. Depends on the units
[info]         defined in the benchmark's getTimeUnitNames() method, if defined.
[info]         Default Options: ns, us, ms, s
[info] 
[info]   --instanceUnit <unit>: unit to use for allocation instances result.
[info]         Depends on the units defined in the benchmark's
[info]         getInstanceUnitNames() method, if defined.
[info]         Default Options: instances, K instances, M instances, B instances
[info] 
[info]   --memoryUnit <unit>: unit to use for allocation memory size result.
[info]         Depends on the units defined in the benchmark's
[info]         getMemoryUnitNames() method, if defined.
[info]         Default Options: B, KB, MB, GB
[info] 
[info]   --saveResults <file/dir>: write results to this file or directory
[info] 
[info]   --printScore: if present, also display an aggregate score for this run,
[info]         where higher is better. This number has no particular meaning,
[info]         but can be compared to scores from other runs that use the exact
[info]         same arguments.
[info] 
[info]   --uploadResults <file/dir>: upload this file or directory of files
[info]         to the web app. This argument ends Caliper early and is thus
[info]         incompatible with all other arguments.
[info] 
[info]   --debug: run without measurement for use with debugger or profiling.
[info] 
[info]   --debug-reps: fixed number of reps to run with --debug.
[info]         Default: "1000"
[trace] Stack trace suppressed: run last JandomExtended/*:cappi for the full output.
[error] (JandomExtended/*:cappi::benchmark) Nonzero exit code returned from runner: 1
[error] Total time: 3 s, completed Sep 3, 2013 1:03:01 PM

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.