/// <summary> /// Creates an instance of <see cref="PipCountersByFilter"/>. /// </summary> public PipCountersByFilter(LoggingContext loggingContext, HashSet <NodeId> explicitlyScheduledProcessNodes) : base(loggingContext) { Contract.Requires(loggingContext != null); Contract.Requires(explicitlyScheduledProcessNodes != null); m_explicitlyScheduledProcessNodes = explicitlyScheduledProcessNodes; CountersByGroup.TryAdd(Explicit, new CounterCollection <PipCountersByGroup>()); CountersByGroup.TryAdd(Implicit, new CounterCollection <PipCountersByGroup>()); }
/// <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;