Refactor logger. (#1247)

This commit is contained in:
Christian
2021-09-26 11:05:00 +02:00
committed by GitHub
parent c756a4092f
commit 0920c86d37
70 changed files with 618 additions and 510 deletions
@@ -1,25 +1,20 @@
using BenchmarkDotNet.Attributes;
using MQTTnet.Client;
using MQTTnet.AspNetCore;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using MQTTnet.Server;
using MQTTnet.Diagnostics;
using MQTTnet.AspNetCore.Client;
using MQTTnet.AspNetCore.Extensions;
using MQTTnet.Client.Options;
using MQTTnet.Diagnostics.Logger;
namespace MQTTnet.Benchmarks
{
[MemoryDiagnoser]
public class MessageProcessingMqttConnectionContextBenchmark
{
private IWebHost _host;
private IMqttClient _mqttClient;
private MqttApplicationMessage _message;
IWebHost _host;
IMqttClient _mqttClient;
MqttApplicationMessage _message;
[GlobalSetup]
public void Setup()
@@ -39,7 +34,7 @@ namespace MQTTnet.Benchmarks
.Build();
var factory = new MqttFactory();
_mqttClient = factory.CreateMqttClient(new MqttNetLogger(), new MqttClientConnectionContextFactory());
_mqttClient = factory.CreateMqttClient(new MqttNetEventLogger(), new MqttClientConnectionContextFactory());
_host.StartAsync().GetAwaiter().GetResult();