/// <summary> /// Add a new custom sampled metric sample from the specified sample packet /// </summary> /// <param name="newMetricSamplePacket">The sample packet to create a new metric sample object from</param> internal EventMetricSample Add(EventMetricSamplePacket newMetricSamplePacket) { if (newMetricSamplePacket == null) { throw new ArgumentNullException(nameof(newMetricSamplePacket), "A new custom sampled metric sample packet object must be provided to add it to the collection."); } //now we have to create a new sample object to wrap the provided packet EventMetricSample newMetricSample = new EventMetricSample(m_EventMetric, newMetricSamplePacket); //and forward to our normal add routine Add(newMetricSample); //returning our new wrapped object return(newMetricSample); }
/// <summary> /// Create a new Event metric sample object for the provided metric and raw sample packet. /// </summary> /// <remarks>The metric sample is automatically added to the samples collection of the provided metric object.</remarks> /// <param name="metric">The metric object this sample applies to.</param> /// <param name="metricSamplePacket">The raw sample data packet.</param> internal EventMetricSample(EventMetric metric, EventMetricSamplePacket metricSamplePacket) : base(metric, metricSamplePacket) { //and now that we've been created, make sure our metric definition set is locked. metric.Definition.IsReadOnly = true; }