usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdun...@apache.org
Subject usergrid git commit: USERGRID-1044: add shutdown handler to audit simulations
Date Tue, 27 Oct 2015 23:45:26 GMT
Repository: usergrid
Updated Branches:
  refs/heads/USERGRID-1044 fc23b79e9 -> 2e70a72b9


USERGRID-1044: add shutdown handler to audit simulations


Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/2e70a72b
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/2e70a72b
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/2e70a72b

Branch: refs/heads/USERGRID-1044
Commit: 2e70a72b99ac0a48e5f703a1b464fdad3c4d2665
Parents: fc23b79
Author: Mike Dunker <mdunker@apigee.com>
Authored: Tue Oct 27 16:45:02 2015 -0700
Committer: Mike Dunker <mdunker@apigee.com>
Committed: Tue Oct 27 16:45:02 2015 -0700

----------------------------------------------------------------------
 .../apache/usergrid/simulations/AuditSimulation.scala    | 11 +++++++++++
 .../usergrid/simulations/ConfigurableSimulation.scala    |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e70a72b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/AuditSimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/AuditSimulation.scala
b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/AuditSimulation.scala
index 47323ea..bdec3dd 100755
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/AuditSimulation.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/AuditSimulation.scala
@@ -57,6 +57,10 @@ class AuditSimulation extends Simulation {
   }
 
   after {
+    endHandler
+  }
+
+  def endHandler: Unit = {
     Settings.setTestEndTime()
     if (Settings.captureAuditUuids) {
       val uuidDesc = Settings.scenarioType match {
@@ -69,5 +73,12 @@ class AuditSimulation extends Simulation {
     Settings.printAuditResults()
   }
 
+  def abortedEarly: Unit = {
+    println(">>>>>>>>>>>>AUDIT ABORTED")
+    endHandler
+  }
+
+  sys addShutdownHook abortedEarly
+
 }
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/2e70a72b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/ConfigurableSimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/ConfigurableSimulation.scala
b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/ConfigurableSimulation.scala
index 9d4b05d..a3eb595 100755
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/ConfigurableSimulation.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/ConfigurableSimulation.scala
@@ -99,7 +99,7 @@ class ConfigurableSimulation extends Simulation {
     Settings.printSettingsSummary(true)
   }
 
-  sys addShutdownHook(endHandler)
+  sys addShutdownHook endHandler
 
 }
 


Mime
View raw message