aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/SimStatsReporter.cs88
1 files changed, 44 insertions, 44 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs
index a150164..90a971f 100644
--- a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs
+++ b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs
@@ -97,12 +97,12 @@ namespace OpenSim.Region.Environment.Scenes
97 private int m_scriptLinesPerSecond = 0; 97 private int m_scriptLinesPerSecond = 0;
98 98
99 private int objectCapacity = 45000; 99 private int objectCapacity = 45000;
100 100
101 101
102 SimStatsPacket.StatBlock[] sb = new SimStatsPacket.StatBlock[21]; 102 SimStatsPacket.StatBlock[] sb = new SimStatsPacket.StatBlock[21];
103 SimStatsPacket.RegionBlock rb = new SimStatsPacket.RegionBlock(); 103 SimStatsPacket.RegionBlock rb = new SimStatsPacket.RegionBlock();
104 SimStatsPacket statpack = (SimStatsPacket)PacketPool.Instance.GetPacket(PacketType.SimStats); 104 SimStatsPacket statpack = (SimStatsPacket)PacketPool.Instance.GetPacket(PacketType.SimStats);
105 105
106 106
107 private RegionInfo ReportingRegion; 107 private RegionInfo ReportingRegion;
108 108
@@ -138,8 +138,8 @@ namespace OpenSim.Region.Environment.Scenes
138 lock (m_report) 138 lock (m_report)
139 { 139 {
140 // Packet is already initialized and ready for data insert 140 // Packet is already initialized and ready for data insert
141 141
142 142
143 statpack.Region = rb; 143 statpack.Region = rb;
144 statpack.Region.RegionX = ReportingRegion.RegionLocX; 144 statpack.Region.RegionX = ReportingRegion.RegionLocX;
145 statpack.Region.RegionY = ReportingRegion.RegionLocY; 145 statpack.Region.RegionY = ReportingRegion.RegionLocY;
@@ -152,99 +152,99 @@ namespace OpenSim.Region.Environment.Scenes
152 statpack.Region.RegionFlags = (uint) 0; 152 statpack.Region.RegionFlags = (uint) 0;
153 } 153 }
154 statpack.Region.ObjectCapacity = (uint) objectCapacity; 154 statpack.Region.ObjectCapacity = (uint) objectCapacity;
155 155
156#region various statistic googly moogly 156#region various statistic googly moogly
157 157
158 // Our FPS is actually 10fps, so multiplying by 5 to get the amount that people expect there 158 // Our FPS is actually 10fps, so multiplying by 5 to get the amount that people expect there
159 // 0-50 is pretty close to 0-45 159 // 0-50 is pretty close to 0-45
160 float simfps = (int) ((m_fps * 5)); 160 float simfps = (int) ((m_fps * 5));
161 161
162 //if (simfps > 45) 162 //if (simfps > 45)
163 //simfps = simfps - (simfps - 45); 163 //simfps = simfps - (simfps - 45);
164 //if (simfps < 0) 164 //if (simfps < 0)
165 //simfps = 0; 165 //simfps = 0;
166 166
167 // 167 //
168 float physfps = ((m_pfps / 1000)); 168 float physfps = ((m_pfps / 1000));
169 169
170 //if (physfps > 600) 170 //if (physfps > 600)
171 //physfps = physfps - (physfps - 600); 171 //physfps = physfps - (physfps - 600);
172 172
173 if (physfps < 0) 173 if (physfps < 0)
174 physfps = 0; 174 physfps = 0;
175 175
176#endregion 176#endregion
177 177
178 //Our time dilation is 0.91 when we're running a full speed, 178 //Our time dilation is 0.91 when we're running a full speed,
179 // therefore to make sure we get an appropriate range, 179 // therefore to make sure we get an appropriate range,
180 // we have to factor in our error. (0.10f * statsUpdateFactor) 180 // we have to factor in our error. (0.10f * statsUpdateFactor)
181 // multiplies the fix for the error times the amount of times it'll occur a second 181 // multiplies the fix for the error times the amount of times it'll occur a second
182 // / 10 divides the value by the number of times the sim heartbeat runs (10fps) 182 // / 10 divides the value by the number of times the sim heartbeat runs (10fps)
183 // Then we divide the whole amount by the amount of seconds pass in between stats updates. 183 // Then we divide the whole amount by the amount of seconds pass in between stats updates.
184 184
185 sb[0].StatID = (uint) Stats.TimeDilation; 185 sb[0].StatID = (uint) Stats.TimeDilation;
186 sb[0].StatValue = m_timeDilation ; //((((m_timeDilation + (0.10f * statsUpdateFactor)) /10) / statsUpdateFactor)); 186 sb[0].StatValue = m_timeDilation ; //((((m_timeDilation + (0.10f * statsUpdateFactor)) /10) / statsUpdateFactor));
187 187
188 sb[1].StatID = (uint) Stats.SimFPS; 188 sb[1].StatID = (uint) Stats.SimFPS;
189 sb[1].StatValue = simfps/statsUpdateFactor; 189 sb[1].StatValue = simfps/statsUpdateFactor;
190 190
191 sb[2].StatID = (uint) Stats.PhysicsFPS; 191 sb[2].StatID = (uint) Stats.PhysicsFPS;
192 sb[2].StatValue = physfps / statsUpdateFactor; 192 sb[2].StatValue = physfps / statsUpdateFactor;
193 193
194 sb[3].StatID = (uint) Stats.AgentUpdates; 194 sb[3].StatID = (uint) Stats.AgentUpdates;
195 sb[3].StatValue = (m_agentUpdates / statsUpdateFactor); 195 sb[3].StatValue = (m_agentUpdates / statsUpdateFactor);
196 196
197 sb[4].StatID = (uint) Stats.Agents; 197 sb[4].StatID = (uint) Stats.Agents;
198 sb[4].StatValue = m_rootAgents; 198 sb[4].StatValue = m_rootAgents;
199 199
200 sb[5].StatID = (uint) Stats.ChildAgents; 200 sb[5].StatID = (uint) Stats.ChildAgents;
201 sb[5].StatValue = m_childAgents; 201 sb[5].StatValue = m_childAgents;
202 202
203 sb[6].StatID = (uint) Stats.TotalPrim; 203 sb[6].StatID = (uint) Stats.TotalPrim;
204 sb[6].StatValue = m_numPrim; 204 sb[6].StatValue = m_numPrim;
205 205
206 sb[7].StatID = (uint) Stats.ActivePrim; 206 sb[7].StatID = (uint) Stats.ActivePrim;
207 sb[7].StatValue = m_activePrim; 207 sb[7].StatValue = m_activePrim;
208 208
209 sb[8].StatID = (uint)Stats.FrameMS; 209 sb[8].StatID = (uint)Stats.FrameMS;
210 sb[8].StatValue = m_frameMS / statsUpdateFactor; 210 sb[8].StatValue = m_frameMS / statsUpdateFactor;
211 211
212 sb[9].StatID = (uint)Stats.NetMS; 212 sb[9].StatID = (uint)Stats.NetMS;
213 sb[9].StatValue = m_netMS / statsUpdateFactor; 213 sb[9].StatValue = m_netMS / statsUpdateFactor;
214 214
215 sb[10].StatID = (uint)Stats.PhysicsMS; 215 sb[10].StatID = (uint)Stats.PhysicsMS;
216 sb[10].StatValue = m_physicsMS / statsUpdateFactor; 216 sb[10].StatValue = m_physicsMS / statsUpdateFactor;
217 217
218 sb[11].StatID = (uint)Stats.ImageMS ; 218 sb[11].StatID = (uint)Stats.ImageMS ;
219 sb[11].StatValue = m_imageMS / statsUpdateFactor; 219 sb[11].StatValue = m_imageMS / statsUpdateFactor;
220 220
221 sb[12].StatID = (uint)Stats.OtherMS; 221 sb[12].StatID = (uint)Stats.OtherMS;
222 sb[12].StatValue = m_otherMS / statsUpdateFactor; 222 sb[12].StatValue = m_otherMS / statsUpdateFactor;
223 223
224 sb[13].StatID = (uint)Stats.InPacketsPerSecond; 224 sb[13].StatID = (uint)Stats.InPacketsPerSecond;
225 sb[13].StatValue = (m_inPacketsPerSecond); 225 sb[13].StatValue = (m_inPacketsPerSecond);
226 226
227 sb[14].StatID = (uint)Stats.OutPacketsPerSecond; 227 sb[14].StatID = (uint)Stats.OutPacketsPerSecond;
228 sb[14].StatValue = (m_outPacketsPerSecond / statsUpdateFactor); 228 sb[14].StatValue = (m_outPacketsPerSecond / statsUpdateFactor);
229 229
230 sb[15].StatID = (uint)Stats.UnAckedBytes; 230 sb[15].StatID = (uint)Stats.UnAckedBytes;
231 sb[15].StatValue = m_unAckedBytes; 231 sb[15].StatValue = m_unAckedBytes;
232 232
233 sb[16].StatID = (uint)Stats.AgentMS; 233 sb[16].StatID = (uint)Stats.AgentMS;
234 sb[16].StatValue = m_agentMS / statsUpdateFactor; 234 sb[16].StatValue = m_agentMS / statsUpdateFactor;
235 235
236 sb[17].StatID = (uint)Stats.PendingDownloads; 236 sb[17].StatID = (uint)Stats.PendingDownloads;
237 sb[17].StatValue = m_pendingDownloads; 237 sb[17].StatValue = m_pendingDownloads;
238 238
239 sb[18].StatID = (uint)Stats.PendingUploads; 239 sb[18].StatID = (uint)Stats.PendingUploads;
240 sb[18].StatValue = m_pendingUploads; 240 sb[18].StatValue = m_pendingUploads;
241 241
242 sb[19].StatID = (uint)Stats.ActiveScripts; 242 sb[19].StatID = (uint)Stats.ActiveScripts;
243 sb[19].StatValue = m_activeScripts; 243 sb[19].StatValue = m_activeScripts;
244 244
245 sb[20].StatID = (uint)Stats.ScriptLinesPerSecond; 245 sb[20].StatID = (uint)Stats.ScriptLinesPerSecond;
246 sb[20].StatValue = m_scriptLinesPerSecond / statsUpdateFactor; 246 sb[20].StatValue = m_scriptLinesPerSecond / statsUpdateFactor;
247 247
248 statpack.Stat = sb; 248 statpack.Stat = sb;
249 249
250 handlerSendStatResult = OnSendStatsResult; 250 handlerSendStatResult = OnSendStatsResult;
@@ -255,7 +255,7 @@ namespace OpenSim.Region.Environment.Scenes
255 resetvalues(); 255 resetvalues();
256 } 256 }
257 } 257 }
258 258
259 private void resetvalues() 259 private void resetvalues()
260 { 260 {
261 m_timeDilation = 0; 261 m_timeDilation = 0;
@@ -274,13 +274,13 @@ namespace OpenSim.Region.Environment.Scenes
274 m_imageMS = 0; 274 m_imageMS = 0;
275 m_otherMS = 0; 275 m_otherMS = 0;
276 276
277//Ckrinke This variable is not used, so comment to remove compiler warning until it is used. 277//Ckrinke This variable is not used, so comment to remove compiler warning until it is used.
278//Ckrinke m_scriptMS = 0; 278//Ckrinke m_scriptMS = 0;
279 } 279 }
280 280
281 # region methods called from Scene 281 # region methods called from Scene
282 // The majority of these functions are additive 282 // The majority of these functions are additive
283 // so that you can easily change the amount of 283 // so that you can easily change the amount of
284 // seconds in between sim stats updates 284 // seconds in between sim stats updates
285 285
286 public void AddTimeDilation(float td) 286 public void AddTimeDilation(float td)
@@ -368,14 +368,14 @@ namespace OpenSim.Region.Environment.Scenes
368 { 368 {
369 m_otherMS += ms; 369 m_otherMS += ms;
370 } 370 }
371 371
372// private static readonly log4net.ILog m_log 372// private static readonly log4net.ILog m_log
373// = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 373// = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
374 374
375 public void addPendingDownload(int count) 375 public void addPendingDownload(int count)
376 { 376 {
377 m_pendingDownloads += count; 377 m_pendingDownloads += count;
378 //m_log.InfoFormat("[stats]: Adding {0} to pending downloads to make {1}", count, m_pendingDownloads); 378 //m_log.InfoFormat("[stats]: Adding {0} to pending downloads to make {1}", count, m_pendingDownloads);
379 } 379 }
380 380
381 public void addScriptLines(int count) 381 public void addScriptLines(int count)