protected virtual void SendTelemetry(IChannelProvider prov) { using (var pipe = prov.StartPipe <TelemetryMessage>("TelemetryPipe")) { SendTelemetryCore(pipe); } }
/// <summary> /// Starts a new server channel. /// </summary> /// <param name="provider">The channel provider, on which to send /// the notification that a server is being constructed</param> /// <param name="identifier">A semi-unique identifier for this /// "bundle" that is being constructed</param> /// <returns>The constructed server channel, or <c>null</c> if there /// was no listeners for server channels registered on <paramref name="provider"/></returns> public static ServerChannel Start(IChannelProvider provider, string identifier) { Contracts.CheckValue(provider, nameof(provider)); provider.CheckNonWhiteSpace(identifier, nameof(identifier)); using (var pipe = provider.StartPipe <IPendingBundleNotification>("Server")) { var sc = new ServerChannel(provider, identifier); pipe.Send(sc); return(sc.ThisIfActiveOrNull); } }
protected void SendTelemetryMetricCore(IChannelProvider prov, Dictionary <string, double> averageMetric) { using (var pipe = prov.StartPipe <TelemetryMessage>("TelemetryPipe")) { Contracts.AssertValue(pipe); if (averageMetric != null) { foreach (var pair in averageMetric) { pipe.Send(TelemetryMessage.CreateMetric(pair.Key, pair.Value, null)); } } } }