mirror of
https://github.com/Azure/DotNetty.git
synced 2026-10-23 09:08:30 +08:00
27 lines
782 B
C#
27 lines
782 B
C#
// Copyright (c) Microsoft. All rights reserved.
|
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
|
|
namespace DotNetty.Transport.Tests.Performance.Utilities
|
|
{
|
|
using System.Threading.Tasks;
|
|
using DotNetty.Transport.Channels;
|
|
using NBench;
|
|
|
|
class CounterHandlerOutbound : ChannelHandlerAdapter
|
|
{
|
|
readonly Counter throughput;
|
|
|
|
public CounterHandlerOutbound(Counter throughput)
|
|
{
|
|
this.throughput = throughput;
|
|
}
|
|
|
|
public override Task WriteAsync(IChannelHandlerContext context, object message)
|
|
{
|
|
this.throughput.Increment();
|
|
return context.WriteAsync(message);
|
|
}
|
|
|
|
public override bool IsSharable => true;
|
|
}
|
|
} |