package org.greencheek.spray.cache.memcached.perf.benchmarks;

import org.greencheek.spray.cache.memcached.perf.state.*;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.GenerateMicroBenchmark;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.output.results.ResultFormatType;
import org.openjdk.jmh.runner.Runner;
import org.openjdk.jmh.runner.RunnerException;
import org.openjdk.jmh.runner.options.Options;
import org.openjdk.jmh.runner.options.OptionsBuilder;
import org.openjdk.jmh.runner.options.VerboseMode;

import java.util.concurrent.TimeUnit;

/**
 * Created by dominictootell on 01/06/2014.
 */
public class SimpleLargeGetBenchmark {

//    @GenerateMicroBenchmark
//    @BenchmarkMode({Mode.SampleTime})
//    public LargeCacheObject simpleGet(LargeCacheKey key, LargeCacheObject value,XXJavaHashLargeTextBenchmarkCache cache) {
//        return org.greencheek.spray.cache.memcached.perftests.SimpleGetBenchmarks.testLargeGet(key, value, cache);
//    }

    @GenerateMicroBenchmark
    @BenchmarkMode({Mode.SampleTime})
    public LargeCacheObject simpleGetWithFSTStaleCache(LargeCacheKey key, LargeCacheObject value,XXJavaHashLargeTextBenchmarkCacheWithFSTWithStale cache) {
        return org.greencheek.spray.cache.memcached.perftests.SimpleGetBenchmarks.testLargeGetWithFSTWithStale(key, value, cache);
    }

//    @GenerateMicroBenchmark
//    @BenchmarkMode({Mode.SampleTime})
//    public LargeCacheObject simpleGetWithFST(LargeCacheKey key, LargeCacheObject value,XXJavaHashLargeTextBenchmarkCacheWithFST cache) {
//        return org.greencheek.spray.cache.memcached.perftests.SimpleGetBenchmarks.testLargeGetWithFST(key, value, cache);
//    }
//
//    @GenerateMicroBenchmark
//    @BenchmarkMode({Mode.SampleTime})
//    public LargeCacheObject simpleGetWithFSTKnownClasses(LargeCacheKey key, LargeCacheObject value,XXJavaHashLargeTextBenchmarkCacheWithFSTKnownClasses cache) {
//        return org.greencheek.spray.cache.memcached.perftests.SimpleGetBenchmarks.testLargeGetWithFSTKnownClasses(key, value, cache);
//    }



    public static void main(String[] args) throws RunnerException {
        Options opts  = new OptionsBuilder()
                .include("org.greencheek.spray.cache.memcached.perf.benchmarks.SimpleLargeGetBenchmark.*")
                .warmupIterations(20)
                .measurementIterations(20)
                .timeUnit(TimeUnit.MILLISECONDS)
                .threads(2)
                .forks(3)
                .jvmArgs(JvmArgs.getJvmArgs())
                .resultFormat(ResultFormatType.TEXT)
                .verbosity(VerboseMode.EXTRA)
                .build();

        new Runner(opts).run();
    }
}

@@ -689,18 +689,16 @@
 mark %7B%0A%0A
-//
     @Gen
@@ -709,34 +709,32 @@
 eMicroBenchmark%0A
-//
     @BenchmarkMo
@@ -747,34 +747,32 @@
 de.SampleTime%7D)%0A
-//
     public Large
@@ -870,34 +870,32 @@
 kCache cache) %7B%0A
-//
         return o
@@ -989,26 +989,24 @@
 ue, cache);%0A
-//
     %7D%0A%0A    @
@@ -1360,18 +1360,16 @@
 %0A    %7D%0A%0A
-//
     @Gen
@@ -1380,34 +1380,32 @@
 eMicroBenchmark%0A
-//
     @BenchmarkMo
@@ -1418,34 +1418,32 @@
 de.SampleTime%7D)%0A
-//
     public Large
@@ -1555,34 +1555,32 @@
 ithFST cache) %7B%0A
-//
         return o
@@ -1689,21 +1689,15 @@
 e);%0A
-//
     %7D%0A
-//%0A//
+%0A
     
@@ -1720,18 +1720,16 @@
 nchmark%0A
-//
     @Ben
@@ -1758,18 +1758,16 @@
 eTime%7D)%0A
-//
     publ
@@ -1919,18 +1919,16 @@
 ache) %7B%0A
-//
         
@@ -2057,10 +2057,8 @@
 e);%0A
-//
     

put back load tests