本文整理汇总了C#中EndpointConfiguration.EnableSLAPerformanceCounter方法的典型用法代码示例。如果您正苦于以下问题:C# EndpointConfiguration.EnableSLAPerformanceCounter方法的具体用法?C# EndpointConfiguration.EnableSLAPerformanceCounter怎么用?C# EndpointConfiguration.EnableSLAPerformanceCounter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EndpointConfiguration
的用法示例。
在下文中一共展示了EndpointConfiguration.EnableSLAPerformanceCounter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EnablingSla
void EnablingSla(EndpointConfiguration endpointConfiguration)
{
#region enable-sla
endpointConfiguration.EnableSLAPerformanceCounter(TimeSpan.FromMinutes(3));
#endregion
}
示例2: EnablingSla
public void EnablingSla()
{
#region enable-sla
EndpointConfiguration configuration = new EndpointConfiguration();
configuration.EnableSLAPerformanceCounter(TimeSpan.FromMinutes(3));
#endregion
}
示例3: AsyncMain
static async Task AsyncMain()
{
Console.Title = "Samples.PerfCounters";
var endpointConfiguration = new EndpointConfiguration("Samples.PerfCounters");
endpointConfiguration.UseSerialization<JsonSerializer>();
endpointConfiguration.EnableInstallers();
endpointConfiguration.UsePersistence<InMemoryPersistence>();
endpointConfiguration.SendFailedMessagesTo("error");
#region enable-counters
endpointConfiguration.EnableCriticalTimePerformanceCounter();
endpointConfiguration.EnableSLAPerformanceCounter(TimeSpan.FromSeconds(100));
#endregion
var endpointInstance = await Endpoint.Start(endpointConfiguration)
.ConfigureAwait(false);
try
{
Console.WriteLine("Press enter to send 10 messages with random sleep");
Console.WriteLine("Press any key to exit");
while (true)
{
var key = Console.ReadKey();
Console.WriteLine();
if (key.Key != ConsoleKey.Enter)
{
break;
}
for (var i = 0; i < 10; i++)
{
var myMessage = new MyMessage();
await endpointInstance.SendLocal(myMessage)
.ConfigureAwait(false);
}
}
}
finally
{
await endpointInstance.Stop()
.ConfigureAwait(false);
}
}