-
Notifications
You must be signed in to change notification settings - Fork 461
Expand file tree
/
Copy pathPerformanceDataManager.cs
More file actions
36 lines (31 loc) · 918 Bytes
/
PerformanceDataManager.cs
File metadata and controls
36 lines (31 loc) · 918 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.Collections.Generic;
using System.Linq;
namespace MLAPI.Profiling
{
static class PerformanceDataManager
{
static PerformanceTickData s_ProfilerData;
static int s_TickID;
internal static void BeginNewTick()
{
s_TickID = Math.Max(s_TickID, 0);
s_ProfilerData = new PerformanceTickData
{
tickID = s_TickID++,
};
}
internal static void Increment(string fieldName, int count = 1)
{
s_ProfilerData?.Increment(fieldName, count);
}
internal static void AddTransportData(IReadOnlyDictionary<string, int> transportProfilerData)
{
s_ProfilerData?.AddNonDuplicateData(transportProfilerData);
}
internal static PerformanceTickData GetData()
{
return s_ProfilerData;
}
}
}