Comparing version 0.3.1 to 0.3.2
@@ -14,2 +14,3 @@ // Copyright 2014 The Obvious Corporation. | ||
var metrics = require('metrics') | ||
var cacheUtils = require('./CacheUtils') | ||
@@ -221,2 +222,11 @@ /** | ||
/** @override */ | ||
CacheCluster.prototype.getPendingRequestsCount = function () { | ||
var cacheInstances = [] | ||
for (var uri in this._servers) { | ||
cacheInstances.push(this._servers[uri]) | ||
} | ||
return cacheUtils.mergePendingRequestCounts(cacheInstances) | ||
} | ||
/** | ||
@@ -223,0 +233,0 @@ * Reset the partial failure count of a certain operation. |
@@ -226,2 +226,10 @@ // Copyright 2014 The Obvious Corporation. | ||
/** | ||
* Gets a map of cacheInstance uri and the requestCounts | ||
* @return {Object} | ||
*/ | ||
CacheInstance.prototype.getPendingRequestsCount = function () { | ||
throw new Error("getPendingRequestsCount() must be implemented by any class extending CacheInstance") | ||
} | ||
/** | ||
* Get the Counter object that tracks the number of timeouts of a certain | ||
@@ -228,0 +236,0 @@ * operations. |
@@ -146,2 +146,9 @@ // Copyright 2013 The Obvious Corporation. | ||
/** @inheritDoc */ | ||
CacheInstance.prototype.getPendingRequestsCount = function () { | ||
var requestCounts = {} | ||
requestCounts['count'] = 0 | ||
return [requestCounts] | ||
} | ||
// Create a reaper which scans through all of the items in _data every | ||
@@ -148,0 +155,0 @@ // this._reaperIntervalMs millisseconds, if the item has expired then |
@@ -272,2 +272,6 @@ // Copyright 2014 A Medium Corporation | ||
} | ||
/** @inheritDoc */ | ||
MultiplexingCache.prototype.getPendingRequestsCount = function () { | ||
return this._delegate.getPendingRequestsCount() | ||
} | ||
@@ -274,0 +278,0 @@ |
@@ -12,2 +12,3 @@ // Copyright 2014 The Obvious Corporation. | ||
var CacheInstance = require('./CacheInstance') | ||
var cacheUtils = require('./CacheUtils') | ||
@@ -132,2 +133,7 @@ /** | ||
/** @override */ | ||
MultiWriteCacheGroup.prototype.getPendingRequestsCount = function () { | ||
return cacheUtils.mergePendingRequestCounts(this._writeOnlyInstances.concat(this._instance)) | ||
} | ||
module.exports = MultiWriteCacheGroup |
@@ -159,2 +159,11 @@ var redis = require('redis') | ||
/** @inheritDoc */ | ||
RedisConnection.prototype.getPendingRequestsCount = function () { | ||
var requestCounts = { | ||
'uri': this._host + ':' + this._port, | ||
'count': this._client.command_queue.length | ||
} | ||
return [requestCounts] | ||
} | ||
RedisConnection.prototype._onConnect = function () { | ||
@@ -161,0 +170,0 @@ this._isAvailable = true |
@@ -5,2 +5,3 @@ var util = require('util') | ||
var CacheInstance = require('./CacheInstance') | ||
var cacheUtils = require('./CacheUtils') | ||
@@ -160,2 +161,7 @@ function RedundantCacheGroup() { | ||
/** @override */ | ||
RedundantCacheGroup.prototype.getPendingRequestsCount = function () { | ||
return cacheUtils.mergePendingRequestCounts(cacheInstnaces.map(function (obj) { return obj.instance })) | ||
} | ||
/** | ||
@@ -162,0 +168,0 @@ * Always return true |
{ | ||
"name": "zcache", | ||
"description": "AWS zone-aware multi-layer cache", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"homepage": "https://github.com/Obvious/zcache", | ||
@@ -6,0 +6,0 @@ "authors": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
128958
31
3271
0