mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 19:10:32 +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.SENT)]
|
|
public class SentModule : ProfilerModule, ICountRecorderProvider
|
|
{
|
|
private static readonly ProfilerCounterDescriptor[] counters = new ProfilerCounterDescriptor[]
|
|
{
|
|
new ProfilerCounterDescriptor(Names.SENT_COUNT, Counters.Category),
|
|
new ProfilerCounterDescriptor(Names.SENT_BYTES, Counters.Category),
|
|
new ProfilerCounterDescriptor(Names.SENT_PER_SECOND, Counters.Category),
|
|
};
|
|
|
|
public SentModule() : base(counters) { }
|
|
|
|
public override ProfilerModuleViewController CreateDetailsViewController()
|
|
{
|
|
var names = new CounterNames(
|
|
Names.SENT_COUNT,
|
|
Names.SENT_BYTES,
|
|
Names.SENT_PER_SECOND
|
|
);
|
|
|
|
return new MessageViewController(ProfilerWindow, names, SaveDataLoader.SentData);
|
|
}
|
|
|
|
CountRecorder ICountRecorderProvider.GetCountRecorder()
|
|
{
|
|
return NetworkProfilerRecorder._sentCounter;
|
|
}
|
|
}
|
|
}
|