/// <inheritdoc /> public virtual void AddToCounter(Process process, PipCountersByGroup counter, TimeSpan timeSpan) { foreach (var pipCounters in GetPipCounters(process)) { pipCounters.AddToCounter(counter, timeSpan); } }
/// <inheritdoc /> public virtual void AddToCounter(Process process, PipCountersByGroup counter, long value) { foreach (var pipCounters in GetPipCounters(process)) { pipCounters.AddToCounter(counter, value); } }
/// <inheritdoc /> public void AddToCounter(Process process, PipCountersByGroup counter, TimeSpan timeSpan) { Contract.Requires(!process.IsStartOrShutdownKind, "Service pips should not attempt to add to the process pip by filters counters"); foreach (var pipCounter in m_pipCounters) { pipCounter.AddToCounter(process, counter, timeSpan); } }
/// <summary> /// Gets elapsed time by tag. /// </summary> public Dictionary <string, TimeSpan> GetElapsedTimes(PipCountersByGroup counter) => CountersByGroup.Keys.ToDictionary(x => x.ToString(m_stringTable), x => GetElapsedTime(x, counter));
/// <summary> /// Gets elapsed time by tag. /// </summary> public TimeSpan GetElapsedTime(string tag, PipCountersByGroup counter) => GetElapsedTime(StringId.Create(m_stringTable, tag), counter);
/// <summary> /// Gets counter value by tag. /// </summary> public long GetCounterValue(string tag, PipCountersByGroup counter) => GetCounterValue(StringId.Create(m_stringTable, tag), counter);
/// <summary> /// Gets elapsed time by tag. /// </summary> public TimeSpan GetElapsedTime(StringId tag, PipCountersByGroup counter) => CountersByGroup.TryGetValue(tag, out var pipCounter) ? pipCounter.GetElapsedTime(counter) : TimeSpan.Zero;
/// <summary> /// Gets counter value by tag. /// </summary> public long GetCounterValue(StringId tag, PipCountersByGroup counter) => CountersByGroup.TryGetValue(tag, out var pipCounter) ? pipCounter.GetCounterValue(counter) : 0;
protected void AssertProcessPipCountersByFilterSumToPipExecutorCounters(ScheduleRunResult result, PipExecutorCounter pipExecutorCounter, PipCountersByGroup pipCountersByGroup) { var explicitCounter = result.ProcessPipCountersByFilter.ExplicitlyScheduledProcesses.GetElapsedTime(pipCountersByGroup); var implicitCounter = result.ProcessPipCountersByFilter.ImplicitlyScheduledProcesses.GetElapsedTime(pipCountersByGroup); var executorCounter = result.PipExecutorCounters.GetElapsedTime(pipExecutorCounter); AssertOkTimeDiff(executorCounter, explicitCounter + implicitCounter, "(explicit: " + explicitCounter.TotalMilliseconds + "ms, implicit: " + implicitCounter.TotalMilliseconds + "ms, executor: " + executorCounter.TotalMilliseconds + "ms)"); }