Skip to content
Permalink
Browse files

More fine tuned profiling for AFS layer loading in projects

  • Loading branch information
nyalldawson committed Jun 26, 2020
1 parent ae8dbd8 commit e8a15c18af0eb37d0878ce3809c6a13f1a8e805f
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/providers/arcgisrest/qgsafsprovider.cpp
@@ -23,6 +23,7 @@
#include "qgslogger.h"
#include "qgsdataitemprovider.h"
#include "qgsapplication.h"
#include "qgsruntimeprofiler.h"

const QString QgsAfsProvider::AFS_PROVIDER_KEY = QStringLiteral( "arcgisfeatureserver" );
const QString QgsAfsProvider::AFS_PROVIDER_DESCRIPTION = QStringLiteral( "ArcGIS Feature Service data provider" );
@@ -47,6 +48,10 @@ QgsAfsProvider::QgsAfsProvider( const QString &uri, const ProviderOptions &optio
if ( !referer.isEmpty() )
mRequestHeaders[ QStringLiteral( "Referer" )] = referer;

std::unique_ptr< QgsScopedRuntimeProfile > profile;
if ( QgsApplication::profiler()->groupIsActive( QStringLiteral( "projectload" ) ) )
profile = qgis::make_unique< QgsScopedRuntimeProfile >( tr( "Retrieve service definition" ), QStringLiteral( "projectload" ) );

const QVariantMap layerData = QgsArcGisRestUtils::getLayerInfo( mSharedData->mDataSource.param( QStringLiteral( "url" ) ),
authcfg, errorTitle, errorMessage, mRequestHeaders );
if ( layerData.isEmpty() )
@@ -217,6 +222,9 @@ QgsAfsProvider::QgsAfsProvider( const QString &uri, const ProviderOptions &optio
}
}

if ( profile )
profile->switchTask( tr( "Retrieve object IDs" ) );

// Read OBJECTIDs of all features: these may not be a continuous sequence,
// and we need to store these to iterate through the features. This query
// also returns the name of the ObjectID field.

0 comments on commit e8a15c1

Please sign in to comment.
You can’t perform that action at this time.