Skip to content

Commit ebfd9c1

Browse files
committed
Added EventId and made EventList public on Profiler
1 parent 7660619 commit ebfd9c1

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

MLAPI/Data/NetworkProfiler/NetworkProfiler.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,22 @@ public static class NetworkProfiler
77
{
88
public static FixedQueue<ProfilerTick> Ticks = null;
99
private static int tickHistory = 1024;
10+
private static int EventIdCounter = 0;
1011
private static bool isRunning = false;
12+
public static bool IsRunning
13+
{
14+
get
15+
{
16+
return isRunning;
17+
}
18+
}
1119
private static ProfilerTick CurrentTick;
1220

1321
public static void Start(int historyLength)
1422
{
1523
if (isRunning)
1624
return;
25+
EventIdCounter = 0;
1726
Ticks = new FixedQueue<ProfilerTick>(historyLength);
1827
tickHistory = historyLength;
1928
CurrentTick = null;
@@ -44,8 +53,10 @@ internal static void StartTick(TickType type)
4453
ProfilerTick tick = new ProfilerTick()
4554
{
4655
Type = type,
47-
Frame = Time.frameCount
56+
Frame = Time.frameCount,
57+
EventId = EventIdCounter
4858
};
59+
EventIdCounter++;
4960
Ticks.Enqueue(tick);
5061
CurrentTick = tick;
5162
}

MLAPI/Data/NetworkProfiler/ProfilerTickData.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public enum TickType
1010
}
1111
public class ProfilerTick
1212
{
13-
private readonly List<TickEvent> Events = new List<TickEvent>();
13+
public readonly List<TickEvent> Events = new List<TickEvent>();
1414

1515
internal void EndEvent()
1616
{
@@ -39,6 +39,7 @@ internal void StartEvent(TickType type, uint bytes, string channelName, string m
3939

4040
public TickType Type;
4141
public int Frame;
42+
public int EventId;
4243
}
4344

4445
public class TickEvent

0 commit comments

Comments
 (0)