mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-15 00:15:15 +08:00
Extend server client ResetStatistics() to reset all client statistics not only channel... (#1587)
Extend reset client statistic to reset all stats
This commit is contained in:
@@ -83,6 +83,7 @@ namespace MQTTnet.Server
|
||||
public void ResetStatistics()
|
||||
{
|
||||
ChannelAdapter.ResetStatistics();
|
||||
Statistics.ResetStatistics();
|
||||
}
|
||||
|
||||
public async Task RunAsync()
|
||||
|
||||
@@ -73,7 +73,13 @@ namespace MQTTnet.Server
|
||||
LastNonKeepAlivePacketReceivedTimestamp = LastPacketReceivedTimestamp;
|
||||
}
|
||||
}
|
||||
|
||||
public void ResetStatistics(){
|
||||
Interlocked.Exchange(ref _sentApplicationMessagesCount,0);
|
||||
Interlocked.Exchange(ref _receivedApplicationMessagesCount,0);
|
||||
Interlocked.Exchange(ref _sentPacketsCount,0);
|
||||
Interlocked.Exchange(ref _receivedPacketsCount,0);
|
||||
}
|
||||
|
||||
public void HandleSentPacket(MqttPacket packet)
|
||||
{
|
||||
if (packet == null)
|
||||
|
||||
Reference in New Issue
Block a user