From d866a29d849b599983e1102d88bfe0cd40188f5b Mon Sep 17 00:00:00 2001 From: pvtroshin Date: Tue, 31 May 2011 16:53:34 +0000 Subject: [PATCH] A bug fix, help text for stat jsp pages and style improvements git-svn-id: link to svn.lifesci.dundee.ac.uk/svn/barton/ptroshin/JABA2@4199 e3abac25-378b-4346-85de-24260fe3988d --- TODO.txt | 8 +++- conf/Engine.cluster.properties | 5 ++- conf/Engine.local.properties | 2 +- statpages/Joblist.jsp | 39 ++++++++++++++++++-- statpages/MonthlySummary.jsp | 22 ++++++++++- statpages/Statistics.jsp | 28 ++++++++++++-- .../stat/collector/ExecutionStatCollector.java | 15 +++++++- webservices/compbio/stat/collector/JobStat.java | 15 +++++--- webservices/compbio/stat/servlet/Joblist.java | 24 ++++++++---- 9 files changed, 131 insertions(+), 27 deletions(-) diff --git a/TODO.txt b/TODO.txt index 86eca1b..ff8b237 100644 --- a/TODO.txt +++ b/TODO.txt @@ -3,8 +3,14 @@ TODO: Cluster stats: -Remove hyperlinks from tasks which workdirs were removed -graph generation - -user documentation + -user documentation (do not forget how to enable follow symlinks!) -use the same name for output for different executables + -clean stat db task before packing web app + -pack web apps with stat db + +change input size bites + +add help info for each column in the detailed job list table + +replace default -1 with ? + add to help text: To disable a web service remove it from WEB-INF/sun-jaxws.xml descriptor diff --git a/conf/Engine.cluster.properties b/conf/Engine.cluster.properties index 7d0ccfb..b0bfdad 100644 --- a/conf/Engine.cluster.properties +++ b/conf/Engine.cluster.properties @@ -12,10 +12,11 @@ engine.cluster.enable=true # to the job folders if this path is within JABA web application. # JABAWS statistic application just assume that the last name in the path is the # application folder in the root of JABAWS web application. -cluster.tmp.directory=/cluster/gjb_lab/fc/www-jws2/jaba/jobsout +#cluster.tmp.directory=/cluster/gjb_lab/fc/www-jws2/jaba/jobsout + # Enable/disable cluster statistics collector -cluster.stat.collector.enable=true +cluster.stat.collector.enable=false # Maximum amount of time the job is considered running in hours # Optional defaults to 7 days (168h) diff --git a/conf/Engine.local.properties b/conf/Engine.local.properties index d92c157..25fd766 100644 --- a/conf/Engine.local.properties +++ b/conf/Engine.local.properties @@ -14,7 +14,7 @@ local.tmp.directory=local_jobsout #engine.local.thread.number=3 # Enable/disable cluster statistics collector -local.stat.collector.enable=true +local.stat.collector.enable=false # Maximum amount of time the job is considered running in hours # Optional defaults to 24 hours diff --git a/statpages/Joblist.jsp b/statpages/Joblist.jsp index 90fda82..11410d9 100644 --- a/statpages/Joblist.jsp +++ b/statpages/Joblist.jsp @@ -14,6 +14,7 @@ Date: May 2011 + JABAWS Jobs List (detailed column description) @@ -25,9 +26,21 @@ defaultsort="0" defaultorder="descending"> - - - + + + + + + ? + + + <1 + + + ${job.runtime} + + + @@ -53,4 +66,22 @@ defaultsort="0" defaultorder="descending"> - \ No newline at end of file + + +Columns +
    +
  • JobID - the JABAWS job id, unique for every job
  • +
  • Cluster JobID - cluster job id
  • +
  • InputSize - input size in bytes
  • +
  • ResultSize - result size in bytes
  • +
  • Runtime (s) - job's runtime in seconds
  • +
  • Start time (s)- job's start time and date
  • +
  • Finish time (s)- job's finish time and date
  • +
  • isCancelled - whether the job was cancelled
  • +
  • isCollected - whether the job was collected. False for the jobs that has been initiated but which results has never been retrieved
  • +
  • isFinished - whether the job has finished. This does not necessarily mean that the job has produced the result. + The job can sometime finish in failure.
  • +
+
+ + diff --git a/statpages/MonthlySummary.jsp b/statpages/MonthlySummary.jsp index 78f2fe2..4e3bbea 100644 --- a/statpages/MonthlySummary.jsp +++ b/statpages/MonthlySummary.jsp @@ -9,6 +9,8 @@ Date: May 2011 +
+

JABAWS Usage Statistics

@@ -42,7 +44,7 @@ Date: May 2011 - + @@ -52,5 +54,21 @@ Date: May 2011
${monthTotal.value.abandoned}
Total: ${total.total} ${total.incomplete}
- +
+

Help

+

+The table contains the number of jobs processed by JABAWS per month, for the whole +period when the statistics was collected

+For each month the table contains the following information. +
    +
  • The period of time for which statistics is displayed. For example Jan 2011 means period of time from the first of + January to the 31 of January.
  • +
  • Total - the total number of jobs accepted by JABAWS
  • +
  • Incomplete - the number of jobs for which the result file was not found or was empty
  • +
  • Cancelled - the number of jobs cancelled by the user
  • +
  • Abandoned - the number of jobs which result(s) were not collected
  • +
+The summary for each column is displayed in the last row of the table. +
+
\ No newline at end of file diff --git a/statpages/Statistics.jsp b/statpages/Statistics.jsp index fc11f39..752d047 100644 --- a/statpages/Statistics.jsp +++ b/statpages/Statistics.jsp @@ -10,20 +10,42 @@ Date: May 2011 +
+

JABAWS Usage Statistics for the Period: to

-

All jobs

+

All Jobs

-

Local jobs

+

Local Jobs

-

Cluster jobs

+

Cluster Jobs

+
+

Help

+

+Each table contains the number of jobs processed by JABAWS during the period of +time specified in the title.

+
    +
  • The "All Jobs" table contains the summary of all jobs.
  • +
  • "Local Jobs" table - contains the summary of the jobs calculated by the local engine.
  • +
  • "Cluster Jobs" table - contains the summary of the jobs calculated by the cluster.
  • +
+Each table contains the following information for each web service +
    +
  • Total - the total number of jobs accepted by a particular JABA service
  • +
  • Incomplete - the number of jobs for which the result file was not found or was empty
  • +
  • Cancelled - the number of jobs cancelled by the user
  • +
  • Abandoned - the number of jobs which result(s) were not collected
  • +
+
+
+ diff --git a/webservices/compbio/stat/collector/ExecutionStatCollector.java b/webservices/compbio/stat/collector/ExecutionStatCollector.java index 31a5747..785f659 100644 --- a/webservices/compbio/stat/collector/ExecutionStatCollector.java +++ b/webservices/compbio/stat/collector/ExecutionStatCollector.java @@ -260,8 +260,20 @@ public class ExecutionStatCollector implements Runnable { return UNDEFINED; } + /* + * TODO unify input! + */ long getInputSize() { - File input = files.get("fasta.in"); + Class> name = Services + .getRunnerByJobDirectory(jobdir); + + File input = null; + if (name.getSimpleName().equalsIgnoreCase("ClustalW")) { + input = files.get("input.txt"); + } else { + input = files.get("fasta.in"); + } + if (input != null) { return input.length(); } @@ -321,6 +333,7 @@ public class ExecutionStatCollector implements Runnable { @Override public void run() { log.info("Started updating statistics at " + new Date()); + log.info("For directory: " + workDirectory.getAbsolutePath()); collectStatistics(); diff --git a/webservices/compbio/stat/collector/JobStat.java b/webservices/compbio/stat/collector/JobStat.java index 25e0aa6..6f68845 100644 --- a/webservices/compbio/stat/collector/JobStat.java +++ b/webservices/compbio/stat/collector/JobStat.java @@ -1,9 +1,11 @@ package compbio.stat.collector; import java.sql.Timestamp; +import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Comparator; import java.util.Date; +import java.util.Locale; import compbio.engine.client.ConfExecutable; import compbio.util.Util; @@ -32,6 +34,9 @@ public class JobStat { } }; + private static DateFormat DATE_TIME = SimpleDateFormat.getDateTimeInstance( + DateFormat.DEFAULT, DateFormat.DEFAULT, Locale.UK); + Services webService; String clusterJobId; String jobname; @@ -210,30 +215,28 @@ public class JobStat { public String getStart() { if (start != ExecutionStatCollector.UNDEFINED) { - return SimpleDateFormat.getDateTimeInstance().format( - new Date(start)); + return DATE_TIME.format(new Date(start)); } return "?"; } public String getFinish() { if (finish != ExecutionStatCollector.UNDEFINED) { - return SimpleDateFormat.getDateTimeInstance().format( - new Date(finish)); + return DATE_TIME.format(new Date(finish)); } return "?"; } public long getInputSize() { if (inputSize != ExecutionStatCollector.UNDEFINED) { - return inputSize / 1000; + return inputSize; } return 0; } public long getResultSize() { if (resultSize > 0) { - return resultSize / 1000; + return resultSize; } return 0; } diff --git a/webservices/compbio/stat/servlet/Joblist.java b/webservices/compbio/stat/servlet/Joblist.java index 0ffd9ae..84b0193 100644 --- a/webservices/compbio/stat/servlet/Joblist.java +++ b/webservices/compbio/stat/servlet/Joblist.java @@ -12,10 +12,9 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; -import compbio.engine.conf.PropertyHelperManager; +import compbio.engine.client.PathValidator; import compbio.stat.collector.StatDB; import compbio.stat.collector.StatProcessor; -import compbio.util.PropertyHelper; import compbio.util.Util; import compbio.ws.client.Services; @@ -93,11 +92,22 @@ public class Joblist extends HttpServlet { throw new ServletException("'toDate' is not specified!"); } - PropertyHelper helper = PropertyHelperManager.getPropertyHelper(); - String clusterTempDir = helper.getProperty("cluster.tmp.directory") - .trim(); - clusterTempDir = new File(clusterTempDir).getName(); - String localTempDir = helper.getProperty("local.tmp.directory").trim(); + // Just extract the last name from the path + String clusterTempDir = StatisticCollector.getClusterJobDir(); + if (!Util.isEmpty(clusterTempDir)) { + clusterTempDir = new File(clusterTempDir).getName(); + } else { + clusterTempDir = ""; + } + // Just extract the last name from the path + String localTempDir = StatisticCollector.getLocalJobDir(); + if (!Util.isEmpty(localTempDir)) { + if (PathValidator.isAbsolutePath(localTempDir)) { + localTempDir = new File(localTempDir).getName(); + } + } else { + localTempDir = ""; + } Timestamp startDate = new Timestamp(Long.parseLong(fromDate)); Timestamp stopDate = new Timestamp(Long.parseLong(toDate)); -- 1.7.10.2