Skip to content
Browse files

added pool status

  • Loading branch information...
1 parent 6641658 commit 0149612471db35bb963997c6dc73756c315e0963 @schell committed Apr 6, 2012
Showing with 19 additions and 3 deletions.
  1. +19 −3 src/Utils/Pool.js
View
22 src/Utils/Pool.js
@@ -175,16 +175,32 @@ mod({
addin.watchPond = function addinWatchPond(pond) {
/** * *
- * Returns a status string for a given pond.
+ * Returns a status string for a given pond in the shared pool.
* Good for debugging - use this as a watch expression:
* m.Pool.watchPond('someObjectPond')
* @return String
* * **/
var deployed = addin.sharedInstance().pool[pond].deployedObjects.length;
var recycled = addin.sharedInstance().pool[pond].recycledObjects.length;
return pond + ' deployed:' + deployed + ' recycled:' + recycled;
- }
-}
+ };
+
+ addin.status = function addinStatus() {
+ /** * *
+ * Returns a status string for all ponds in the shared pool.
+ * Good for debugging - use this as a watch expression:
+ * m.Pool.status()
+ * @return String
+ * * **/
+ var deployed = 0;
+ var recycled = 0;
+ var pool = addin.sharedInstance().pool;
+ for (var pond in pool) {
+ deployed += pool[pond].deployedObjects.length;
+ recycled += pool[pond].recycledObjects.length;
+ }
+ return 'Pool total deployed:' + deployed + ' recycled:' + recycled;
+ };
return addin;

0 comments on commit 0149612

Please sign in to comment.
Something went wrong with that request. Please try again.