44
55namespace MLAPI . Data . NetworkProfiler
66{
7+ /// <summary>
8+ /// NetworkProfiler for profiling network traffic
9+ /// </summary>
710 public static class NetworkProfiler
811 {
12+ /// <summary>
13+ /// The ticks that has been recorded
14+ /// </summary>
915 public static FixedQueue < ProfilerTick > Ticks { get ; private set ; }
16+ /// <summary>
17+ /// Wheter or not the profiler is recording data
18+ /// </summary>
1019 public static bool isRunning { get ; private set ; }
1120 private static int tickHistory = 1024 ;
1221 private static int EventIdCounter = 0 ;
1322 private static ProfilerTick CurrentTick ;
1423
24+ /// <summary>
25+ /// Starts recording data for the Profiler
26+ /// </summary>
27+ /// <param name="historyLength">The amount of ticks to keep in memory</param>
1528 public static void Start ( int historyLength )
1629 {
1730 if ( isRunning )
@@ -23,13 +36,21 @@ public static void Start(int historyLength)
2336 isRunning = true ;
2437 }
2538
39+ /// <summary>
40+ /// Stops recording data
41+ /// </summary>
2642 public static void Stop ( )
2743 {
2844 Ticks = null ; //leave to GC
2945 CurrentTick = null ; //leave to GC
3046 isRunning = false ;
3147 }
3248
49+ /// <summary>
50+ /// Stops recording data and fills the buffer with the recorded ticks and returns the length;
51+ /// </summary>
52+ /// <param name="tickBuffer">The buffer to fill with the ticks</param>
53+ /// <returns>The number of ticks recorded</returns>
3354 public static int Stop ( ref ProfilerTick [ ] tickBuffer )
3455 {
3556 if ( ! isRunning )
@@ -44,6 +65,11 @@ public static int Stop(ref ProfilerTick[] tickBuffer)
4465 return iteration ;
4566 }
4667
68+ /// <summary>
69+ /// Stops recording data and fills the buffer with the recorded ticks and returns the length;
70+ /// </summary>
71+ /// <param name="tickBuffer">The buffer to fill with the ticks</param>
72+ /// <returns>The number of ticks recorded</returns>
4773 public static int Stop ( ref List < ProfilerTick > tickBuffer )
4874 {
4975 if ( ! isRunning )
0 commit comments