internal void AddDataProcessingTime(TimeMetric childMetric) { if (m_metricManager != null && childMetric != null) { m_metricManager[3].Add(childMetric); } }
public void Add(TimeMetric otherMetric) { m_totalDurationMs += otherMetric.TotalDurationMs; for (int i = 0; i < m_otherMetricAdjustments.Length; i++) { m_otherMetricAdjustments[i] += otherMetric.m_otherMetricAdjustments[i]; } }
public void Subtract(TimeMetric other) { m_totalDurationMs = ExecutionLogContext.TimerMeasurementAdjusted(m_totalDurationMs - other.m_totalDurationMs); for (int i = 0; i < m_otherMetricAdjustments.Length; i++) { long durationMs = m_otherMetricAdjustments[i] - other.m_otherMetricAdjustments[i]; m_otherMetricAdjustments[i] = ExecutionLogContext.TimerMeasurementAdjusted(durationMs); } }
public TimeMetric(TimeMetric other) { m_indexInCollection = other.m_indexInCollection; m_timer = new Timer(); m_totalDurationMs = other.m_totalDurationMs; m_isRunning = false; m_otherMetricAdjustments = (long[])other.m_otherMetricAdjustments.Clone(); m_metricAdjuster = other.m_metricAdjuster; }
private void InitializeFromExistingQuery(ExecutedQuery query) { query.ReleaseOwnership(ref m_connection); m_needToCloseConnection = true; MergeAutoCollationSettings(m_connection); m_executionMetrics.Add(DataProcessingMetrics.MetricType.OpenConnection, query.ExecutionMetrics.OpenConnectionDurationMs); m_executionMetrics.ConnectionFromPool = query.ExecutionMetrics.ConnectionFromPool; m_totalDurationFromExistingQuery = new TimeMetric(query.ExecutionMetrics.TotalDuration); }
public void StopAllRunningTimers() { for (int num = m_timeMetrics.Length - 1; num >= 0; num--) { TimeMetric timeMetric = m_timeMetrics[num]; if (timeMetric.IsRunning) { timeMetric.StopTimer(); } } }
internal DataProcessingMetrics(IJobContext jobContext, ExecutionLogContext executionLogContext) { m_jobContext = jobContext; if (jobContext != null) { m_timers = new Timer[6]; m_totalTimeMetric = executionLogContext.CreateDataRetrievalWorkerTimer(); } else { m_timers = null; } }
public long GetNormalizedAdjustedMetric(int targetIndex) { long num = m_timeMetrics[targetIndex].TotalDurationMs; for (int i = 0; i < m_timeMetrics.Length; i++) { if (i != targetIndex) { TimeMetric timeMetric = m_timeMetrics[i]; num -= timeMetric.OtherMetricAdjustments[targetIndex]; } } return(ExecutionLogContext.NormalizeCalculatedDuration(num)); }
protected override void FinalCleanup() { base.FinalCleanup(); if (RuntimeDataSet != null) { TimeMetric timeMetric = RuntimeDataSet.DataSetExecutionMetrics.TotalDuration; if (m_totalDurationFromExistingQuery != null) { timeMetric = new TimeMetric(timeMetric); timeMetric.Subtract(m_totalDurationFromExistingQuery); } m_odpContext.ExecutionLogContext.AddDataProcessingTime(timeMetric); m_executionMetrics.Add(RuntimeDataSet.DataSetExecutionMetrics); } }