/// <summary>
        /// This method is used to signal a Resource state change and publish this to the DataCollector..
        /// </summary>
        /// <param name="type">The resource event type.</param>
        /// <param name="stats">The current statistics.</param>
        private void ResourceStatisticsSignal(ResourceStatisticsEventType type, ResourceStatistics stats)
        {
            switch (type)
            {
            case ResourceStatisticsEventType.Created:
                Collector?.Write(new ResourceEvent()
                {
                    Type = type, Name = stats.Name
                });
                break;

            case ResourceStatisticsEventType.KeepAlive:
                var re = new ResourceEvent()
                {
                    Type = type, Name = stats.Name
                };
                Collector?.Write(re);
                break;
            }
        }
Beispiel #2
0
 /// <summary>
 /// This extension method writes the raw object to the data collector.
 /// </summary>
 /// <param name="collector">The data collector.</param>
 /// <param name="myEvent">The resource event.</param>
 /// <param name="sync">Specifies whether this method should be written synchronously or on to the async queue for offline processing.</param>
 public static void Write(this IDataCollection collector, ResourceEvent myEvent, bool sync = false)
 {
     collector.Write(myEvent, DataCollectionSupport.Resource, sync);
 }