← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19643: Time logging in data value import

 

------------------------------------------------------------
revno: 19643
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-07-14 15:10:08 +0200
message:
  Time logging in data value import
modified:
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java


--
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-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java	2015-07-08 09:56:56 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java	2015-07-14 13:10:08 +0000
@@ -94,6 +94,7 @@
 import org.hisp.dhis.system.util.ValidationUtils;
 import org.hisp.dhis.user.CurrentUserService;
 import org.hisp.dhis.commons.collection.CachingMap;
+import org.hisp.dhis.commons.util.Clock;
 import org.hisp.dhis.commons.util.DebugUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 
@@ -536,9 +537,9 @@
      */
     private ImportSummary saveDataValueSet( ImportOptions importOptions, TaskId id, DataValueSet dataValueSet )
     {
-        log.debug( "Import options: " + importOptions );
-        notifier.clear( id ).notify( id, "Process started" );
-
+        Clock clock = new Clock( log ).startClock().logTime( "Starting data value import, options: " + importOptions );
+        notifier.clear( id ).notify( id, "Process started" );        
+        
         ImportSummary summary = new ImportSummary();
 
         I18n i18n = i18nManager.getI18n();
@@ -588,7 +589,8 @@
         {
             notifier.notify( id, "Loading data elements and organisation units" );
             dataElementMap.putAll( identifiableObjectManager.getIdMap( DataElement.class, dataElementIdScheme ) );
-            orgUnitMap.putAll( getOrgUnitMap( orgUnitIdScheme ) );
+            orgUnitMap.putAll( getOrgUnitMap( orgUnitIdScheme ) );            
+            clock.logTime( "Preheated data element and organisation unit caches" );
         }
         
         IdentifiableObjectCallable<DataElement> dataElementCallable = new IdentifiableObjectCallable<>( 
@@ -672,8 +674,8 @@
 
         Date now = new Date();
 
+        clock.logTime( "Validated outer meta-data" );
         notifier.notify( id, "Importing data values" );
-        log.info( "Importing data values" );
 
         while ( dataValueSet.hasNextDataValue() )
         {
@@ -855,7 +857,7 @@
         summary.setDescription( "Import process completed successfully" );
 
         notifier.notify( id, INFO, "Import done", true ).addTaskSummary( id, summary );
-        log.info( "Data value import done, total: " + totalCount + ", import: " + importCount + ", update: " + updateCount );
+        clock.logTime( "Data value import done, total: " + totalCount + ", import: " + importCount + ", update: " + updateCount );
 
         dataValueSet.close();