aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden
diff options
context:
space:
mode:
authorRobert Adams2013-03-15 13:59:34 -0700
committerRobert Adams2013-03-15 13:59:34 -0700
commitc10c43d6f6b0a79848b9a655533c27ab58cd2993 (patch)
tree43816d297304a155a2815ae48cc1b7452a94f62e /OpenSim/Region/ClientStack/Linden
parentAdd example code to DOExampleModule to pull data from that previously saved b... (diff)
downloadopensim-SC_OLD-c10c43d6f6b0a79848b9a655533c27ab58cd2993.zip
opensim-SC_OLD-c10c43d6f6b0a79848b9a655533c27ab58cd2993.tar.gz
opensim-SC_OLD-c10c43d6f6b0a79848b9a655533c27ab58cd2993.tar.bz2
opensim-SC_OLD-c10c43d6f6b0a79848b9a655533c27ab58cd2993.tar.xz
Fix server statistics always reporting zero for total network bytes in/out.
Clean up some parameter code in Statistics.Binary.
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs51
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