public RuntimeLiveQueryExecutor(AspNetCore.ReportingServices.ReportIntermediateFormat.DataSource dataSource, AspNetCore.ReportingServices.ReportIntermediateFormat.DataSet dataSet, OnDemandProcessingContext odpContext) { this.m_dataSource = dataSource; this.m_dataSet = dataSet; this.m_odpContext = odpContext; this.m_executionMetrics = new DataProcessingMetrics(dataSet, this.m_odpContext.JobContext, this.m_odpContext.ExecutionLogContext); }
public void AddDataSetMetrics(string dataSetName, DataProcessingMetrics metrics) { lock (this.m_dataSetMetrics) { this.m_dataSetMetrics.Add(new Pair <string, DataProcessingMetrics>(dataSetName, metrics)); } }
protected RuntimeDataSource(AspNetCore.ReportingServices.ReportIntermediateFormat.Report report, AspNetCore.ReportingServices.ReportIntermediateFormat.DataSource dataSource, OnDemandProcessingContext processingContext, bool mergeTransactions) { this.m_report = report; this.m_dataSource = dataSource; this.m_odpContext = processingContext; this.m_runtimeDataSets = null; this.m_mergeTran = mergeTransactions; this.m_executionMetrics = new DataProcessingMetrics(this.m_odpContext.JobContext, this.m_odpContext.ExecutionLogContext); Global.Tracer.Assert(this.m_dataSource.Name != null, "The name of a data source cannot be null."); }
public ExecutedQuery(DataSource dataSource, DataSet dataSet, OnDemandProcessingContext odpContext, DataProcessingMetrics executionMetrics, string commandText, DateTime queryExecutionTimestamp, DataSourceErrorInspector errorInspector) { this.m_dataSource = dataSource; this.m_dataSet = dataSet; this.m_odpContext = odpContext; this.m_executionMetrics = executionMetrics; this.m_commandText = commandText; this.m_queryExecutionTimestamp = queryExecutionTimestamp; this.m_errorInspector = errorInspector; }
private static void AddMultiValueQueryParameter(List <QueryParameter> queryParams, IDataMultiValueParameter parameter) { if (parameter.Values != null) { object[] values = parameter.Values; foreach (object parameterValue in values) { queryParams.Add(DataProcessingMetrics.CreateAdditionalInfoQueryParameter(parameter.ParameterName, parameterValue)); } } }
private void AddStartAtParameters(List <QueryParameter> queryParams) { if (this.m_startAtParameters != null && this.m_startAtParameters.Length != 0) { IDataParameter[] startAtParameters = this.m_startAtParameters; foreach (IDataParameter dataParameter in startAtParameters) { if (dataParameter != null) { queryParams.Add(DataProcessingMetrics.CreateAdditionalInfoQueryParameter(dataParameter.ParameterName, dataParameter.Value)); } } } }
public void Add(DataProcessingMetrics metrics) { if (metrics != null) { if (this.m_totalTimeMetric != null) { this.m_totalTimeMetric.Add(metrics.m_totalTimeMetric); } this.Add(MetricType.ExecuteReader, metrics.m_executeReaderDurationMs); this.Add(MetricType.DataReaderMapping, metrics.m_dataReaderMappingDurationMs); this.Add(MetricType.Query, metrics.m_queryDurationMs); this.Add(MetricType.OpenConnection, metrics.m_openConnectionDurationMs); this.Add(MetricType.DisposeDataReader, metrics.m_disposeDataReaderDurationMs); this.Add(MetricType.CancelCommand, metrics.m_cancelCommandDurationMs); } }
private void ExecuteParallelDataSets() { ThreadSet threadSet = new ThreadSet(base.m_runtimeDataSets.Count - 1); try { for (int i = 1; i < base.m_runtimeDataSets.Count; i++) { RuntimeAtomicDataSet runtimeAtomicDataSet = (RuntimeAtomicDataSet)base.m_runtimeDataSets[i]; runtimeAtomicDataSet.InitProcessingParams(null, base.m_transaction); threadSet.TryQueueWorkItem(base.m_odpContext, runtimeAtomicDataSet.ProcessConcurrent); } RuntimeAtomicDataSet runtimeAtomicDataSet2 = (RuntimeAtomicDataSet)base.m_runtimeDataSets[0]; runtimeAtomicDataSet2.InitProcessingParams(base.m_connection, base.m_transaction); runtimeAtomicDataSet2.ProcessConcurrent(null); } catch (Exception e) { if (base.m_odpContext.AbortInfo != null) { base.m_odpContext.AbortInfo.SetError(e, base.m_odpContext.ProcessingAbortItemUniqueIdentifier); } throw; } finally { threadSet.WaitForCompletion(); threadSet.Dispose(); } if (this.NeedsExecutionLogging && base.m_odpContext.JobContext != null) { DataProcessingMetrics dataProcessingMetrics = null; for (int j = 0; j < base.m_runtimeDataSets.Count; j++) { RuntimeDataSet runtimeDataSet = base.m_runtimeDataSets[j]; if (dataProcessingMetrics == null || runtimeDataSet.DataSetExecutionMetrics.TotalDurationMs > dataProcessingMetrics.TotalDurationMs) { dataProcessingMetrics = runtimeDataSet.DataSetExecutionMetrics; } } base.m_executionMetrics.Add(dataProcessingMetrics); } }
private void AddQueryParameters(List <QueryParameter> queryParams) { if (this.m_queryParameters != null) { foreach (IDataParameter queryParameter in this.m_queryParameters) { if (queryParameter != null) { IDataMultiValueParameter dataMultiValueParameter = queryParameter as IDataMultiValueParameter; if (dataMultiValueParameter != null) { DataProcessingMetrics.AddMultiValueQueryParameter(queryParams, dataMultiValueParameter); } else { queryParams.Add(DataProcessingMetrics.CreateAdditionalInfoQueryParameter(queryParameter.ParameterName, queryParameter.Value)); } } } } }
private void FinallyBlockForDataSetExecution() { this.m_noRows = true; DataProcessingMetrics dataProcessingMetrics = null; foreach (RuntimeAtomicDataSource runtimeDataSource in this.m_runtimeDataSources) { if (dataProcessingMetrics == null || runtimeDataSource.ExecutionMetrics.TotalDurationMs > dataProcessingMetrics.TotalDurationMs) { dataProcessingMetrics = runtimeDataSource.ExecutionMetrics; } if (!runtimeDataSource.NoRows) { this.m_noRows = false; } } if (dataProcessingMetrics != null) { this.m_odpContext.ExecutionLogContext.AddDataProcessingTime(dataProcessingMetrics.TotalDuration); } this.m_runtimeDataSources.Clear(); }
public static void DisposeDataExtensionObject <T>(ref T obj, string objectType, string dataSetName, DataProcessingMetrics executionMetrics, DataProcessingMetrics.MetricType?metricType) where T : class, IDisposable { if (obj != null) { if (metricType.HasValue) { executionMetrics.StartTimer(metricType.Value); } try { obj.Dispose(); } catch (RSException) { throw; } catch (Exception ex2) { if (AsynchronousExceptionDetection.IsStoppingException(ex2)) { throw; } Global.Tracer.Trace(TraceLevel.Warning, "Error occurred while disposing the " + objectType + " for DataSet '" + dataSetName.MarkAsPrivate() + "'. Details: " + ex2.ToString()); } finally { obj = null; if (metricType.HasValue) { executionMetrics.RecordTimerMeasurementWithUpdatedTotal(metricType.Value); } } } }
public static void CloseConnection(IDbConnection connection, AspNetCore.ReportingServices.ReportIntermediateFormat.DataSource dataSource, OnDemandProcessingContext odpContext, DataProcessingMetrics executionMetrics) { try { DataSourceInfo dataSourceInfo = RuntimeDataSource.GetDataSourceInfo(dataSource, odpContext); odpContext.CreateAndSetupDataExtensionFunction.CloseConnection(connection, dataSource, dataSourceInfo); } catch (Exception innerException) { throw new ReportProcessingException(ErrorCode.rsErrorClosingConnection, innerException, dataSource.Name); } }
public static IDbConnection OpenConnection(AspNetCore.ReportingServices.ReportIntermediateFormat.DataSource dataSourceObj, AspNetCore.ReportingServices.ReportIntermediateFormat.DataSet dataSetObj, OnDemandProcessingContext pc, DataProcessingMetrics metrics) { IDbConnection dbConnection = null; try { metrics.StartTimer(DataProcessingMetrics.MetricType.OpenConnection); DataSourceInfo dataSourceInfo = null; string text = dataSourceObj.ResolveConnectionString(pc, out dataSourceInfo); if (pc.UseVerboseExecutionLogging) { metrics.ResolvedConnectionString = text; } //if (pc.CreateAndSetupDataExtensionFunction.MustResolveSharedDataSources) //{ //} return(pc.CreateAndSetupDataExtensionFunction.OpenDataSourceExtensionConnection(dataSourceObj, text, dataSourceInfo, dataSetObj.Name)); } catch (RSException) { throw; } catch (Exception ex2) { if (AsynchronousExceptionDetection.IsStoppingException(ex2)) { throw; } throw new ReportProcessingException(ErrorCode.rsErrorOpeningConnection, ex2, dataSourceObj.Name); } finally { long num = metrics.RecordTimerMeasurementWithUpdatedTotal(DataProcessingMetrics.MetricType.OpenConnection); Global.Tracer.Trace(TraceLevel.Verbose, "Opening a connection for DataSource: {0} took {1} ms.", dataSourceObj.Name.MarkAsModelInfo(), num); } }
public void AddDataSourceParallelExecutionMetrics(string dataSourceName, string dataSourceReference, string dataSourceType, DataProcessingMetrics parallelDataSetMetrics) { lock (this.m_dataSourceConnectionMetrics) { this.m_dataSourceConnectionMetrics.Add(new DataSourceMetrics(dataSourceName, dataSourceReference, dataSourceType, parallelDataSetMetrics)); } }
public DataSourceMetrics(string dataSourceName, string dataSourceReference, string dataSourceType, DataProcessingMetrics parallelDataSetMetrics) : this(dataSourceName, dataSourceReference, dataSourceType, parallelDataSetMetrics.ResolvedConnectionString, parallelDataSetMetrics.OpenConnectionDurationMs, parallelDataSetMetrics.ConnectionFromPool) { this.m_dataSetsMetrics = new DataProcessingMetrics[1]; this.m_dataSetsMetrics[0] = parallelDataSetMetrics; }
public DataSourceMetrics(string dataSourceName, string dataSourceReference, string dataSourceType, DataProcessingMetrics aggregatedMetrics, DataProcessingMetrics[] dataSetsMetrics) : this(dataSourceName, dataSourceReference, dataSourceType, aggregatedMetrics.ResolvedConnectionString, aggregatedMetrics.OpenConnectionDurationMs, aggregatedMetrics.ConnectionFromPool) { this.m_dataSetsMetrics = dataSetsMetrics; }
public void AddDataSourceMetrics(string dataSourceName, string dataSourceReference, string dataSourceType, DataProcessingMetrics aggregatedMetrics, DataProcessingMetrics[] dataSetsMetrics) { lock (this.m_dataSourceConnectionMetrics) { this.m_dataSourceConnectionMetrics.Add(new DataSourceMetrics(dataSourceName, dataSourceReference, dataSourceType, aggregatedMetrics, dataSetsMetrics)); } }