airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dimuthu...@apache.org
Subject [airavata] branch master updated: Fixing random delay not applying issue in load client
Date Mon, 27 May 2019 02:48:47 GMT
This is an automated email from the ASF dual-hosted git repository.

dimuthuupe pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata.git


The following commit(s) were added to refs/heads/master by this push:
     new db54643  Fixing random delay not applying issue in load client
db54643 is described below

commit db54643e0cb9a6be30625f5c3dd4129293767593
Author: Dimuthu Wannipurage <dimuthu.upeksha2@gmail.com>
AuthorDate: Sun May 26 22:48:32 2019 -0400

    Fixing random delay not applying issue in load client
---
 .../src/main/java/org/apache/airavata/tools/load/UnitLoad.java       | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/load-client/src/main/java/org/apache/airavata/tools/load/UnitLoad.java
b/tools/load-client/src/main/java/org/apache/airavata/tools/load/UnitLoad.java
index 72a9f57..6fbbfc4 100644
--- a/tools/load-client/src/main/java/org/apache/airavata/tools/load/UnitLoad.java
+++ b/tools/load-client/src/main/java/org/apache/airavata/tools/load/UnitLoad.java
@@ -70,8 +70,11 @@ public class UnitLoad {
             List<String> experiments = new ArrayList<>();
             for (int i = 0; i < iterations; i++) {
                 try {
+                    double randomDouble = Math.random();
+                    randomDouble = randomDouble * delay + 1;
+                    long randomLong = (long) randomDouble;
+                    Thread.sleep(randomLong);
                     experiments.add(submitExperiment(config,id + "-" + i));
-                    Thread.sleep(delay);
                 } catch (TException e) {
                     e.printStackTrace();
                 } catch (AgentException e) {


Mime
View raw message