mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-19 03:20:33 +00:00
36 lines
1.2 KiB
C#
Executable File
36 lines
1.2 KiB
C#
Executable File
using Mirage.NetworkProfiler.ModuleGUI.Messages;
|
|
using Unity.Profiling.Editor;
|
|
|
|
namespace Mirage.NetworkProfiler.ModuleGUI
|
|
{
|
|
[System.Serializable]
|
|
[ProfilerModuleMetadata(ModuleNames.RECEIVED)]
|
|
public class ReceivedModule : ProfilerModule, ICountRecorderProvider
|
|
{
|
|
private static readonly ProfilerCounterDescriptor[] counters = new ProfilerCounterDescriptor[]
|
|
{
|
|
new ProfilerCounterDescriptor(Names.RECEIVED_COUNT, Counters.Category),
|
|
new ProfilerCounterDescriptor(Names.RECEIVED_BYTES, Counters.Category),
|
|
new ProfilerCounterDescriptor(Names.RECEIVED_PER_SECOND, Counters.Category),
|
|
};
|
|
|
|
public ReceivedModule() : base(counters) { }
|
|
|
|
public override ProfilerModuleViewController CreateDetailsViewController()
|
|
{
|
|
var names = new CounterNames(
|
|
Names.RECEIVED_COUNT,
|
|
Names.RECEIVED_BYTES,
|
|
Names.RECEIVED_PER_SECOND
|
|
);
|
|
|
|
return new MessageViewController(ProfilerWindow, names, SaveDataLoader.ReceiveData);
|
|
}
|
|
|
|
CountRecorder ICountRecorderProvider.GetCountRecorder()
|
|
{
|
|
return NetworkProfilerRecorder._receivedCounter;
|
|
}
|
|
}
|
|
}
|