@@ -25,8 +25,8 @@ internal static class MLAPIProfilerModule
25
25
private class MLAPIProfilerCounter
26
26
{
27
27
// Note: These fields are named this way for internal serialization
28
- public string Name ;
29
- public string Category ;
28
+ public string m_Name ;
29
+ public string m_Category ;
30
30
}
31
31
32
32
/// <summary>
@@ -36,62 +36,65 @@ private class MLAPIProfilerCounter
36
36
private class MLAPIProfilerModuleData
37
37
{
38
38
// Note: These fields are named this way for internal serialization
39
- public List < MLAPIProfilerCounter > ChartCounters = new List < MLAPIProfilerCounter > ( ) ;
40
- public List < MLAPIProfilerCounter > DetailCounters = new List < MLAPIProfilerCounter > ( ) ;
41
- public string Name ;
39
+ public List < MLAPIProfilerCounter > m_ChartCounters = new List < MLAPIProfilerCounter > ( ) ;
40
+ public List < MLAPIProfilerCounter > m_DetailCounters = new List < MLAPIProfilerCounter > ( ) ;
41
+ public string m_Name ;
42
42
}
43
43
44
+ /// <summary>
45
+ /// This needs to be in synced with the internal dynamic module structure to provide our own counters
46
+ /// </summary>
44
47
[ Serializable ]
45
48
private class MLAPIModules
46
49
{
47
50
// Note: These fields are named this way for internal serialization
48
- public List < MLAPIProfilerModuleData > Modules ;
51
+ public List < MLAPIProfilerModuleData > m_Modules ;
49
52
}
50
53
#pragma warning restore IDE1006 // restore naming rule violation check
51
54
52
55
private static List < MLAPIProfilerCounter > CreateRPCCounters ( ) => new List < MLAPIProfilerCounter > ( )
53
56
{
54
- new MLAPIProfilerCounter { Name = ProfilerConstants . RpcSent , Category = ProfilerCategory . Network . Name } ,
55
- new MLAPIProfilerCounter { Name = ProfilerConstants . RpcReceived , Category = ProfilerCategory . Network . Name } ,
56
- new MLAPIProfilerCounter { Name = ProfilerConstants . RpcBatchesSent , Category = ProfilerCategory . Network . Name } ,
57
- new MLAPIProfilerCounter { Name = ProfilerConstants . RpcBatchesReceived , Category = ProfilerCategory . Network . Name } ,
58
- new MLAPIProfilerCounter { Name = ProfilerConstants . RpcQueueProcessed , Category = ProfilerCategory . Network . Name } ,
59
- new MLAPIProfilerCounter { Name = ProfilerConstants . RpcInQueueSize , Category = ProfilerCategory . Network . Name } ,
60
- new MLAPIProfilerCounter { Name = ProfilerConstants . RpcOutQueueSize , Category = ProfilerCategory . Network . Name } ,
57
+ new MLAPIProfilerCounter { m_Name = ProfilerConstants . RpcSent , m_Category = ProfilerCategory . Network . Name } ,
58
+ new MLAPIProfilerCounter { m_Name = ProfilerConstants . RpcReceived , m_Category = ProfilerCategory . Network . Name } ,
59
+ new MLAPIProfilerCounter { m_Name = ProfilerConstants . RpcBatchesSent , m_Category = ProfilerCategory . Network . Name } ,
60
+ new MLAPIProfilerCounter { m_Name = ProfilerConstants . RpcBatchesReceived , m_Category = ProfilerCategory . Network . Name } ,
61
+ new MLAPIProfilerCounter { m_Name = ProfilerConstants . RpcQueueProcessed , m_Category = ProfilerCategory . Network . Name } ,
62
+ new MLAPIProfilerCounter { m_Name = ProfilerConstants . RpcInQueueSize , m_Category = ProfilerCategory . Network . Name } ,
63
+ new MLAPIProfilerCounter { m_Name = ProfilerConstants . RpcOutQueueSize , m_Category = ProfilerCategory . Network . Name } ,
61
64
} ;
62
65
63
66
private static List < MLAPIProfilerCounter > CreateOperationsCounters ( ) => new List < MLAPIProfilerCounter > ( )
64
67
{
65
- new MLAPIProfilerCounter { Name = ProfilerConstants . Connections , Category = ProfilerCategory . Network . Name } ,
66
- new MLAPIProfilerCounter { Name = ProfilerConstants . ReceiveTickRate , Category = ProfilerCategory . Network . Name } ,
68
+ new MLAPIProfilerCounter { m_Name = ProfilerConstants . Connections , m_Category = ProfilerCategory . Network . Name } ,
69
+ new MLAPIProfilerCounter { m_Name = ProfilerConstants . ReceiveTickRate , m_Category = ProfilerCategory . Network . Name } ,
67
70
} ;
68
71
69
72
private static List < MLAPIProfilerCounter > CreateMessagesCounters ( ) => new List < MLAPIProfilerCounter > ( )
70
73
{
71
- new MLAPIProfilerCounter { Name = ProfilerConstants . NamedMessageReceived , Category = ProfilerCategory . Network . Name } ,
72
- new MLAPIProfilerCounter { Name = ProfilerConstants . UnnamedMessageReceived , Category = ProfilerCategory . Network . Name } ,
73
- new MLAPIProfilerCounter { Name = ProfilerConstants . NamedMessageSent , Category = ProfilerCategory . Network . Name } ,
74
- new MLAPIProfilerCounter { Name = ProfilerConstants . UnnamedMessageSent , Category = ProfilerCategory . Network . Name } ,
75
- new MLAPIProfilerCounter { Name = ProfilerConstants . ByteSent , Category = ProfilerCategory . Network . Name } ,
76
- new MLAPIProfilerCounter { Name = ProfilerConstants . ByteReceived , Category = ProfilerCategory . Network . Name } ,
77
- new MLAPIProfilerCounter { Name = ProfilerConstants . NetworkVarUpdates , Category = ProfilerCategory . Network . Name } ,
78
- new MLAPIProfilerCounter { Name = ProfilerConstants . NetworkVarDeltas , Category = ProfilerCategory . Network . Name } ,
74
+ new MLAPIProfilerCounter { m_Name = ProfilerConstants . NamedMessageReceived , m_Category = ProfilerCategory . Network . Name } ,
75
+ new MLAPIProfilerCounter { m_Name = ProfilerConstants . UnnamedMessageReceived , m_Category = ProfilerCategory . Network . Name } ,
76
+ new MLAPIProfilerCounter { m_Name = ProfilerConstants . NamedMessageSent , m_Category = ProfilerCategory . Network . Name } ,
77
+ new MLAPIProfilerCounter { m_Name = ProfilerConstants . UnnamedMessageSent , m_Category = ProfilerCategory . Network . Name } ,
78
+ new MLAPIProfilerCounter { m_Name = ProfilerConstants . ByteSent , m_Category = ProfilerCategory . Network . Name } ,
79
+ new MLAPIProfilerCounter { m_Name = ProfilerConstants . ByteReceived , m_Category = ProfilerCategory . Network . Name } ,
80
+ new MLAPIProfilerCounter { m_Name = ProfilerConstants . NetworkVarUpdates , m_Category = ProfilerCategory . Network . Name } ,
81
+ new MLAPIProfilerCounter { m_Name = ProfilerConstants . NetworkVarDeltas , m_Category = ProfilerCategory . Network . Name } ,
79
82
} ;
80
83
81
84
private delegate List < MLAPIProfilerCounter > CounterListFactoryDelegate ( ) ;
82
85
83
86
private static bool CreateMLAPIDynamicModule ( ref MLAPIModules mlapiModules , string moduleName , CounterListFactoryDelegate counterListFactoryDelegate )
84
87
{
85
- var module = mlapiModules . Modules . Find ( x => x . Name == moduleName ) ;
88
+ var module = mlapiModules . m_Modules . Find ( x => x . m_Name == moduleName ) ;
86
89
if ( module == null )
87
90
{
88
91
var newModule = new MLAPIProfilerModuleData
89
92
{
90
- Name = moduleName ,
91
- ChartCounters = counterListFactoryDelegate ( ) ,
92
- DetailCounters = counterListFactoryDelegate ( ) ,
93
+ m_Name = moduleName ,
94
+ m_ChartCounters = counterListFactoryDelegate ( ) ,
95
+ m_DetailCounters = counterListFactoryDelegate ( ) ,
93
96
} ;
94
- mlapiModules . Modules . Add ( newModule ) ;
97
+ mlapiModules . m_Modules . Add ( newModule ) ;
95
98
return true ;
96
99
}
97
100
0 commit comments