/// <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);
     }
 }
Exemplo n.º 3
0
        /// <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);
            }
        }
Exemplo n.º 4
0
 /// <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));
Exemplo n.º 5
0
 /// <summary>
 /// Gets elapsed time by tag.
 /// </summary>
 public TimeSpan GetElapsedTime(string tag, PipCountersByGroup counter) => GetElapsedTime(StringId.Create(m_stringTable, tag), counter);
Exemplo n.º 6
0
 /// <summary>
 /// Gets counter value by tag.
 /// </summary>
 public long GetCounterValue(string tag, PipCountersByGroup counter) => GetCounterValue(StringId.Create(m_stringTable, tag), counter);
Exemplo n.º 7
0
 /// <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;
Exemplo n.º 8
0
 /// <summary>
 /// Gets counter value by tag.
 /// </summary>
 public long GetCounterValue(StringId tag, PipCountersByGroup counter) => CountersByGroup.TryGetValue(tag, out var pipCounter) ? pipCounter.GetCounterValue(counter) : 0;
Exemplo n.º 9
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)");
        }