本文整理汇总了C#中ITelemetry.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# ITelemetry.ToString方法的具体用法?C# ITelemetry.ToString怎么用?C# ITelemetry.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITelemetry
的用法示例。
在下文中一共展示了ITelemetry.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Process
/// <summary>
/// Process a collected telemetry item.
/// </summary>
/// <param name="item">A collected Telemetry item.</param>
public void Process(ITelemetry item)
{
if (this.SamplingPercentage < 100.0 - 1.0E-12)
{
// set sampling percentage on telemetry item, current codebase assumes it is the only one updating SamplingPercentage.
var samplingSupportingTelemetry = item as ISupportSampling;
if (samplingSupportingTelemetry != null)
{
samplingSupportingTelemetry.SamplingPercentage = this.SamplingPercentage;
}
if (!this.IsSampledIn(item))
{
if (TelemetryChannelEventSource.Log.IsVerboseEnabled)
{
TelemetryChannelEventSource.Log.ItemSampledOut(item.ToString());
}
return;
}
}
this.Next.Process(item);
}
示例2: Send
/// <summary>
/// Sends an instance of ITelemetry through the channel.
/// </summary>
public void Send(ITelemetry item)
{
if (!this.isInitialized)
{
TelemetryChannelEventSource.Log.StorageNotInitializedError();
}
if (item != null)
{
if (TelemetryChannelEventSource.Log.IsVerboseEnabled)
{
TelemetryChannelEventSource.Log.TelemetryChannelSend(
item.ToString(),
item.Context.InstrumentationKey.Substring(0, Math.Min(item.Context.InstrumentationKey.Length, 8)));
}
this.TelemetryProcessor.Process(item);
}
}
示例3: Send
/// <summary>
/// Sends an instance of ITelemetry through the channel.
/// </summary>
public void Send(ITelemetry item)
{
if (item != null && TelemetryChannelEventSource.Log.IsVerboseEnabled)
{
TelemetryChannelEventSource.Log.TelemetryChannelSend(
item.ToString(),
item.Context.InstrumentationKey.Substring(0, Math.Min(item.Context.InstrumentationKey.Length, 8)));
}
this.TelemetryProcessor.Process(item);
}