aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorBlueWall2012-10-20 05:25:58 -0400
committerBlueWall2012-10-20 05:25:58 -0400
commit07f1d44174f5e2b4e3d5ffdec3619bb84f357af2 (patch)
tree83cc0442b2c1b89a5b3dd94cff23d5098415777e /OpenSim/Framework
parentMerge branch 'master' into connector_plugin (diff)
parentFix: invinite loading for Viewer3 : parcelinfo request of traffic-value (impl... (diff)
downloadopensim-SC_OLD-07f1d44174f5e2b4e3d5ffdec3619bb84f357af2.zip
opensim-SC_OLD-07f1d44174f5e2b4e3d5ffdec3619bb84f357af2.tar.gz
opensim-SC_OLD-07f1d44174f5e2b4e3d5ffdec3619bb84f357af2.tar.bz2
opensim-SC_OLD-07f1d44174f5e2b4e3d5ffdec3619bb84f357af2.tar.xz
Merge branch 'master' into connector_plugin
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Console/ConsoleUtil.cs4
-rw-r--r--OpenSim/Framework/IClientAPI.cs15
-rw-r--r--OpenSim/Framework/LandData.cs385
-rw-r--r--OpenSim/Framework/Monitoring/BaseStatsCollector.cs6
-rw-r--r--OpenSim/Framework/Monitoring/MemoryWatchdog.cs10
-rw-r--r--OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs16
-rw-r--r--OpenSim/Framework/Monitoring/StatsManager.cs204
-rw-r--r--OpenSim/Framework/Monitoring/Watchdog.cs20
-rw-r--r--OpenSim/Framework/Pool.cs76
-rw-r--r--OpenSim/Framework/Servers/BaseOpenSimServer.cs32
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs2
11 files changed, 586 insertions, 184 deletions
diff --git a/OpenSim/Framework/Console/ConsoleUtil.cs b/OpenSim/Framework/Console/ConsoleUtil.cs
index 2612a50..a7cf0c0 100644
--- a/OpenSim/Framework/Console/ConsoleUtil.cs
+++ b/OpenSim/Framework/Console/ConsoleUtil.cs
@@ -34,7 +34,7 @@ using OpenMetaverse;
34 34
35public class ConsoleUtil 35public class ConsoleUtil
36{ 36{
37 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 37// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
38 38
39 public const string MinRawConsoleVectorValue = "-~"; 39 public const string MinRawConsoleVectorValue = "-~";
40 public const string MaxRawConsoleVectorValue = "~"; 40 public const string MaxRawConsoleVectorValue = "~";
@@ -107,7 +107,7 @@ public class ConsoleUtil
107 107
108 string semiDigestedConsoleVector = string.Join(VectorSeparator, semiDigestedComponents.ToArray()); 108 string semiDigestedConsoleVector = string.Join(VectorSeparator, semiDigestedComponents.ToArray());
109 109
110 m_log.DebugFormat("[CONSOLE UTIL]: Parsing {0} into OpenMetaverse.Vector3", semiDigestedConsoleVector); 110// m_log.DebugFormat("[CONSOLE UTIL]: Parsing {0} into OpenMetaverse.Vector3", semiDigestedConsoleVector);
111 111
112 return Vector3.TryParse(semiDigestedConsoleVector, out vector); 112 return Vector3.TryParse(semiDigestedConsoleVector, out vector);
113 } 113 }
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 8a63bff..9856978 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -805,8 +805,23 @@ namespace OpenSim.Framework
805 event Action<IClientAPI> OnRegionHandShakeReply; 805 event Action<IClientAPI> OnRegionHandShakeReply;
806 event GenericCall1 OnRequestWearables; 806 event GenericCall1 OnRequestWearables;
807 event Action<IClientAPI, bool> OnCompleteMovementToRegion; 807 event Action<IClientAPI, bool> OnCompleteMovementToRegion;
808
809 /// <summary>
810 /// Called when an AgentUpdate message is received and before OnAgentUpdate.
811 /// </summary>
812 /// <remarks>
813 /// Listeners must not retain a reference to AgentUpdateArgs since this object may be reused for subsequent AgentUpdates.
814 /// </remarks>
808 event UpdateAgent OnPreAgentUpdate; 815 event UpdateAgent OnPreAgentUpdate;
816
817 /// <summary>
818 /// Called when an AgentUpdate message is received and after OnPreAgentUpdate.
819 /// </summary>
820 /// <remarks>
821 /// Listeners must not retain a reference to AgentUpdateArgs since this object may be reused for subsequent AgentUpdates.
822 /// </remarks>
809 event UpdateAgent OnAgentUpdate; 823 event UpdateAgent OnAgentUpdate;
824
810 event AgentRequestSit OnAgentRequestSit; 825 event AgentRequestSit OnAgentRequestSit;
811 event AgentSit OnAgentSit; 826 event AgentSit OnAgentSit;
812 event AvatarPickerRequest OnAvatarPickerRequest; 827 event AvatarPickerRequest OnAvatarPickerRequest;
diff --git a/OpenSim/Framework/LandData.cs b/OpenSim/Framework/LandData.cs
index bf2ecf2..fc02f33 100644
--- a/OpenSim/Framework/LandData.cs
+++ b/OpenSim/Framework/LandData.cs
@@ -49,8 +49,8 @@ namespace OpenSim.Framework
49 // use only one serializer to give the runtime a chance to 49 // use only one serializer to give the runtime a chance to
50 // optimize it (it won't do that if you use a new instance 50 // optimize it (it won't do that if you use a new instance
51 // every time) 51 // every time)
52 private static XmlSerializer serializer = new XmlSerializer(typeof (LandData)); 52 private static XmlSerializer serializer = new XmlSerializer(typeof(LandData));
53 53
54 private Vector3 _AABBMax = new Vector3(); 54 private Vector3 _AABBMax = new Vector3();
55 private Vector3 _AABBMin = new Vector3(); 55 private Vector3 _AABBMin = new Vector3();
56 private int _area = 0; 56 private int _area = 0;
@@ -65,11 +65,11 @@ namespace OpenSim.Framework
65 private byte[] _bitmap = new byte[512]; 65 private byte[] _bitmap = new byte[512];
66 private string _description = String.Empty; 66 private string _description = String.Empty;
67 67
68 private uint _flags = (uint) ParcelFlags.AllowFly | (uint) ParcelFlags.AllowLandmark | 68 private uint _flags = (uint)ParcelFlags.AllowFly | (uint)ParcelFlags.AllowLandmark |
69 (uint) ParcelFlags.AllowAPrimitiveEntry | 69 (uint)ParcelFlags.AllowAPrimitiveEntry |
70 (uint) ParcelFlags.AllowDeedToGroup | (uint) ParcelFlags.AllowTerraform | 70 (uint)ParcelFlags.AllowDeedToGroup | (uint)ParcelFlags.AllowTerraform |
71 (uint) ParcelFlags.CreateObjects | (uint) ParcelFlags.AllowOtherScripts | 71 (uint)ParcelFlags.CreateObjects | (uint)ParcelFlags.AllowOtherScripts |
72 (uint) ParcelFlags.SoundLocal | (uint) ParcelFlags.AllowVoiceChat; 72 (uint)ParcelFlags.SoundLocal | (uint)ParcelFlags.AllowVoiceChat;
73 73
74 private byte _landingType = 0; 74 private byte _landingType = 0;
75 private string _name = "Your Parcel"; 75 private string _name = "Your Parcel";
@@ -97,16 +97,36 @@ namespace OpenSim.Framework
97 private bool _mediaLoop = false; 97 private bool _mediaLoop = false;
98 private bool _obscureMusic = false; 98 private bool _obscureMusic = false;
99 private bool _obscureMedia = false; 99 private bool _obscureMedia = false;
100 private float _dwell = 0;
101
102 /// <summary>
103 /// Traffic count of parcel
104 /// </summary>
105 [XmlIgnore]
106 public float Dwell
107 {
108 get
109 {
110 return _dwell;
111 }
112 set
113 {
114 _dwell = value;
115 }
116 }
100 117
101 /// <summary> 118 /// <summary>
102 /// Whether to obscure parcel media URL 119 /// Whether to obscure parcel media URL
103 /// </summary> 120 /// </summary>
104 [XmlIgnore] 121 [XmlIgnore]
105 public bool ObscureMedia { 122 public bool ObscureMedia
106 get { 123 {
124 get
125 {
107 return _obscureMedia; 126 return _obscureMedia;
108 } 127 }
109 set { 128 set
129 {
110 _obscureMedia = value; 130 _obscureMedia = value;
111 } 131 }
112 } 132 }
@@ -115,11 +135,14 @@ namespace OpenSim.Framework
115 /// Whether to obscure parcel music URL 135 /// Whether to obscure parcel music URL
116 /// </summary> 136 /// </summary>
117 [XmlIgnore] 137 [XmlIgnore]
118 public bool ObscureMusic { 138 public bool ObscureMusic
119 get { 139 {
140 get
141 {
120 return _obscureMusic; 142 return _obscureMusic;
121 } 143 }
122 set { 144 set
145 {
123 _obscureMusic = value; 146 _obscureMusic = value;
124 } 147 }
125 } 148 }
@@ -128,11 +151,14 @@ namespace OpenSim.Framework
128 /// Whether to loop parcel media 151 /// Whether to loop parcel media
129 /// </summary> 152 /// </summary>
130 [XmlIgnore] 153 [XmlIgnore]
131 public bool MediaLoop { 154 public bool MediaLoop
132 get { 155 {
156 get
157 {
133 return _mediaLoop; 158 return _mediaLoop;
134 } 159 }
135 set { 160 set
161 {
136 _mediaLoop = value; 162 _mediaLoop = value;
137 } 163 }
138 } 164 }
@@ -141,11 +167,14 @@ namespace OpenSim.Framework
141 /// Height of parcel media render 167 /// Height of parcel media render
142 /// </summary> 168 /// </summary>
143 [XmlIgnore] 169 [XmlIgnore]
144 public int MediaHeight { 170 public int MediaHeight
145 get { 171 {
172 get
173 {
146 return _mediaHeight; 174 return _mediaHeight;
147 } 175 }
148 set { 176 set
177 {
149 _mediaHeight = value; 178 _mediaHeight = value;
150 } 179 }
151 } 180 }
@@ -154,11 +183,14 @@ namespace OpenSim.Framework
154 /// Width of parcel media render 183 /// Width of parcel media render
155 /// </summary> 184 /// </summary>
156 [XmlIgnore] 185 [XmlIgnore]
157 public int MediaWidth { 186 public int MediaWidth
158 get { 187 {
188 get
189 {
159 return _mediaWidth; 190 return _mediaWidth;
160 } 191 }
161 set { 192 set
193 {
162 _mediaWidth = value; 194 _mediaWidth = value;
163 } 195 }
164 } 196 }
@@ -167,11 +199,14 @@ namespace OpenSim.Framework
167 /// Upper corner of the AABB for the parcel 199 /// Upper corner of the AABB for the parcel
168 /// </summary> 200 /// </summary>
169 [XmlIgnore] 201 [XmlIgnore]
170 public Vector3 AABBMax { 202 public Vector3 AABBMax
171 get { 203 {
204 get
205 {
172 return _AABBMax; 206 return _AABBMax;
173 } 207 }
174 set { 208 set
209 {
175 _AABBMax = value; 210 _AABBMax = value;
176 } 211 }
177 } 212 }
@@ -179,11 +214,14 @@ namespace OpenSim.Framework
179 /// Lower corner of the AABB for the parcel 214 /// Lower corner of the AABB for the parcel
180 /// </summary> 215 /// </summary>
181 [XmlIgnore] 216 [XmlIgnore]
182 public Vector3 AABBMin { 217 public Vector3 AABBMin
183 get { 218 {
219 get
220 {
184 return _AABBMin; 221 return _AABBMin;
185 } 222 }
186 set { 223 set
224 {
187 _AABBMin = value; 225 _AABBMin = value;
188 } 226 }
189 } 227 }
@@ -191,11 +229,14 @@ namespace OpenSim.Framework
191 /// <summary> 229 /// <summary>
192 /// Area in meters^2 the parcel contains 230 /// Area in meters^2 the parcel contains
193 /// </summary> 231 /// </summary>
194 public int Area { 232 public int Area
195 get { 233 {
234 get
235 {
196 return _area; 236 return _area;
197 } 237 }
198 set { 238 set
239 {
199 _area = value; 240 _area = value;
200 } 241 }
201 } 242 }
@@ -203,11 +244,14 @@ namespace OpenSim.Framework
203 /// <summary> 244 /// <summary>
204 /// ID of auction (3rd Party Integration) when parcel is being auctioned 245 /// ID of auction (3rd Party Integration) when parcel is being auctioned
205 /// </summary> 246 /// </summary>
206 public uint AuctionID { 247 public uint AuctionID
207 get { 248 {
249 get
250 {
208 return _auctionID; 251 return _auctionID;
209 } 252 }
210 set { 253 set
254 {
211 _auctionID = value; 255 _auctionID = value;
212 } 256 }
213 } 257 }
@@ -215,11 +259,14 @@ namespace OpenSim.Framework
215 /// <summary> 259 /// <summary>
216 /// UUID of authorized buyer of parcel. This is UUID.Zero if anyone can buy it. 260 /// UUID of authorized buyer of parcel. This is UUID.Zero if anyone can buy it.
217 /// </summary> 261 /// </summary>
218 public UUID AuthBuyerID { 262 public UUID AuthBuyerID
219 get { 263 {
264 get
265 {
220 return _authBuyerID; 266 return _authBuyerID;
221 } 267 }
222 set { 268 set
269 {
223 _authBuyerID = value; 270 _authBuyerID = value;
224 } 271 }
225 } 272 }
@@ -227,11 +274,14 @@ namespace OpenSim.Framework
227 /// <summary> 274 /// <summary>
228 /// Category of parcel. Used for classifying the parcel in classified listings 275 /// Category of parcel. Used for classifying the parcel in classified listings
229 /// </summary> 276 /// </summary>
230 public ParcelCategory Category { 277 public ParcelCategory Category
231 get { 278 {
279 get
280 {
232 return _category; 281 return _category;
233 } 282 }
234 set { 283 set
284 {
235 _category = value; 285 _category = value;
236 } 286 }
237 } 287 }
@@ -239,11 +289,14 @@ namespace OpenSim.Framework
239 /// <summary> 289 /// <summary>
240 /// Date that the current owner purchased or claimed the parcel 290 /// Date that the current owner purchased or claimed the parcel
241 /// </summary> 291 /// </summary>
242 public int ClaimDate { 292 public int ClaimDate
243 get { 293 {
294 get
295 {
244 return _claimDate; 296 return _claimDate;
245 } 297 }
246 set { 298 set
299 {
247 _claimDate = value; 300 _claimDate = value;
248 } 301 }
249 } 302 }
@@ -251,11 +304,14 @@ namespace OpenSim.Framework
251 /// <summary> 304 /// <summary>
252 /// The last price that the parcel was sold at 305 /// The last price that the parcel was sold at
253 /// </summary> 306 /// </summary>
254 public int ClaimPrice { 307 public int ClaimPrice
255 get { 308 {
309 get
310 {
256 return _claimPrice; 311 return _claimPrice;
257 } 312 }
258 set { 313 set
314 {
259 _claimPrice = value; 315 _claimPrice = value;
260 } 316 }
261 } 317 }
@@ -263,11 +319,14 @@ namespace OpenSim.Framework
263 /// <summary> 319 /// <summary>
264 /// Global ID for the parcel. (3rd Party Integration) 320 /// Global ID for the parcel. (3rd Party Integration)
265 /// </summary> 321 /// </summary>
266 public UUID GlobalID { 322 public UUID GlobalID
267 get { 323 {
324 get
325 {
268 return _globalID; 326 return _globalID;
269 } 327 }
270 set { 328 set
329 {
271 _globalID = value; 330 _globalID = value;
272 } 331 }
273 } 332 }
@@ -275,11 +334,14 @@ namespace OpenSim.Framework
275 /// <summary> 334 /// <summary>
276 /// Unique ID of the Group that owns 335 /// Unique ID of the Group that owns
277 /// </summary> 336 /// </summary>
278 public UUID GroupID { 337 public UUID GroupID
279 get { 338 {
339 get
340 {
280 return _groupID; 341 return _groupID;
281 } 342 }
282 set { 343 set
344 {
283 _groupID = value; 345 _groupID = value;
284 } 346 }
285 } 347 }
@@ -287,11 +349,14 @@ namespace OpenSim.Framework
287 /// <summary> 349 /// <summary>
288 /// Returns true if the Land Parcel is owned by a group 350 /// Returns true if the Land Parcel is owned by a group
289 /// </summary> 351 /// </summary>
290 public bool IsGroupOwned { 352 public bool IsGroupOwned
291 get { 353 {
354 get
355 {
292 return _isGroupOwned; 356 return _isGroupOwned;
293 } 357 }
294 set { 358 set
359 {
295 _isGroupOwned = value; 360 _isGroupOwned = value;
296 } 361 }
297 } 362 }
@@ -299,11 +364,14 @@ namespace OpenSim.Framework
299 /// <summary> 364 /// <summary>
300 /// jp2 data for the image representative of the parcel in the parcel dialog 365 /// jp2 data for the image representative of the parcel in the parcel dialog
301 /// </summary> 366 /// </summary>
302 public byte[] Bitmap { 367 public byte[] Bitmap
303 get { 368 {
369 get
370 {
304 return _bitmap; 371 return _bitmap;
305 } 372 }
306 set { 373 set
374 {
307 _bitmap = value; 375 _bitmap = value;
308 } 376 }
309 } 377 }
@@ -311,11 +379,14 @@ namespace OpenSim.Framework
311 /// <summary> 379 /// <summary>
312 /// Parcel Description 380 /// Parcel Description
313 /// </summary> 381 /// </summary>
314 public string Description { 382 public string Description
315 get { 383 {
384 get
385 {
316 return _description; 386 return _description;
317 } 387 }
318 set { 388 set
389 {
319 _description = value; 390 _description = value;
320 } 391 }
321 } 392 }
@@ -323,11 +394,14 @@ namespace OpenSim.Framework
323 /// <summary> 394 /// <summary>
324 /// Parcel settings. Access flags, Fly, NoPush, Voice, Scripts allowed, etc. ParcelFlags 395 /// Parcel settings. Access flags, Fly, NoPush, Voice, Scripts allowed, etc. ParcelFlags
325 /// </summary> 396 /// </summary>
326 public uint Flags { 397 public uint Flags
327 get { 398 {
399 get
400 {
328 return _flags; 401 return _flags;
329 } 402 }
330 set { 403 set
404 {
331 _flags = value; 405 _flags = value;
332 } 406 }
333 } 407 }
@@ -336,11 +410,14 @@ namespace OpenSim.Framework
336 /// Determines if people are able to teleport where they please on the parcel or if they 410 /// Determines if people are able to teleport where they please on the parcel or if they
337 /// get constrainted to a specific point on teleport within the parcel 411 /// get constrainted to a specific point on teleport within the parcel
338 /// </summary> 412 /// </summary>
339 public byte LandingType { 413 public byte LandingType
340 get { 414 {
415 get
416 {
341 return _landingType; 417 return _landingType;
342 } 418 }
343 set { 419 set
420 {
344 _landingType = value; 421 _landingType = value;
345 } 422 }
346 } 423 }
@@ -348,11 +425,14 @@ namespace OpenSim.Framework
348 /// <summary> 425 /// <summary>
349 /// Parcel Name 426 /// Parcel Name
350 /// </summary> 427 /// </summary>
351 public string Name { 428 public string Name
352 get { 429 {
430 get
431 {
353 return _name; 432 return _name;
354 } 433 }
355 set { 434 set
435 {
356 _name = value; 436 _name = value;
357 } 437 }
358 } 438 }
@@ -360,11 +440,14 @@ namespace OpenSim.Framework
360 /// <summary> 440 /// <summary>
361 /// Status of Parcel, Leased, Abandoned, For Sale 441 /// Status of Parcel, Leased, Abandoned, For Sale
362 /// </summary> 442 /// </summary>
363 public ParcelStatus Status { 443 public ParcelStatus Status
364 get { 444 {
445 get
446 {
365 return _status; 447 return _status;
366 } 448 }
367 set { 449 set
450 {
368 _status = value; 451 _status = value;
369 } 452 }
370 } 453 }
@@ -372,11 +455,14 @@ namespace OpenSim.Framework
372 /// <summary> 455 /// <summary>
373 /// Internal ID of the parcel. Sometimes the client will try to use this value 456 /// Internal ID of the parcel. Sometimes the client will try to use this value
374 /// </summary> 457 /// </summary>
375 public int LocalID { 458 public int LocalID
376 get { 459 {
460 get
461 {
377 return _localID; 462 return _localID;
378 } 463 }
379 set { 464 set
465 {
380 _localID = value; 466 _localID = value;
381 } 467 }
382 } 468 }
@@ -384,11 +470,14 @@ namespace OpenSim.Framework
384 /// <summary> 470 /// <summary>
385 /// Determines if we scale the media based on the surface it's on 471 /// Determines if we scale the media based on the surface it's on
386 /// </summary> 472 /// </summary>
387 public byte MediaAutoScale { 473 public byte MediaAutoScale
388 get { 474 {
475 get
476 {
389 return _mediaAutoScale; 477 return _mediaAutoScale;
390 } 478 }
391 set { 479 set
480 {
392 _mediaAutoScale = value; 481 _mediaAutoScale = value;
393 } 482 }
394 } 483 }
@@ -396,11 +485,14 @@ namespace OpenSim.Framework
396 /// <summary> 485 /// <summary>
397 /// Texture Guid to replace with the output of the media stream 486 /// Texture Guid to replace with the output of the media stream
398 /// </summary> 487 /// </summary>
399 public UUID MediaID { 488 public UUID MediaID
400 get { 489 {
490 get
491 {
401 return _mediaID; 492 return _mediaID;
402 } 493 }
403 set { 494 set
495 {
404 _mediaID = value; 496 _mediaID = value;
405 } 497 }
406 } 498 }
@@ -408,11 +500,14 @@ namespace OpenSim.Framework
408 /// <summary> 500 /// <summary>
409 /// URL to the media file to display 501 /// URL to the media file to display
410 /// </summary> 502 /// </summary>
411 public string MediaURL { 503 public string MediaURL
412 get { 504 {
505 get
506 {
413 return _mediaURL; 507 return _mediaURL;
414 } 508 }
415 set { 509 set
510 {
416 _mediaURL = value; 511 _mediaURL = value;
417 } 512 }
418 } 513 }
@@ -432,11 +527,14 @@ namespace OpenSim.Framework
432 /// <summary> 527 /// <summary>
433 /// URL to the shoutcast music stream to play on the parcel 528 /// URL to the shoutcast music stream to play on the parcel
434 /// </summary> 529 /// </summary>
435 public string MusicURL { 530 public string MusicURL
436 get { 531 {
532 get
533 {
437 return _musicURL; 534 return _musicURL;
438 } 535 }
439 set { 536 set
537 {
440 _musicURL = value; 538 _musicURL = value;
441 } 539 }
442 } 540 }
@@ -445,11 +543,14 @@ namespace OpenSim.Framework
445 /// Owner Avatar or Group of the parcel. Naturally, all land masses must be 543 /// Owner Avatar or Group of the parcel. Naturally, all land masses must be
446 /// owned by someone 544 /// owned by someone
447 /// </summary> 545 /// </summary>
448 public UUID OwnerID { 546 public UUID OwnerID
449 get { 547 {
548 get
549 {
450 return _ownerID; 550 return _ownerID;
451 } 551 }
452 set { 552 set
553 {
453 _ownerID = value; 554 _ownerID = value;
454 } 555 }
455 } 556 }
@@ -457,11 +558,14 @@ namespace OpenSim.Framework
457 /// <summary> 558 /// <summary>
458 /// List of access data for the parcel. User data, some bitflags, and a time 559 /// List of access data for the parcel. User data, some bitflags, and a time
459 /// </summary> 560 /// </summary>
460 public List<LandAccessEntry> ParcelAccessList { 561 public List<LandAccessEntry> ParcelAccessList
461 get { 562 {
563 get
564 {
462 return _parcelAccessList; 565 return _parcelAccessList;
463 } 566 }
464 set { 567 set
568 {
465 _parcelAccessList = value; 569 _parcelAccessList = value;
466 } 570 }
467 } 571 }
@@ -469,11 +573,14 @@ namespace OpenSim.Framework
469 /// <summary> 573 /// <summary>
470 /// How long in hours a Pass to the parcel is given 574 /// How long in hours a Pass to the parcel is given
471 /// </summary> 575 /// </summary>
472 public float PassHours { 576 public float PassHours
473 get { 577 {
578 get
579 {
474 return _passHours; 580 return _passHours;
475 } 581 }
476 set { 582 set
583 {
477 _passHours = value; 584 _passHours = value;
478 } 585 }
479 } 586 }
@@ -481,11 +588,14 @@ namespace OpenSim.Framework
481 /// <summary> 588 /// <summary>
482 /// Price to purchase a Pass to a restricted parcel 589 /// Price to purchase a Pass to a restricted parcel
483 /// </summary> 590 /// </summary>
484 public int PassPrice { 591 public int PassPrice
485 get { 592 {
593 get
594 {
486 return _passPrice; 595 return _passPrice;
487 } 596 }
488 set { 597 set
598 {
489 _passPrice = value; 599 _passPrice = value;
490 } 600 }
491 } 601 }
@@ -493,11 +603,14 @@ namespace OpenSim.Framework
493 /// <summary> 603 /// <summary>
494 /// When the parcel is being sold, this is the price to purchase the parcel 604 /// When the parcel is being sold, this is the price to purchase the parcel
495 /// </summary> 605 /// </summary>
496 public int SalePrice { 606 public int SalePrice
497 get { 607 {
608 get
609 {
498 return _salePrice; 610 return _salePrice;
499 } 611 }
500 set { 612 set
613 {
501 _salePrice = value; 614 _salePrice = value;
502 } 615 }
503 } 616 }
@@ -506,11 +619,14 @@ namespace OpenSim.Framework
506 /// Number of meters^2 in the Simulator 619 /// Number of meters^2 in the Simulator
507 /// </summary> 620 /// </summary>
508 [XmlIgnore] 621 [XmlIgnore]
509 public int SimwideArea { 622 public int SimwideArea
510 get { 623 {
624 get
625 {
511 return _simwideArea; 626 return _simwideArea;
512 } 627 }
513 set { 628 set
629 {
514 _simwideArea = value; 630 _simwideArea = value;
515 } 631 }
516 } 632 }
@@ -519,11 +635,14 @@ namespace OpenSim.Framework
519 /// Number of SceneObjectPart in the Simulator 635 /// Number of SceneObjectPart in the Simulator
520 /// </summary> 636 /// </summary>
521 [XmlIgnore] 637 [XmlIgnore]
522 public int SimwidePrims { 638 public int SimwidePrims
523 get { 639 {
640 get
641 {
524 return _simwidePrims; 642 return _simwidePrims;
525 } 643 }
526 set { 644 set
645 {
527 _simwidePrims = value; 646 _simwidePrims = value;
528 } 647 }
529 } 648 }
@@ -531,11 +650,14 @@ namespace OpenSim.Framework
531 /// <summary> 650 /// <summary>
532 /// ID of the snapshot used in the client parcel dialog of the parcel 651 /// ID of the snapshot used in the client parcel dialog of the parcel
533 /// </summary> 652 /// </summary>
534 public UUID SnapshotID { 653 public UUID SnapshotID
535 get { 654 {
655 get
656 {
536 return _snapshotID; 657 return _snapshotID;
537 } 658 }
538 set { 659 set
660 {
539 _snapshotID = value; 661 _snapshotID = value;
540 } 662 }
541 } 663 }
@@ -544,11 +666,14 @@ namespace OpenSim.Framework
544 /// When teleporting is restricted to a certain point, this is the location 666 /// When teleporting is restricted to a certain point, this is the location
545 /// that the user will be redirected to 667 /// that the user will be redirected to
546 /// </summary> 668 /// </summary>
547 public Vector3 UserLocation { 669 public Vector3 UserLocation
548 get { 670 {
671 get
672 {
549 return _userLocation; 673 return _userLocation;
550 } 674 }
551 set { 675 set
676 {
552 _userLocation = value; 677 _userLocation = value;
553 } 678 }
554 } 679 }
@@ -557,11 +682,14 @@ namespace OpenSim.Framework
557 /// When teleporting is restricted to a certain point, this is the rotation 682 /// When teleporting is restricted to a certain point, this is the rotation
558 /// that the user will be positioned 683 /// that the user will be positioned
559 /// </summary> 684 /// </summary>
560 public Vector3 UserLookAt { 685 public Vector3 UserLookAt
561 get { 686 {
687 get
688 {
562 return _userLookAt; 689 return _userLookAt;
563 } 690 }
564 set { 691 set
692 {
565 _userLookAt = value; 693 _userLookAt = value;
566 } 694 }
567 } 695 }
@@ -570,11 +698,14 @@ namespace OpenSim.Framework
570 /// Autoreturn number of minutes to return SceneObjectGroup that are owned by someone who doesn't own 698 /// Autoreturn number of minutes to return SceneObjectGroup that are owned by someone who doesn't own
571 /// the parcel and isn't set to the same 'group' as the parcel. 699 /// the parcel and isn't set to the same 'group' as the parcel.
572 /// </summary> 700 /// </summary>
573 public int OtherCleanTime { 701 public int OtherCleanTime
574 get { 702 {
703 get
704 {
575 return _otherCleanTime; 705 return _otherCleanTime;
576 } 706 }
577 set { 707 set
708 {
578 _otherCleanTime = value; 709 _otherCleanTime = value;
579 } 710 }
580 } 711 }
@@ -582,11 +713,14 @@ namespace OpenSim.Framework
582 /// <summary> 713 /// <summary>
583 /// parcel media description 714 /// parcel media description
584 /// </summary> 715 /// </summary>
585 public string MediaDescription { 716 public string MediaDescription
586 get { 717 {
718 get
719 {
587 return _mediaDescription; 720 return _mediaDescription;
588 } 721 }
589 set { 722 set
723 {
590 _mediaDescription = value; 724 _mediaDescription = value;
591 } 725 }
592 } 726 }
@@ -622,7 +756,7 @@ namespace OpenSim.Framework
622 landData._mediaURL = _mediaURL; 756 landData._mediaURL = _mediaURL;
623 landData._musicURL = _musicURL; 757 landData._musicURL = _musicURL;
624 landData._ownerID = _ownerID; 758 landData._ownerID = _ownerID;
625 landData._bitmap = (byte[]) _bitmap.Clone(); 759 landData._bitmap = (byte[])_bitmap.Clone();
626 landData._description = _description; 760 landData._description = _description;
627 landData._flags = _flags; 761 landData._flags = _flags;
628 landData._name = _name; 762 landData._name = _name;
@@ -643,6 +777,7 @@ namespace OpenSim.Framework
643 landData._obscureMedia = _obscureMedia; 777 landData._obscureMedia = _obscureMedia;
644 landData._simwideArea = _simwideArea; 778 landData._simwideArea = _simwideArea;
645 landData._simwidePrims = _simwidePrims; 779 landData._simwidePrims = _simwidePrims;
780 landData._dwell = _dwell;
646 781
647 landData._parcelAccessList.Clear(); 782 landData._parcelAccessList.Clear();
648 foreach (LandAccessEntry entry in _parcelAccessList) 783 foreach (LandAccessEntry entry in _parcelAccessList)
diff --git a/OpenSim/Framework/Monitoring/BaseStatsCollector.cs b/OpenSim/Framework/Monitoring/BaseStatsCollector.cs
index 57a63ef..2903b6e 100644
--- a/OpenSim/Framework/Monitoring/BaseStatsCollector.cs
+++ b/OpenSim/Framework/Monitoring/BaseStatsCollector.cs
@@ -49,7 +49,11 @@ namespace OpenSim.Framework.Monitoring
49 Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0)); 49 Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0));
50 50
51 sb.AppendFormat( 51 sb.AppendFormat(
52 "OpenSim object memory churn : {0} MB/s\n", 52 "OpenSim last object memory churn : {0} MB/s\n",
53 Math.Round((MemoryWatchdog.LastMemoryChurn * 1000) / 1024.0 / 1024, 3));
54
55 sb.AppendFormat(
56 "OpenSim average object memory churn : {0} MB/s\n",
53 Math.Round((MemoryWatchdog.AverageMemoryChurn * 1000) / 1024.0 / 1024, 3)); 57 Math.Round((MemoryWatchdog.AverageMemoryChurn * 1000) / 1024.0 / 1024, 3));
54 58
55 sb.AppendFormat( 59 sb.AppendFormat(
diff --git a/OpenSim/Framework/Monitoring/MemoryWatchdog.cs b/OpenSim/Framework/Monitoring/MemoryWatchdog.cs
index a23cf1f..c6010cd 100644
--- a/OpenSim/Framework/Monitoring/MemoryWatchdog.cs
+++ b/OpenSim/Framework/Monitoring/MemoryWatchdog.cs
@@ -60,7 +60,7 @@ namespace OpenSim.Framework.Monitoring
60 private static bool m_enabled; 60 private static bool m_enabled;
61 61
62 /// <summary> 62 /// <summary>
63 /// Average memory churn in bytes per millisecond. 63 /// Last memory churn in bytes per millisecond.
64 /// </summary> 64 /// </summary>
65 public static double AverageMemoryChurn 65 public static double AverageMemoryChurn
66 { 66 {
@@ -68,6 +68,14 @@ namespace OpenSim.Framework.Monitoring
68 } 68 }
69 69
70 /// <summary> 70 /// <summary>
71 /// Average memory churn in bytes per millisecond.
72 /// </summary>
73 public static double LastMemoryChurn
74 {
75 get { if (m_samples.Count > 0) return m_samples.Last(); else return 0; }
76 }
77
78 /// <summary>
71 /// Maximum number of statistical samples. 79 /// Maximum number of statistical samples.
72 /// </summary> 80 /// </summary>
73 /// <remarks> 81 /// <remarks>
diff --git a/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs b/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs
index 8ac9090..aa86202 100644
--- a/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs
+++ b/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs
@@ -359,13 +359,19 @@ Asset service request failures: {3}" + Environment.NewLine,
359 inPacketsPerSecond, outPacketsPerSecond, pendingDownloads, pendingUploads, unackedBytes, totalFrameTime, 359 inPacketsPerSecond, outPacketsPerSecond, pendingDownloads, pendingUploads, unackedBytes, totalFrameTime,
360 netFrameTime, physicsFrameTime, otherFrameTime, agentFrameTime, imageFrameTime)); 360 netFrameTime, physicsFrameTime, otherFrameTime, agentFrameTime, imageFrameTime));
361 361
362 foreach (KeyValuePair<string, Stat> kvp in StatsManager.RegisteredStats) 362 Dictionary<string, Dictionary<string, Stat>> sceneStats;
363 {
364 Stat stat = kvp.Value;
365 363
366 if (stat.Category == "scene" && stat.Verbosity == StatVerbosity.Info) 364 if (StatsManager.TryGetStats("scene", out sceneStats))
365 {
366 foreach (KeyValuePair<string, Dictionary<string, Stat>> kvp in sceneStats)
367 { 367 {
368 sb.AppendFormat("Slow frames ({0}): {1}\n", stat.Container, stat.Value); 368 foreach (Stat stat in kvp.Value.Values)
369 {
370 if (stat.Verbosity == StatVerbosity.Info)
371 {
372 sb.AppendFormat("{0} ({1}): {2}{3}\n", stat.Name, stat.Container, stat.Value, stat.UnitName);
373 }
374 }
369 } 375 }
370 } 376 }
371 377
diff --git a/OpenSim/Framework/Monitoring/StatsManager.cs b/OpenSim/Framework/Monitoring/StatsManager.cs
index b5dc24f..31989e5 100644
--- a/OpenSim/Framework/Monitoring/StatsManager.cs
+++ b/OpenSim/Framework/Monitoring/StatsManager.cs
@@ -35,13 +35,23 @@ namespace OpenSim.Framework.Monitoring
35 /// </summary> 35 /// </summary>
36 public class StatsManager 36 public class StatsManager
37 { 37 {
38 // Subcommand used to list other stats.
39 public const string AllSubCommand = "all";
40
41 // Subcommand used to list other stats.
42 public const string ListSubCommand = "list";
43
44 // All subcommands
45 public static HashSet<string> SubCommands = new HashSet<string> { AllSubCommand, ListSubCommand };
46
38 /// <summary> 47 /// <summary>
39 /// Registered stats. 48 /// Registered stats categorized by category/container/shortname
40 /// </summary> 49 /// </summary>
41 /// <remarks> 50 /// <remarks>
42 /// Do not add or remove from this dictionary. 51 /// Do not add or remove directly from this dictionary.
43 /// </remarks> 52 /// </remarks>
44 public static Dictionary<string, Stat> RegisteredStats = new Dictionary<string, Stat>(); 53 public static Dictionary<string, Dictionary<string, Dictionary<string, Stat>>> RegisteredStats
54 = new Dictionary<string, Dictionary<string, Dictionary<string, Stat>>>();
45 55
46 private static AssetStatsCollector assetStats; 56 private static AssetStatsCollector assetStats;
47 private static UserStatsCollector userStats; 57 private static UserStatsCollector userStats;
@@ -51,6 +61,75 @@ namespace OpenSim.Framework.Monitoring
51 public static UserStatsCollector UserStats { get { return userStats; } } 61 public static UserStatsCollector UserStats { get { return userStats; } }
52 public static SimExtraStatsCollector SimExtraStats { get { return simExtraStats; } } 62 public static SimExtraStatsCollector SimExtraStats { get { return simExtraStats; } }
53 63
64 public static void RegisterConsoleCommands(ICommandConsole console)
65 {
66 console.Commands.AddCommand(
67 "General",
68 false,
69 "show stats",
70 "show stats [list|all|<category>]",
71 "Show statistical information for this server",
72 "If no final argument is specified then legacy statistics information is currently shown.\n"
73 + "If list is specified then statistic categories are shown.\n"
74 + "If all is specified then all registered statistics are shown.\n"
75 + "If a category name is specified then only statistics from that category are shown.\n"
76 + "THIS STATS FACILITY IS EXPERIMENTAL AND DOES NOT YET CONTAIN ALL STATS",
77 HandleShowStatsCommand);
78 }
79
80 public static void HandleShowStatsCommand(string module, string[] cmd)
81 {
82 ICommandConsole con = MainConsole.Instance;
83
84 if (cmd.Length > 2)
85 {
86 var categoryName = cmd[2];
87
88 if (categoryName == AllSubCommand)
89 {
90 foreach (var category in RegisteredStats.Values)
91 {
92 OutputCategoryStatsToConsole(con, category);
93 }
94 }
95 else if (categoryName == ListSubCommand)
96 {
97 con.Output("Statistic categories available are:");
98 foreach (string category in RegisteredStats.Keys)
99 con.OutputFormat(" {0}", category);
100 }
101 else
102 {
103 Dictionary<string, Dictionary<string, Stat>> category;
104 if (!RegisteredStats.TryGetValue(categoryName, out category))
105 {
106 con.OutputFormat("No such category as {0}", categoryName);
107 }
108 else
109 {
110 OutputCategoryStatsToConsole(con, category);
111 }
112 }
113 }
114 else
115 {
116 // Legacy
117 con.Output(SimExtraStats.Report());
118 }
119 }
120
121 private static void OutputCategoryStatsToConsole(
122 ICommandConsole con, Dictionary<string, Dictionary<string, Stat>> category)
123 {
124 foreach (var container in category.Values)
125 {
126 foreach (Stat stat in container.Values)
127 {
128 con.Output(stat.ToConsoleString());
129 }
130 }
131 }
132
54 /// <summary> 133 /// <summary>
55 /// Start collecting statistics related to assets. 134 /// Start collecting statistics related to assets.
56 /// Should only be called once. 135 /// Should only be called once.
@@ -73,43 +152,100 @@ namespace OpenSim.Framework.Monitoring
73 return userStats; 152 return userStats;
74 } 153 }
75 154
155 /// <summary>
156 /// Registers a statistic.
157 /// </summary>
158 /// <param name='stat'></param>
159 /// <returns></returns>
76 public static bool RegisterStat(Stat stat) 160 public static bool RegisterStat(Stat stat)
77 { 161 {
162 Dictionary<string, Dictionary<string, Stat>> category = null, newCategory;
163 Dictionary<string, Stat> container = null, newContainer;
164
78 lock (RegisteredStats) 165 lock (RegisteredStats)
79 { 166 {
80 if (RegisteredStats.ContainsKey(stat.UniqueName)) 167 // Stat name is not unique across category/container/shortname key.
81 { 168 // XXX: For now just return false. This is to avoid problems in regression tests where all tests
82 // XXX: For now just return false. This is to avoid problems in regression tests where all tests 169 // in a class are run in the same instance of the VM.
83 // in a class are run in the same instance of the VM. 170 if (TryGetStat(stat, out category, out container))
84 return false; 171 return false;
85 172
86// throw new Exception( 173 // We take a copy-on-write approach here of replacing dictionaries when keys are added or removed.
87// "StatsManager already contains stat with ShortName {0} in Category {1}", stat.ShortName, stat.Category); 174 // This means that we don't need to lock or copy them on iteration, which will be a much more
88 } 175 // common operation after startup.
176 if (container != null)
177 newContainer = new Dictionary<string, Stat>(container);
178 else
179 newContainer = new Dictionary<string, Stat>();
89 180
90 // We take a replace-on-write approach here so that we don't need to generate a new Dictionary 181 if (category != null)
91 Dictionary<string, Stat> newRegisteredStats = new Dictionary<string, Stat>(RegisteredStats); 182 newCategory = new Dictionary<string, Dictionary<string, Stat>>(category);
92 newRegisteredStats[stat.UniqueName] = stat; 183 else
93 RegisteredStats = newRegisteredStats; 184 newCategory = new Dictionary<string, Dictionary<string, Stat>>();
185
186 newContainer[stat.ShortName] = stat;
187 newCategory[stat.Container] = newContainer;
188 RegisteredStats[stat.Category] = newCategory;
94 } 189 }
95 190
96 return true; 191 return true;
97 } 192 }
98 193
194 /// <summary>
195 /// Deregister a statistic
196 /// </summary>>
197 /// <param name='stat'></param>
198 /// <returns></returns
99 public static bool DeregisterStat(Stat stat) 199 public static bool DeregisterStat(Stat stat)
100 { 200 {
201 Dictionary<string, Dictionary<string, Stat>> category = null, newCategory;
202 Dictionary<string, Stat> container = null, newContainer;
203
101 lock (RegisteredStats) 204 lock (RegisteredStats)
102 { 205 {
103 if (!RegisteredStats.ContainsKey(stat.UniqueName)) 206 if (!TryGetStat(stat, out category, out container))
104 return false; 207 return false;
105 208
106 Dictionary<string, Stat> newRegisteredStats = new Dictionary<string, Stat>(RegisteredStats); 209 newContainer = new Dictionary<string, Stat>(container);
107 newRegisteredStats.Remove(stat.UniqueName); 210 newContainer.Remove(stat.UniqueName);
108 RegisteredStats = newRegisteredStats; 211
212 newCategory = new Dictionary<string, Dictionary<string, Stat>>(category);
213 newCategory.Remove(stat.Container);
214
215 newCategory[stat.Container] = newContainer;
216 RegisteredStats[stat.Category] = newCategory;
109 217
110 return true; 218 return true;
111 } 219 }
112 } 220 }
221
222 public static bool TryGetStats(string category, out Dictionary<string, Dictionary<string, Stat>> stats)
223 {
224 return RegisteredStats.TryGetValue(category, out stats);
225 }
226
227 public static bool TryGetStat(
228 Stat stat,
229 out Dictionary<string, Dictionary<string, Stat>> category,
230 out Dictionary<string, Stat> container)
231 {
232 category = null;
233 container = null;
234
235 lock (RegisteredStats)
236 {
237 if (RegisteredStats.TryGetValue(stat.Category, out category))
238 {
239 if (category.TryGetValue(stat.Container, out container))
240 {
241 if (container.ContainsKey(stat.ShortName))
242 return true;
243 }
244 }
245 }
246
247 return false;
248 }
113 } 249 }
114 250
115 /// <summary> 251 /// <summary>
@@ -157,9 +293,26 @@ namespace OpenSim.Framework.Monitoring
157 293
158 public virtual double Value { get; set; } 294 public virtual double Value { get; set; }
159 295
296 /// <summary>
297 /// Constructor
298 /// </summary>
299 /// <param name='shortName'>Short name for the stat. Must not contain spaces. e.g. "LongFrames"</param>
300 /// <param name='name'>Human readable name for the stat. e.g. "Long frames"</param>
301 /// <param name='unitName'>
302 /// Unit name for the stat. Should be preceeded by a space if the unit name isn't normally appeneded immediately to the value.
303 /// e.g. " frames"
304 /// </param>
305 /// <param name='category'>Category under which this stat should appear, e.g. "scene". Do not capitalize.</param>
306 /// <param name='container'>Entity to which this stat relates. e.g. scene name if this is a per scene stat.</param>
307 /// <param name='verbosity'>Verbosity of stat. Controls whether it will appear in short stat display or only full display.</param>
308 /// <param name='description'>Description of stat</param>
160 public Stat( 309 public Stat(
161 string shortName, string name, string unitName, string category, string container, StatVerbosity verbosity, string description) 310 string shortName, string name, string unitName, string category, string container, StatVerbosity verbosity, string description)
162 { 311 {
312 if (StatsManager.SubCommands.Contains(category))
313 throw new Exception(
314 string.Format("Stat cannot be in category '{0}' since this is reserved for a subcommand", category));
315
163 ShortName = shortName; 316 ShortName = shortName;
164 Name = name; 317 Name = name;
165 UnitName = unitName; 318 UnitName = unitName;
@@ -175,6 +328,12 @@ namespace OpenSim.Framework.Monitoring
175 { 328 {
176 return string.Format("{0}+{1}+{2}", container, category, shortName); 329 return string.Format("{0}+{1}+{2}", container, category, shortName);
177 } 330 }
331
332 public virtual string ToConsoleString()
333 {
334 return string.Format(
335 "{0}.{1}.{2} : {3}{4}", Category, Container, ShortName, Value, UnitName);
336 }
178 } 337 }
179 338
180 public class PercentageStat : Stat 339 public class PercentageStat : Stat
@@ -192,7 +351,7 @@ namespace OpenSim.Framework.Monitoring
192 if (c == 0) 351 if (c == 0)
193 return 0; 352 return 0;
194 353
195 return (double)Antecedent / c; 354 return (double)Antecedent / c * 100;
196 } 355 }
197 356
198 set 357 set
@@ -203,8 +362,13 @@ namespace OpenSim.Framework.Monitoring
203 362
204 public PercentageStat( 363 public PercentageStat(
205 string shortName, string name, string category, string container, StatVerbosity verbosity, string description) 364 string shortName, string name, string category, string container, StatVerbosity verbosity, string description)
206 : base(shortName, name, " %", category, container, verbosity, description) 365 : base(shortName, name, "%", category, container, verbosity, description) {}
366
367 public override string ToConsoleString()
207 { 368 {
369 return string.Format(
370 "{0}.{1}.{2} : {3:0.##}{4} ({5}/{6})",
371 Category, Container, ShortName, Value, UnitName, Antecedent, Consequent);
208 } 372 }
209 } 373 }
210} \ No newline at end of file 374} \ No newline at end of file
diff --git a/OpenSim/Framework/Monitoring/Watchdog.cs b/OpenSim/Framework/Monitoring/Watchdog.cs
index 7964f28..a20326d 100644
--- a/OpenSim/Framework/Monitoring/Watchdog.cs
+++ b/OpenSim/Framework/Monitoring/Watchdog.cs
@@ -231,7 +231,25 @@ namespace OpenSim.Framework.Monitoring
231 private static bool RemoveThread(int threadID) 231 private static bool RemoveThread(int threadID)
232 { 232 {
233 lock (m_threads) 233 lock (m_threads)
234 return m_threads.Remove(threadID); 234 {
235 ThreadWatchdogInfo twi;
236 if (m_threads.TryGetValue(threadID, out twi))
237 {
238 m_log.DebugFormat(
239 "[WATCHDOG]: Removing thread {0}, ID {1}", twi.Thread.Name, twi.Thread.ManagedThreadId);
240
241 m_threads.Remove(threadID);
242
243 return true;
244 }
245 else
246 {
247 m_log.WarnFormat(
248 "[WATCHDOG]: Requested to remove thread with ID {0} but this is not being monitored", threadID);
249
250 return false;
251 }
252 }
235 } 253 }
236 254
237 public static bool AbortThread(int threadID) 255 public static bool AbortThread(int threadID)
diff --git a/OpenSim/Framework/Pool.cs b/OpenSim/Framework/Pool.cs
new file mode 100644
index 0000000..1ca06c3
--- /dev/null
+++ b/OpenSim/Framework/Pool.cs
@@ -0,0 +1,76 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30
31namespace OpenSim.Framework
32{
33 /// <summary>
34 /// Naive pool implementation.
35 /// </summary>
36 /// <remarks>
37 /// Currently assumes that objects are in a useable state when returned.
38 /// </remarks>
39 public class Pool<T>
40 {
41 private Stack<T> m_pool;
42
43 private int m_maxPoolSize;
44
45 private Func<T> m_createFunction;
46
47 public Pool(Func<T> createFunction, int maxSize)
48 {
49 m_maxPoolSize = maxSize;
50 m_createFunction = createFunction;
51 m_pool = new Stack<T>(m_maxPoolSize);
52 }
53
54 public T GetObject()
55 {
56 lock (m_pool)
57 {
58 if (m_pool.Count > 0)
59 return m_pool.Pop();
60 else
61 return m_createFunction();
62 }
63 }
64
65 public void ReturnObject(T obj)
66 {
67 lock (m_pool)
68 {
69 if (m_pool.Count >= m_maxPoolSize)
70 return;
71 else
72 m_pool.Push(obj);
73 }
74 }
75 }
76} \ No newline at end of file
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index 7a5c16d..aac9c45 100644
--- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs
+++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
@@ -96,11 +96,6 @@ namespace OpenSim.Framework.Servers
96 get { return m_httpServer; } 96 get { return m_httpServer; }
97 } 97 }
98 98
99 /// <summary>
100 /// Holds the non-viewer statistics collection object for this service/server
101 /// </summary>
102 protected IStatsCollector m_stats;
103
104 public BaseOpenSimServer() 99 public BaseOpenSimServer()
105 { 100 {
106 m_startuptime = DateTime.Now; 101 m_startuptime = DateTime.Now;
@@ -177,10 +172,6 @@ namespace OpenSim.Framework.Servers
177 "show info", 172 "show info",
178 "Show general information about the server", HandleShow); 173 "Show general information about the server", HandleShow);
179 174
180 m_console.Commands.AddCommand("General", false, "show stats",
181 "show stats",
182 "Show statistics", HandleShow);
183
184 m_console.Commands.AddCommand("General", false, "show threads", 175 m_console.Commands.AddCommand("General", false, "show threads",
185 "show threads", 176 "show threads",
186 "Show thread status", HandleShow); 177 "Show thread status", HandleShow);
@@ -226,12 +217,7 @@ namespace OpenSim.Framework.Servers
226 { 217 {
227 StringBuilder sb = new StringBuilder("DIAGNOSTICS\n\n"); 218 StringBuilder sb = new StringBuilder("DIAGNOSTICS\n\n");
228 sb.Append(GetUptimeReport()); 219 sb.Append(GetUptimeReport());
229 220 sb.Append(StatsManager.SimExtraStats.Report());
230 if (m_stats != null)
231 {
232 sb.Append(m_stats.Report());
233 }
234
235 sb.Append(Environment.NewLine); 221 sb.Append(Environment.NewLine);
236 sb.Append(GetThreadsReport()); 222 sb.Append(GetThreadsReport());
237 223
@@ -382,10 +368,6 @@ namespace OpenSim.Framework.Servers
382 { 368 {
383 Notice("set log level [level] - change the console logging level only. For example, off or debug."); 369 Notice("set log level [level] - change the console logging level only. For example, off or debug.");
384 Notice("show info - show server information (e.g. startup path)."); 370 Notice("show info - show server information (e.g. startup path).");
385
386 if (m_stats != null)
387 Notice("show stats - show statistical information for this server");
388
389 Notice("show threads - list tracked threads"); 371 Notice("show threads - list tracked threads");
390 Notice("show uptime - show server startup time and uptime."); 372 Notice("show uptime - show server startup time and uptime.");
391 Notice("show version - show server version."); 373 Notice("show version - show server version.");
@@ -409,11 +391,6 @@ namespace OpenSim.Framework.Servers
409 ShowInfo(); 391 ShowInfo();
410 break; 392 break;
411 393
412 case "stats":
413 if (m_stats != null)
414 Notice(m_stats.Report());
415 break;
416
417 case "threads": 394 case "threads":
418 Notice(GetThreadsReport()); 395 Notice(GetThreadsReport());
419 break; 396 break;
@@ -604,8 +581,7 @@ namespace OpenSim.Framework.Servers
604 581
605 public string osSecret { 582 public string osSecret {
606 // Secret uuid for the simulator 583 // Secret uuid for the simulator
607 get { return m_osSecret; } 584 get { return m_osSecret; }
608
609 } 585 }
610 586
611 public string StatReport(IOSHttpRequest httpRequest) 587 public string StatReport(IOSHttpRequest httpRequest)
@@ -613,11 +589,11 @@ namespace OpenSim.Framework.Servers
613 // If we catch a request for "callback", wrap the response in the value for jsonp 589 // If we catch a request for "callback", wrap the response in the value for jsonp
614 if (httpRequest.Query.ContainsKey("callback")) 590 if (httpRequest.Query.ContainsKey("callback"))
615 { 591 {
616 return httpRequest.Query["callback"].ToString() + "(" + m_stats.XReport((DateTime.Now - m_startuptime).ToString() , m_version) + ");"; 592 return httpRequest.Query["callback"].ToString() + "(" + StatsManager.SimExtraStats.XReport((DateTime.Now - m_startuptime).ToString() , m_version) + ");";
617 } 593 }
618 else 594 else
619 { 595 {
620 return m_stats.XReport((DateTime.Now - m_startuptime).ToString() , m_version); 596 return StatsManager.SimExtraStats.XReport((DateTime.Now - m_startuptime).ToString() , m_version);
621 } 597 }
622 } 598 }
623 599
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index d5bc3c3..b018e57 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -648,7 +648,7 @@ namespace OpenSim.Framework.Servers.HttpServer
648 // Every month or so this will wrap and give bad numbers, not really a problem 648 // Every month or so this will wrap and give bad numbers, not really a problem
649 // since its just for reporting 649 // since its just for reporting
650 int tickdiff = requestEndTick - requestStartTick; 650 int tickdiff = requestEndTick - requestStartTick;
651 if (tickdiff > 3000 && requestHandler.Name != "GetTexture") 651 if (tickdiff > 3000 && requestHandler != null && requestHandler.Name != "GetTexture")
652 { 652 {
653 m_log.InfoFormat( 653 m_log.InfoFormat(
654 "[BASE HTTP SERVER]: Slow handling of {0} {1} {2} {3} {4} from {5} took {6}ms", 654 "[BASE HTTP SERVER]: Slow handling of {0} {1} {2} {3} {4} from {5} took {6}ms",