← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20171: About, added info about last analytics table generation runtime

 

------------------------------------------------------------
revno: 20171
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-09-15 19:28:41 +0200
message:
  About, added info about last analytics table generation runtime
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/setting/SystemSettingManager.java
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/scheduling/AnalyticsTableTask.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/system/DefaultSystemService.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/system/SystemInfo.java
  dhis-2/dhis-services/dhis-service-core/src/main/resources/i18n_global.properties
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/DateUtils.java
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/about/about.vm


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/setting/SystemSettingManager.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/setting/SystemSettingManager.java	2015-09-15 16:57:32 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/setting/SystemSettingManager.java	2015-09-15 17:28:41 +0000
@@ -99,6 +99,7 @@
     final String KEY_DATABASE_SERVER_CPUS = "keyDatabaseServerCpus";
     final String KEY_LAST_SUCCESSFUL_DATA_SYNC = "keyLastSuccessfulDataSynch";
     final String KEY_LAST_SUCCESSFUL_ANALYTICS_TABLES_UPDATE = "keyLastSuccessfulAnalyticsTablesUpdate";
+    final String KEY_LAST_SUCCESSFUL_ANALYTICS_TABLES_RUNTIME = "keyLastSuccessfulAnalyticsTablesRuntime";
     final String KEY_LAST_SUCCESSFUL_RESOURCE_TABLES_UPDATE = "keyLastSuccessfulResourceTablesUpdate";
     final String KEY_LAST_SUCCESSFUL_MONITORING = "keyLastSuccessfulMonitoring";
     final String KEY_HELP_PAGE_LINK = "helpPageLink";

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/scheduling/AnalyticsTableTask.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/scheduling/AnalyticsTableTask.java	2015-09-10 10:35:39 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/scheduling/AnalyticsTableTask.java	2015-09-15 17:28:41 +0000
@@ -30,6 +30,7 @@
 
 import static org.hisp.dhis.setting.SystemSettingManager.KEY_APPLICATION_TITLE;
 import static org.hisp.dhis.setting.SystemSettingManager.KEY_LAST_SUCCESSFUL_ANALYTICS_TABLES_UPDATE;
+import static org.hisp.dhis.setting.SystemSettingManager.KEY_LAST_SUCCESSFUL_ANALYTICS_TABLES_RUNTIME;
 import static org.hisp.dhis.system.notification.NotificationLevel.ERROR;
 import static org.hisp.dhis.system.notification.NotificationLevel.INFO;
 
@@ -48,6 +49,7 @@
 import org.hisp.dhis.security.NoSecurityContextRunnable;
 import org.hisp.dhis.setting.SystemSettingManager;
 import org.hisp.dhis.system.notification.Notifier;
+import org.hisp.dhis.system.util.DateUtils;
 import org.joda.time.DateTime;
 import org.springframework.beans.factory.annotation.Autowired;
 
@@ -179,5 +181,6 @@
         }
 
         systemSettingManager.saveSystemSetting( KEY_LAST_SUCCESSFUL_ANALYTICS_TABLES_UPDATE, startTime );
+        systemSettingManager.saveSystemSetting( KEY_LAST_SUCCESSFUL_ANALYTICS_TABLES_RUNTIME, DateUtils.getPrettyInterval( clock.getSplitTime() ) );
     }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/system/DefaultSystemService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/system/DefaultSystemService.java	2015-06-15 13:44:20 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/system/DefaultSystemService.java	2015-09-15 17:28:41 +0000
@@ -29,6 +29,7 @@
  */
 
 import static org.hisp.dhis.setting.SystemSettingManager.KEY_LAST_SUCCESSFUL_ANALYTICS_TABLES_UPDATE;
+import static org.hisp.dhis.setting.SystemSettingManager.KEY_LAST_SUCCESSFUL_ANALYTICS_TABLES_RUNTIME;
 
 import java.io.File;
 import java.io.IOException;
@@ -95,6 +96,8 @@
         // ---------------------------------------------------------------------
 
         Date lastAnalyticsTableSuccess = (Date) systemSettingManager.getSystemSetting( KEY_LAST_SUCCESSFUL_ANALYTICS_TABLES_UPDATE );
+        String lastAnalyticsTableRuntime = (String) systemSettingManager.getSystemSetting( KEY_LAST_SUCCESSFUL_ANALYTICS_TABLES_RUNTIME );
+        
         Date now = new Date();
         
         SystemInfo info = systemInfo.instance();
@@ -104,6 +107,7 @@
         info.setServerDate( new Date() );
         info.setLastAnalyticsTableSuccess( lastAnalyticsTableSuccess );
         info.setIntervalSinceLastAnalyticsTableSuccess( DateUtils.getPrettyInterval( lastAnalyticsTableSuccess, now ) );
+        info.setLastAnalyticsTableRuntime( lastAnalyticsTableRuntime );
         
         return info;
     }

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/system/SystemInfo.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/system/SystemInfo.java	2015-04-24 16:07:03 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/system/SystemInfo.java	2015-09-15 17:28:41 +0000
@@ -65,6 +65,8 @@
     private Date lastAnalyticsTableSuccess;
     
     private String intervalSinceLastAnalyticsTableSuccess;
+    
+    private String lastAnalyticsTableRuntime;
 
     // -------------------------------------------------------------------------
     // Stable properties
@@ -222,6 +224,18 @@
 
     @JsonProperty
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+    public String getLastAnalyticsTableRuntime()
+    {
+        return lastAnalyticsTableRuntime;
+    }
+
+    public void setLastAnalyticsTableRuntime( String lastAnalyticsTableRuntime )
+    {
+        this.lastAnalyticsTableRuntime = lastAnalyticsTableRuntime;
+    }
+
+    @JsonProperty
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getVersion()
     {
         return version;

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/i18n_global.properties'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/i18n_global.properties	2015-09-15 11:43:48 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/i18n_global.properties	2015-09-15 17:28:41 +0000
@@ -478,6 +478,7 @@
 system_overview=System Overview
 server_date=Server date
 last_analytics_table_generation=Last analytics table generation
+last_analytics_table_runtime=Last analytics table runtime
 time_since_last_analytics_table_generation=Time since last analytics table generation
 online_release_page=online release page
 edit_profile=Edit profile

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/DateUtils.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/DateUtils.java	2015-09-10 16:35:55 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/DateUtils.java	2015-09-15 17:28:41 +0000
@@ -637,6 +637,18 @@
     }
 
     /**
+     * Returns a pretty string representing the interval between the given
+     * start and end dates using a day, month, second format.
+     *
+     * @param ms the number of milliseconds in the interval.
+     * @return a string, or null if the given start or end date is null.
+     */
+    public static String getPrettyInterval( long ms )
+    {
+        return DAY_SECOND_FORMAT.print( new org.joda.time.Period( ms ) );
+    }
+
+    /**
      * Parses the given string into a Date using the supported date formats.
      * Returns null if the string cannot be parsed.
      *

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/about/about.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/about/about.vm	2015-04-24 16:07:03 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/about/about.vm	2015-09-15 17:28:41 +0000
@@ -10,6 +10,7 @@
   <dt>$i18n.getString( "server_date" ):</dt><dd>$!format.formatDateTime( $!info.serverDate )</dd>
   <dt>$i18n.getString( "last_analytics_table_generation" ):</dt><dd>$!format.formatDateTime( $!info.lastAnalyticsTableSuccess )</dd>
   <dt>$i18n.getString( "time_since_last_analytics_table_generation" ):</dt><dd>$!info.intervalSinceLastAnalyticsTableSuccess</dd>
+  <dt>$i18n.getString( "last_analytics_table_runtime" ):</dt><dd>$!info.lastAnalyticsTableRuntime</dd>
   <dt>$i18n.getString( "environment_variable" ):</dt><dd>$!info.environmentVariable</dd>
   #if ( $currentUserIsSuper )
   <dt>$i18n.getString( "external_configuration_directory" ):</dt><dd>$!info.externalDirectory</dd>