diff options
Diffstat (limited to 'OpenSim/Region/ClientStack')
-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 a7628d2..72516cd 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | |||
@@ -278,25 +278,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
278 | m_shouldCollectStats = false; | 278 | m_shouldCollectStats = false; |
279 | if (config != null) | 279 | if (config != null) |
280 | { | 280 | { |
281 | if (config.Contains("enabled") && config.GetBoolean("enabled")) | 281 | m_shouldCollectStats = config.GetBoolean("Enabled", false); |
282 | { | 282 | binStatsMaxFilesize = TimeSpan.FromSeconds(config.GetInt("packet_headers_period_seconds", 300)); |
283 | if (config.Contains("collect_packet_headers")) | 283 | binStatsDir = config.GetString("stats_dir", "."); |
284 | m_shouldCollectStats = config.GetBoolean("collect_packet_headers"); | 284 | m_aggregatedBWStats = config.GetBoolean("aggregatedBWStats", false); |
285 | if (config.Contains("packet_headers_period_seconds")) | 285 | } |
286 | { | 286 | #endregion BinaryStats |
287 | binStatsMaxFilesize = TimeSpan.FromSeconds(config.GetInt("region_stats_period_seconds")); | ||
288 | } | ||
289 | if (config.Contains("stats_dir")) | ||
290 | { | ||
291 | binStatsDir = config.GetString("stats_dir"); | ||
292 | } | ||
293 | } | ||
294 | else | ||
295 | { | ||
296 | m_shouldCollectStats = false; | ||
297 | } | ||
298 | } | ||
299 | #endregion BinaryStats | ||
300 | 287 | ||
301 | m_throttle = new TokenBucket(null, sceneThrottleBps); | 288 | m_throttle = new TokenBucket(null, sceneThrottleBps); |
302 | ThrottleRates = new ThrottleRates(configSource); | 289 | ThrottleRates = new ThrottleRates(configSource); |
@@ -1266,8 +1253,34 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1266 | static object binStatsLogLock = new object(); | 1253 | static object binStatsLogLock = new object(); |
1267 | static string binStatsDir = ""; | 1254 | static string binStatsDir = ""; |
1268 | 1255 | ||
1256 | //for Aggregated In/Out BW logging | ||
1257 | static bool m_aggregatedBWStats = false; | ||
1258 | static long m_aggregatedBytesIn = 0; | ||
1259 | static long m_aggregatedByestOut = 0; | ||
1260 | static object aggBWStatsLock = new object(); | ||
1261 | |||
1262 | public static long AggregatedLLUDPBytesIn | ||
1263 | { | ||
1264 | get { return m_aggregatedBytesIn; } | ||
1265 | } | ||
1266 | public static long AggregatedLLUDPBytesOut | ||
1267 | { | ||
1268 | get {return m_aggregatedByestOut;} | ||
1269 | } | ||
1270 | |||
1269 | public static void LogPacketHeader(bool incoming, uint circuit, byte flags, PacketType packetType, ushort size) | 1271 | public static void LogPacketHeader(bool incoming, uint circuit, byte flags, PacketType packetType, ushort size) |
1270 | { | 1272 | { |
1273 | if (m_aggregatedBWStats) | ||
1274 | { | ||
1275 | lock (aggBWStatsLock) | ||
1276 | { | ||
1277 | if (incoming) | ||
1278 | m_aggregatedBytesIn += size; | ||
1279 | else | ||
1280 | m_aggregatedByestOut += size; | ||
1281 | } | ||
1282 | } | ||
1283 | |||
1271 | if (!m_shouldCollectStats) return; | 1284 | if (!m_shouldCollectStats) return; |
1272 | 1285 | ||
1273 | // Binary logging format is TTTTTTTTCCCCFPPPSS, T=Time, C=Circuit, F=Flags, P=PacketType, S=size | 1286 | // Binary logging format is TTTTTTTTCCCCFPPPSS, T=Time, C=Circuit, F=Flags, P=PacketType, S=size |