@@ -21,6 +21,7 @@ internal static class MLAPIProfilerModule
21
21
[ Serializable ]
22
22
private class MLAPIProfilerCounter
23
23
{
24
+ // Note: These fields are named this way for internal serialization
24
25
public string m_Name ;
25
26
public string m_Category ;
26
27
}
@@ -31,6 +32,7 @@ private class MLAPIProfilerCounter
31
32
[ Serializable ]
32
33
private class MLAPIProfilerModuleData
33
34
{
35
+ // Note: These fields are named this way for internal serialization
34
36
public List < MLAPIProfilerCounter > m_ChartCounters = new List < MLAPIProfilerCounter > ( ) ;
35
37
public List < MLAPIProfilerCounter > m_DetailCounters = new List < MLAPIProfilerCounter > ( ) ;
36
38
public string m_Name ;
@@ -39,33 +41,34 @@ private class MLAPIProfilerModuleData
39
41
[ Serializable ]
40
42
private class MLAPIModules
41
43
{
44
+ // Note: These fields are named this way for internal serialization
42
45
public List < MLAPIProfilerModuleData > m_Modules ;
43
46
}
44
47
45
48
private static List < MLAPIProfilerCounter > CreateRPCCounters ( ) => new List < MLAPIProfilerCounter > ( )
46
49
{
47
- new MLAPIProfilerCounter { m_Name = ProfilerConstants . NumberOfRPCsSent , m_Category = ProfilerCategory . Network . Name } ,
48
- new MLAPIProfilerCounter { m_Name = ProfilerConstants . NumberOfRPCsReceived , m_Category = ProfilerCategory . Network . Name } ,
49
- new MLAPIProfilerCounter { m_Name = ProfilerConstants . NumberOfRPCBatchesSent , m_Category = ProfilerCategory . Network . Name } ,
50
- new MLAPIProfilerCounter { m_Name = ProfilerConstants . NumberOfRPCBatchesReceived , m_Category = ProfilerCategory . Network . Name } ,
51
- new MLAPIProfilerCounter { m_Name = ProfilerConstants . NumberOfRPCQueueProcessed , m_Category = ProfilerCategory . Network . Name } ,
52
- new MLAPIProfilerCounter { m_Name = ProfilerConstants . NumberOfRPCsInQueueSize , m_Category = ProfilerCategory . Network . Name } ,
53
- new MLAPIProfilerCounter { m_Name = ProfilerConstants . NumberOfRPCsOutQueueSize , m_Category = ProfilerCategory . Network . Name } ,
50
+ new MLAPIProfilerCounter { m_Name = ProfilerConstants . RpcSent , m_Category = ProfilerCategory . Network . Name } ,
51
+ new MLAPIProfilerCounter { m_Name = ProfilerConstants . RpcReceived , m_Category = ProfilerCategory . Network . Name } ,
52
+ new MLAPIProfilerCounter { m_Name = ProfilerConstants . RpcBatchesSent , m_Category = ProfilerCategory . Network . Name } ,
53
+ new MLAPIProfilerCounter { m_Name = ProfilerConstants . RpcBatchesReceived , m_Category = ProfilerCategory . Network . Name } ,
54
+ new MLAPIProfilerCounter { m_Name = ProfilerConstants . RpcQueueProcessed , m_Category = ProfilerCategory . Network . Name } ,
55
+ new MLAPIProfilerCounter { m_Name = ProfilerConstants . RpcInQueueSize , m_Category = ProfilerCategory . Network . Name } ,
56
+ new MLAPIProfilerCounter { m_Name = ProfilerConstants . RpcOutQueueSize , m_Category = ProfilerCategory . Network . Name } ,
54
57
} ;
55
58
56
59
private static List < MLAPIProfilerCounter > CreateOperationsCounters ( ) => new List < MLAPIProfilerCounter > ( )
57
60
{
58
- new MLAPIProfilerCounter { m_Name = ProfilerConstants . NumberOfConnections , m_Category = ProfilerCategory . Network . Name } ,
61
+ new MLAPIProfilerCounter { m_Name = ProfilerConstants . Connections , m_Category = ProfilerCategory . Network . Name } ,
59
62
new MLAPIProfilerCounter { m_Name = ProfilerConstants . ReceiveTickRate , m_Category = ProfilerCategory . Network . Name } ,
60
63
} ;
61
64
62
65
private static List < MLAPIProfilerCounter > CreateMessagesCounters ( ) => new List < MLAPIProfilerCounter > ( )
63
66
{
64
- new MLAPIProfilerCounter { m_Name = ProfilerConstants . NumberOfNamedMessages , m_Category = ProfilerCategory . Network . Name } ,
65
- new MLAPIProfilerCounter { m_Name = ProfilerConstants . NumberOfUnnamedMessages , m_Category = ProfilerCategory . Network . Name } ,
66
- new MLAPIProfilerCounter { m_Name = ProfilerConstants . NumberBytesSent , m_Category = ProfilerCategory . Network . Name } ,
67
- new MLAPIProfilerCounter { m_Name = ProfilerConstants . NumberBytesReceived , m_Category = ProfilerCategory . Network . Name } ,
68
- new MLAPIProfilerCounter { m_Name = ProfilerConstants . NumberNetworkVarsReceived , m_Category = ProfilerCategory . Network . Name } ,
67
+ new MLAPIProfilerCounter { m_Name = ProfilerConstants . NamedMessageReceived , m_Category = ProfilerCategory . Network . Name } ,
68
+ new MLAPIProfilerCounter { m_Name = ProfilerConstants . UnnamedMessageReceived , m_Category = ProfilerCategory . Network . Name } ,
69
+ new MLAPIProfilerCounter { m_Name = ProfilerConstants . ByteSent , m_Category = ProfilerCategory . Network . Name } ,
70
+ new MLAPIProfilerCounter { m_Name = ProfilerConstants . ByteReceived , m_Category = ProfilerCategory . Network . Name } ,
71
+ new MLAPIProfilerCounter { m_Name = ProfilerConstants . NetworkVarReceived , m_Category = ProfilerCategory . Network . Name } ,
69
72
} ;
70
73
71
74
private delegate List < MLAPIProfilerCounter > CounterListFactoryDelegate ( ) ;
@@ -75,10 +78,10 @@ private static bool CreateMLAPIDynamicModule(ref MLAPIModules mlapiModules, stri
75
78
var module = mlapiModules . m_Modules . Find ( x => x . m_Name == moduleName ) ;
76
79
if ( module == null )
77
80
{
78
- var newModule = new MLAPIProfilerModuleData ( ) ;
79
- newModule . m_Name = moduleName ;
80
- newModule . m_ChartCounters = counterListFactoryDelegate ( ) ;
81
- newModule . m_DetailCounters = counterListFactoryDelegate ( ) ;
81
+ var newModule = new MLAPIProfilerModuleData
82
+ {
83
+ m_Name = moduleName , m_ChartCounters = counterListFactoryDelegate ( ) , m_DetailCounters = counterListFactoryDelegate ( ) ,
84
+ } ;
82
85
mlapiModules . m_Modules . Add ( newModule ) ;
83
86
return true ;
84
87
}
@@ -107,4 +110,4 @@ static MLAPIProfilerModule()
107
110
#endif
108
111
}
109
112
}
110
- }
113
+ }
0 commit comments