[S2GRAPH-21] Change PostProcessBenchmarkSpec not to store and fetch test data 
from storage

  decoupled creating service/label from benchmark test cases.

JIRA:
  [S2GRAPH-21] https://issues.apache.org/jira/browse/S2GRAPH-21

Pull Request:
  Closes #7


Project: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/commit/ae482d5c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/tree/ae482d5c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/diff/ae482d5c

Branch: refs/heads/master
Commit: ae482d5cc9320b4ef4562fbc76a161c5fb011288
Parents: 12f721d
Author: DO YUNG YOON <[email protected]>
Authored: Tue Feb 23 15:21:31 2016 +0900
Committer: DO YUNG YOON <[email protected]>
Committed: Tue Feb 23 15:21:31 2016 +0900

----------------------------------------------------------------------
 CHANGES                                          | 4 ++++
 s2rest_play/test/benchmark/BenchmarkCommon.scala | 9 +++++++++
 2 files changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/ae482d5c/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index afd2485..ebdab3a 100644
--- a/CHANGES
+++ b/CHANGES
@@ -28,3 +28,7 @@ Release 0.12.1 - unreleased
     S2GRAPH-9: Provide rest server using netty. (Committed by daewon).
 
     S2GRAPH-7: Abstract common codes for rest project into s2core. (Committed 
by daewon).
+
+  TEST
+    
+    S2GRAPH-21: Change PostProcessBenchmarkSpec not to store and fetch test 
data from storage. (Committed by DOYUNG YOON).

http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/ae482d5c/s2rest_play/test/benchmark/BenchmarkCommon.scala
----------------------------------------------------------------------
diff --git a/s2rest_play/test/benchmark/BenchmarkCommon.scala 
b/s2rest_play/test/benchmark/BenchmarkCommon.scala
index 9dd69ec..48f84c8 100644
--- a/s2rest_play/test/benchmark/BenchmarkCommon.scala
+++ b/s2rest_play/test/benchmark/BenchmarkCommon.scala
@@ -12,4 +12,13 @@ trait BenchmarkCommon extends Specification {
     println(s"$wrapStr\n$prefix: took ${endTs - startTs} ms$wrapStr")
     ret
   }
+
+  def durationWithReturn[T](prefix: String = "")(block: => T): (T, Long) = {
+    val startTs = System.currentTimeMillis()
+    val ret = block
+    val endTs = System.currentTimeMillis()
+    val duration = endTs - startTs
+//    println(s"$wrapStr\n$prefix: took $duration ms$wrapStr")
+    (ret, duration)
+  }
 }

Reply via email to