Class ProtoCoverageCollector
Thread-safe base for collectors that aggregate observations as coverage items.
public abstract class ProtoCoverageCollector : IProtoCollector, IProtoReportSource
- Inheritance
-
ProtoCoverageCollector
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
ProtoCoverageCollector(string)
Thread-safe base for collectors that aggregate observations as coverage items.
protected ProtoCoverageCollector(string targetName)
Parameters
targetNamestring
Fields
_items
protected readonly Dictionary<string, ProtoReportItem> _items
Field Value
_lock
protected readonly object _lock
Field Value
Properties
Category
public abstract string Category { get; }
Property Value
TargetName
public string TargetName { get; }
Property Value
Methods
CanCollect(ProtoObservation)
Determines whether this collector accepts an observation.
public virtual bool CanCollect(ProtoObservation observation)
Parameters
observationProtoObservation
Returns
Collect(ProtoObservation)
Records an incoming observation. Implementations should support concurrent calls when tests or requests execute in parallel.
public virtual void Collect(ProtoObservation observation)
Parameters
observationProtoObservation
GetReportItems()
public virtual IEnumerable<ProtoReportItem> GetReportItems()
Returns
MergeMetadata(IReadOnlyDictionary<string, object>?, IReadOnlyDictionary<string, object>?)
protected static IReadOnlyDictionary<string, object>? MergeMetadata(IReadOnlyDictionary<string, object>? existing, IReadOnlyDictionary<string, object>? incoming)
Parameters
existingIReadOnlyDictionary<string, object>incomingIReadOnlyDictionary<string, object>