airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject [1/2] airavata git commit: Adding more states for the experiment statistics
Date Sat, 18 Jul 2015 08:16:47 GMT
Repository: airavata
Updated Branches:
  refs/heads/airavata-0.15-release-branch 61c2049b5 -> a403561e3


http://git-wip-us.apache.org/repos/asf/airavata/blob/a403561e/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
index 463defb..93a7af0 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
@@ -2950,6 +2950,8 @@ public class ExperimentRegistry {
             );
 
             experimentStatistics.setAllExperimentCount(experimentStatisticsResource.getAllExperimentCount());
+            experimentStatistics.setCreatedExperimentCount(experimentStatisticsResource.getCreatedExperimentCount());
+            experimentStatistics.setRunningExperimentCount(experimentStatisticsResource.getRunningExperimentCount());
             experimentStatistics.setCompletedExperimentCount(experimentStatisticsResource.getCompletedExperimentCount());
             experimentStatistics.setFailedExperimentCount(experimentStatisticsResource.getFailedExperimentCount());
             experimentStatistics.setCancelledExperimentCount(experimentStatisticsResource.getCancelledExperimentCount());
@@ -2961,6 +2963,18 @@ public class ExperimentRegistry {
             experimentStatistics.setAllExperiments(experimentSummaries);
 
             experimentSummaries = new ArrayList();
+            for (ExperimentSummaryResource ex : experimentStatisticsResource.getCreatedExperiments())
{
+                experimentSummaries.add(ThriftDataModelConversion.getExperimentSummary(ex));
+            }
+            experimentStatistics.setCreatedExperiments(experimentSummaries);
+
+            experimentSummaries = new ArrayList();
+            for (ExperimentSummaryResource ex : experimentStatisticsResource.getRunningExperiments())
{
+                experimentSummaries.add(ThriftDataModelConversion.getExperimentSummary(ex));
+            }
+            experimentStatistics.setRunningExperiments(experimentSummaries);
+
+            experimentSummaries = new ArrayList();
             for (ExperimentSummaryResource ex : experimentStatisticsResource.getCompletedExperiments())
{
                 experimentSummaries.add(ThriftDataModelConversion.getExperimentSummary(ex));
             }

http://git-wip-us.apache.org/repos/asf/airavata/blob/a403561e/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentStatisticsResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentStatisticsResource.java
b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentStatisticsResource.java
index 16e8542..3ade9a3 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentStatisticsResource.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentStatisticsResource.java
@@ -34,10 +34,14 @@ public class ExperimentStatisticsResource extends AbstractResource {
 
     private int allExperimentCount;
     private int completedExperimentCount;
+    private int createdExperimentCount;
+    private int runningExperimentCount;
     private int cancelledExperimentCount;
     private int failedExperimentCount;
 
     private List<ExperimentSummaryResource> allExperiments;
+    private List<ExperimentSummaryResource> createdExperiments;
+    private List<ExperimentSummaryResource> runningExperiments;
     private List<ExperimentSummaryResource> completedExperiments;
     private List<ExperimentSummaryResource> cancelledExperiments;
     private List<ExperimentSummaryResource> failedExperiments;
@@ -130,4 +134,36 @@ public class ExperimentStatisticsResource extends AbstractResource {
     public void setFailedExperiments(List<ExperimentSummaryResource> failedExperiments)
{
         this.failedExperiments = failedExperiments;
     }
+
+    public int getCreatedExperimentCount() {
+        return createdExperimentCount;
+    }
+
+    public void setCreatedExperimentCount(int createdExperimentCount) {
+        this.createdExperimentCount = createdExperimentCount;
+    }
+
+    public int getRunningExperimentCount() {
+        return runningExperimentCount;
+    }
+
+    public void setRunningExperimentCount(int runningExperimentCount) {
+        this.runningExperimentCount = runningExperimentCount;
+    }
+
+    public List<ExperimentSummaryResource> getCreatedExperiments() {
+        return createdExperiments;
+    }
+
+    public void setCreatedExperiments(List<ExperimentSummaryResource> createdExperiments)
{
+        this.createdExperiments = createdExperiments;
+    }
+
+    public List<ExperimentSummaryResource> getRunningExperiments() {
+        return runningExperiments;
+    }
+
+    public void setRunningExperiments(List<ExperimentSummaryResource> runningExperiments)
{
+        this.runningExperiments = runningExperiments;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/a403561e/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkerResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkerResource.java
b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkerResource.java
index 5b9dfe4..515d815 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkerResource.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkerResource.java
@@ -727,6 +727,17 @@ public class WorkerResource extends AbstractResource {
         experimentStatisticsResource.setAllExperimentCount(allExperiments.size());
         experimentStatisticsResource.setAllExperiments(allExperiments);
 
+        List<ExperimentSummaryResource> createdExperiments = getExperimentStatisticsForState(ExperimentState.CREATED,
gatewayId, fromTime, toTime);
+        createdExperiments.addAll(getExperimentStatisticsForState(ExperimentState.VALIDATED,
gatewayId, fromTime, toTime));
+        experimentStatisticsResource.setCreatedExperimentCount(createdExperiments.size());
+        experimentStatisticsResource.setCreatedExperiments(createdExperiments);
+
+        List<ExperimentSummaryResource> runningExperiments = getExperimentStatisticsForState(ExperimentState.EXECUTING,
gatewayId, fromTime, toTime);
+        runningExperiments.addAll(getExperimentStatisticsForState(ExperimentState.SCHEDULED,
gatewayId, fromTime, toTime));
+        runningExperiments.addAll(getExperimentStatisticsForState(ExperimentState.LAUNCHED,
gatewayId, fromTime, toTime));
+        experimentStatisticsResource.setCreatedExperimentCount(runningExperiments.size());
+        experimentStatisticsResource.setCreatedExperiments(runningExperiments);
+
         List<ExperimentSummaryResource> completedExperiments = getExperimentStatisticsForState(ExperimentState.COMPLETED,
gatewayId, fromTime, toTime);
         experimentStatisticsResource.setCompletedExperimentCount(completedExperiments.size());
         experimentStatisticsResource.setCompletedExperiments(completedExperiments);


Mime
View raw message