-
Notifications
You must be signed in to change notification settings - Fork 461
Expand file tree
/
Copy pathPerformanceTickData.cs
More file actions
31 lines (26 loc) · 900 Bytes
/
PerformanceTickData.cs
File metadata and controls
31 lines (26 loc) · 900 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
using System.Collections.Generic;
using System.Linq;
namespace MLAPI.Profiling
{
public class PerformanceTickData
{
public int tickID;
readonly ProfilingDataStore m_TickData = new ProfilingDataStore();
public void Increment(string fieldName, int count = 1)
{
m_TickData.Increment(fieldName, count);
}
public void AddNonDuplicateData(IReadOnlyDictionary<string, int> transportProfilerData)
{
IEnumerable<KeyValuePair<string, int>> nonDuplicates = transportProfilerData.Where(entry => !m_TickData.HasData(entry.Key));
foreach (KeyValuePair<string, int> entry in nonDuplicates)
{
m_TickData.Add(entry.Key, entry.Value);
}
}
public int GetData(string fieldName)
{
return m_TickData.GetData(fieldName);
}
}
}