← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21432: Analytics, minor performance improvement

 

------------------------------------------------------------
revno: 21432
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2015-12-13 11:54:45 +0100
message:
  Analytics, minor performance improvement
modified:
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.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-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java	2015-12-12 13:24:38 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java	2015-12-13 10:54:45 +0000
@@ -151,6 +151,11 @@
      * Indicates if the data part of the query response should be omitted.
      */
     protected boolean skipData;
+    
+    /**
+     * Indicates if the headers of the query response should be omitted.
+     */
+    protected boolean skipHeaders;
 
     /**
      * Indicates that full precision should be provided for values.
@@ -272,6 +277,7 @@
         params.measureCriteria = this.measureCriteria;
         params.skipMeta = this.skipMeta;
         params.skipData = this.skipData;
+        params.skipHeaders = this.skipHeaders;
         params.skipRounding = this.skipRounding;
         params.completedOnly = this.completedOnly;
         params.hierarchyMeta = this.hierarchyMeta;
@@ -1287,6 +1293,16 @@
         this.skipData = skipData;
     }
 
+    public boolean isSkipHeaders()
+    {
+        return skipHeaders;
+    }
+
+    public void setSkipHeaders( boolean skipHeaders )
+    {
+        this.skipHeaders = skipHeaders;
+    }
+
     public boolean isSkipRounding()
     {
         return skipRounding;

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java	2015-12-12 13:24:38 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java	2015-12-13 10:54:45 +0000
@@ -231,7 +231,7 @@
      */
     private void addHeaders( DataQueryParams params, Grid grid )
     {
-        if ( !params.isSkipData() )
+        if ( !params.isSkipData() && !params.isSkipHeaders() )
         {
             for ( DimensionalObject col : params.getDimensions() )
             {
@@ -896,6 +896,8 @@
         DataQueryParams dataSourceParams = params.instance();
         dataSourceParams.removeDimension( DimensionalObject.DATA_X_DIM_ID );
         dataSourceParams.addDimension( dimension );
+        dataSourceParams.setSkipHeaders( true );
+        dataSourceParams.setSkipMeta( true );
         
         Grid grid = getAggregatedDataValueGridInternal( dataSourceParams );