@resolveio/server-lib 12.0.25 → 12.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,6 +28,7 @@ export declare class MongoManager {
28
28
  private _serverCollections;
29
29
  private _debugMongoQueueHits;
30
30
  private _debugRemoveCacheHits;
31
+ private _debugMongoQueueCollections;
31
32
  constructor();
32
33
  getServerCollections(): string[];
33
34
  registerCollection(collection: Collection<any>): void;
@@ -81,6 +81,7 @@ var MongoManager = /** @class */ (function () {
81
81
  this._serverCollections = [];
82
82
  this._debugMongoQueueHits = 0;
83
83
  this._debugRemoveCacheHits = 0;
84
+ this._debugMongoQueueCollections = [];
84
85
  this._nodeCache = new NodeCache({ stdTTL: 0, checkperiod: 0 });
85
86
  this._heapLimit = this._heapStats.heap_size_limit / 4;
86
87
  index_1.ResolveIOServer.getMainDB().listCollections().toArray().then(function (collections) {
@@ -92,10 +93,12 @@ var MongoManager = /** @class */ (function () {
92
93
  console.log(new Date(), 'Mongo Manager', 'Mongo Queue', _this._mongoQueue.length);
93
94
  console.log(new Date(), 'Mongo Manager', 'Server Collections', _this._serverCollections.length);
94
95
  console.log(new Date(), 'Mongo Manager', 'Mongo Queue Hits', _this._debugMongoQueueHits);
95
- console.log(new Date(), 'Sub Manager', 'Cache Cleanup Hits', _this._debugRemoveCacheHits);
96
+ console.log(new Date(), 'Mongo Manager', 'Mongo Queue Collections', _this._debugMongoQueueCollections);
97
+ console.log(new Date(), 'Mongo Manager', 'Cache Cleanup Hits', JSON.stringify(_this._debugRemoveCacheHits, null, 2));
96
98
  }
97
99
  _this._debugMongoQueueHits = 0;
98
100
  _this._debugRemoveCacheHits = 0;
101
+ _this._debugMongoQueueCollections = [];
99
102
  }, 60000);
100
103
  this.runQueue();
101
104
  }
@@ -143,6 +146,16 @@ var MongoManager = /** @class */ (function () {
143
146
  var _a, _b, _c;
144
147
  _this._debugMongoQueueHits += 1;
145
148
  var mongoQueue = queueArr[i];
149
+ if (!_this._debugMongoQueueCollections.some(function (a) { return a.collection === mongoQueue.name_collection && a.function === mongoQueue.data_function; })) {
150
+ _this._debugMongoQueueCollections.push({
151
+ collection: mongoQueue.name_collection,
152
+ function: mongoQueue.name_function,
153
+ hits: 1
154
+ });
155
+ }
156
+ else {
157
+ _this._debugMongoQueueCollections.filter(function (a) { return a.collection === mongoQueue.name_collection && a.function === mongoQueue.data_function; })[0].hits += 1;
158
+ }
146
159
  mongoQueue.running = true;
147
160
  mongoQueue.invalidateFlag = false;
148
161
  if (mongoQueue.cacheId) {