diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 51 |
1 files changed, 32 insertions, 19 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index df76396..4154ef2 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | |||
@@ -281,25 +281,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
281 | m_shouldCollectStats = false; | 281 | m_shouldCollectStats = false; |
282 | if (config != null) | 282 | if (config != null) |
283 | { | 283 | { |
284 | if (config.Contains("enabled") && config.GetBoolean("enabled")) | 284 | m_shouldCollectStats = config.GetBoolean("Enabled", false); |
285 | { | 285 | binStatsMaxFilesize = TimeSpan.FromSeconds(config.GetInt("packet_headers_period_seconds", 300)); |
286 | if (config.Contains("collect_packet_headers")) | 286 | binStatsDir = config.GetString("stats_dir", "."); |
287 | m_shouldCollectStats = config.GetBoolean("collect_packet_headers"); | 287 | m_aggregatedBWStats = config.GetBoolean("aggregatedBWStats", false); |
288 | if (config.Contains("packet_headers_period_seconds")) | 288 | } |
289 | { | 289 | #endregion BinaryStats |
290 | binStatsMaxFilesize = TimeSpan.FromSeconds(config.GetInt("region_stats_period_seconds")); | ||
291 | } | ||
292 | if (config.Contains("stats_dir")) | ||
293 | { | ||
294 | binStatsDir = config.GetString("stats_dir"); | ||
295 | } | ||
296 | } | ||
297 | else | ||
298 | { | ||
299 | m_shouldCollectStats = false; | ||
300 | } | ||
301 | } | ||
302 | #endregion BinaryStats | ||
303 | 290 | ||
304 | m_throttle = new TokenBucket(null, sceneThrottleBps); | 291 | m_throttle = new TokenBucket(null, sceneThrottleBps); |
305 | ThrottleRates = new ThrottleRates(configSource); | 292 | ThrottleRates = new ThrottleRates(configSource); |
@@ -1309,8 +1296,34 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1309 | static object binStatsLogLock = new object(); | 1296 | static object binStatsLogLock = new object(); |
1310 | static string binStatsDir = ""; | 1297 | static string binStatsDir = ""; |
1311 | 1298 | ||
1299 | //for Aggregated In/Out BW logging | ||
1300 | static bool m_aggregatedBWStats = false; | ||
1301 | static long m_aggregatedBytesIn = 0; | ||
1302 | static long m_aggregatedByestOut = 0; | ||
1303 | static object aggBWStatsLock = new object(); | ||
1304 | |||
1305 | public static long AggregatedLLUDPBytesIn | ||
1306 | { | ||
1307 | get { return m_aggregatedBytesIn; } | ||
1308 | } | ||
1309 | public static long AggregatedLLUDPBytesOut | ||
1310 | { | ||
1311 | get {return m_aggregatedByestOut;} | ||
1312 | } | ||
1313 | |||
1312 | public static void LogPacketHeader(bool incoming, uint circuit, byte flags, PacketType packetType, ushort size) | 1314 | public static void LogPacketHeader(bool incoming, uint circuit, byte flags, PacketType packetType, ushort size) |
1313 | { | 1315 | { |
1316 | if (m_aggregatedBWStats) | ||
1317 | { | ||
1318 | lock (aggBWStatsLock) | ||
1319 | { | ||
1320 | if (incoming) | ||
1321 | m_aggregatedBytesIn += size; | ||
1322 | else | ||
1323 | m_aggregatedByestOut += size; | ||
1324 | } | ||
1325 | } | ||
1326 | |||
1314 | if (!m_shouldCollectStats) return; | 1327 | if (!m_shouldCollectStats) return; |
1315 | 1328 | ||
1316 | // Binary logging format is TTTTTTTTCCCCFPPPSS, T=Time, C=Circuit, F=Flags, P=PacketType, S=size | 1329 | // Binary logging format is TTTTTTTTCCCCFPPPSS, T=Time, C=Circuit, F=Flags, P=PacketType, S=size |