@silvermine/dynamodb-capacity-manager
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"extends": "eslint-config-silvermine/node", | ||
"extends": "@silvermine/eslint-config/node", | ||
@@ -5,0 +5,0 @@ "rules": { |
{ | ||
"name": "@silvermine/dynamodb-capacity-manager", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Library for monitoring throughput on DynamoDB tables and adjusting it for you based on real-time usage. Can be run as a Lambda function.", | ||
@@ -34,6 +34,6 @@ "main": "src/index.js", | ||
"devDependencies": { | ||
"@silvermine/eslint-config": "1.5.0", | ||
"aws-sdk": "2.354.0", | ||
"coveralls": "3.0.2", | ||
"eslint": "3.3.1", | ||
"eslint-config-silvermine": "1.1.2", | ||
"eslint": "3.16.1", | ||
"expect.js": "0.3.1", | ||
@@ -40,0 +40,0 @@ "grunt": "1.0.3", |
@@ -83,3 +83,4 @@ 'use strict'; | ||
* @param {Array} throttlingData - the used capacity metrics - see note above | ||
* @param {Date} currentTime - leave this undefined unless you're running historical analysis | ||
* @param {Date} currentTime - leave this undefined unless you're running historical | ||
* analysis | ||
* @returns {Integer} the new capacity value for the table or index | ||
@@ -86,0 +87,0 @@ */ |
@@ -21,4 +21,5 @@ 'use strict'; | ||
// we don't want to spend too much money by making sudden massive jumps, so we allow for | ||
// tiered maximum jump amounts based on the currently-provisioned capacity | ||
// we don't want to spend too much money by making sudden massive jumps, so we | ||
// allow for tiered maximum jump amounts based on the currently-provisioned | ||
// capacity | ||
range = this.getConfigRange(this._config.MaximumIncreaseAmount, state.provisioning.CapacityUnits); | ||
@@ -25,0 +26,0 @@ |
@@ -13,4 +13,4 @@ 'use strict'; | ||
if (this.isDecreasing(state)) { | ||
// we don't want to "waste" a decrease by doing it for a negligible amount, so we wait until | ||
// the change being requested is at least a certain amount | ||
// we don't want to "waste" a decrease by doing it for a negligible amount, so we | ||
// wait until the change being requested is at least a certain amount | ||
range = this.getConfigRange(this._config.MinimumDecreaseAmount, state.provisioning.CapacityUnits); | ||
@@ -17,0 +17,0 @@ if (changePctg < range.Percentage) { |
@@ -162,3 +162,4 @@ 'use strict'; | ||
if (executedChanges.length > numberOfChangesMade) { | ||
// we made changes with this particular index, so we need to apply those to the table update params | ||
// we made changes with this particular index, so we need to apply those to | ||
// the table update params | ||
if (!params.GlobalSecondaryIndexUpdates) { | ||
@@ -245,7 +246,8 @@ params.GlobalSecondaryIndexUpdates = []; | ||
// TODO: we should not need to map between the data format we're using here for provisioning and | ||
// the data format the boss expects. This class is using our standard naming convention, which | ||
// starts variables with a lower case number. The boss was using AWS' format, which has upper case | ||
// letters. In a subsequent commit we need to refactor the boss, all rules, tests, etc, to use this | ||
// standard and stop doing the mapping here. | ||
// TODO: we should not need to map between the data format we're using here for | ||
// provisioning and the data format the boss expects. This class is using our | ||
// standard naming convention, which starts variables with a lower case number. The | ||
// boss was using AWS' format, which has upper case letters. In a subsequent commit | ||
// we need to refactor the boss, all rules, tests, etc, to use this standard and | ||
// stop doing the mapping here. | ||
provisioning = { | ||
@@ -252,0 +254,0 @@ NumberOfDecreasesToday: resource.provisioning.numberOfDecreasesToday, |
@@ -16,3 +16,4 @@ 'use strict'; | ||
// end at the first millisecond of the current minute (do not retrieve partial minute stats) | ||
// end at the first millisecond of the current minute (do not retrieve partial | ||
// minute stats) | ||
endTime.seconds(0).milliseconds(0).subtract(minutesToIgnore, 'minutes'); | ||
@@ -19,0 +20,0 @@ |
{ | ||
"extends": "eslint-config-silvermine/node-tests", | ||
"extends": "@silvermine/eslint-config/node-tests", | ||
@@ -5,0 +5,0 @@ "rules": { |
@@ -118,4 +118,5 @@ 'use strict'; | ||
// Not able to properly assert due to sinon keeping a reference to the passed args | ||
// rather than cloning them: See: https://github.com/sinonjs/sinon/issues/665 | ||
// Not able to properly assert due to sinon keeping a reference to the passed | ||
// args rather than cloning them: See: | ||
// https://github.com/sinonjs/sinon/issues/665 | ||
// sinon.assert.calledWith(willChangeCapacitySpy, { | ||
@@ -199,4 +200,5 @@ // provisioning: provisioned, | ||
// Not able to properly assert due to sinon keeping a reference to the passed args | ||
// rather than cloning them: See: https://github.com/sinonjs/sinon/issues/665 | ||
// Not able to properly assert due to sinon keeping a reference to the passed | ||
// args rather than cloning them: See: | ||
// https://github.com/sinonjs/sinon/issues/665 | ||
// sinon.assert.calledWith(willChangeCapacitySpy, { | ||
@@ -203,0 +205,0 @@ // provisioning: provisioned, |
@@ -46,3 +46,4 @@ 'use strict'; | ||
// six hour slots | ||
// slot one - 00:00 to 06:00 - can only use first decrease (only can decrease if have zero previous decreases) | ||
// slot one - 00:00 to 06:00 - can only use first decrease (only can decrease if | ||
// have zero previous decreases) | ||
runTest(50, '2016-08-18T00:10:01.000Z', 0, undefined); | ||
@@ -68,3 +69,4 @@ | ||
// eight hour slots | ||
// slot one - 00:00 to 08:00 - can only use first decrease (only can decrease if have zero previous decreases) | ||
// slot one - 00:00 to 08:00 - can only use first decrease (only can decrease if | ||
// have zero previous decreases) | ||
runTest(50, '2016-08-18T00:10:01.000Z', 0, undefined); // none previous, using the first now | ||
@@ -71,0 +73,0 @@ |
@@ -97,3 +97,4 @@ 'use strict'; | ||
// trending down, it has been over ten minutes since last decrease, not too many decreases | ||
// trending down, it has been over ten minutes since last decrease, not too many | ||
// decreases | ||
runTest(50, '2016-08-18T20:10:01.000Z', 0, undefined, { decAfterInc: 1 }); | ||
@@ -104,3 +105,4 @@ runTest(50, '2016-08-18T20:10:01.000Z', 1, undefined, { decAfterInc: 1 }); | ||
// trending down, it has been over ten minutes since last decrease, not too many decreases (custom max dec count) | ||
// trending down, it has been over ten minutes since last decrease, not too many | ||
// decreases (custom max dec count) | ||
runTest(50, '2016-08-18T20:10:01.000Z', 0, undefined, { decAfterInc: 1, maxDecreases: 3 }); | ||
@@ -110,3 +112,4 @@ runTest(50, '2016-08-18T20:10:01.000Z', 1, undefined, { decAfterInc: 1, maxDecreases: 3 }); | ||
// trending down, it has been over ten minutes since last decrease, fifteen since last increase, not too many decreases | ||
// trending down, it has been over ten minutes since last decrease, fifteen since | ||
// last increase, not too many decreases | ||
runTest(50, '2016-08-18T20:15:01.000Z', 0, undefined, { decAfterInc: 1 }); | ||
@@ -117,4 +120,4 @@ runTest(50, '2016-08-18T20:15:01.000Z', 1, undefined, { decAfterInc: 1 }); | ||
// trending down, it has been over ten minutes since last decrease, fifteen since last increase, not too many decreases | ||
// custom max dec count | ||
// trending down, it has been over ten minutes since last decrease, fifteen since | ||
// last increase, not too many decreases custom max dec count | ||
runTest(50, '2016-08-18T20:15:01.000Z', 0, undefined, { decAfterInc: 1, maxDecreases: 3 }); | ||
@@ -121,0 +124,0 @@ runTest(50, '2016-08-18T20:15:01.000Z', 1, undefined, { decAfterInc: 1, maxDecreases: 3 }); |
@@ -645,3 +645,4 @@ 'use strict'; | ||
// NOTE: This also tests that the same object will override the previous config | ||
// NOTE: This also tests that the same object will override the previous | ||
// config | ||
builder.ruleConfigForTable('*', constants.READ, wildcardResourceConfig); | ||
@@ -688,3 +689,4 @@ | ||
// NOTE: This also tests that the same object will override the previous config | ||
// NOTE: This also tests that the same object will override the previous | ||
// config | ||
builder.ruleConfigForIndex('*', '*', constants.READ, expectedWildcardOnlyConfig); | ||
@@ -691,0 +693,0 @@ |
Sorry, the diff of this file is not supported yet
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
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
177020
3335
1