Skip to content

Commit

Permalink
Merge branch 'feature/ZENKO-925-increaseMetricsExpiry' into q/8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bert-e committed Aug 9, 2018
2 parents d9694a9 + 7a47236 commit 2417105
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion lib/utilities/reportHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const metadata = require('../metadata/wrapper');
const monitoring = require('../utilities/monitoringHandler');

const REPORT_MODEL_VERSION = 1;
const CRR_METRIC_EXPIRY = 86400;

function hasWSOptionalDependencies() {
try {
Expand Down Expand Up @@ -148,7 +149,7 @@ function getCRRStats(log, cb, _config) {
const backbeatMetrics = new backbeat.Metrics({
redisConfig: redis,
validSites: sites,
internalStart: Date.now() - 900000, // 15 minutes ago.
internalStart: Date.now() - (CRR_METRIC_EXPIRY * 1000), // 24 hours ago
}, log);
const redisKeys = {
ops: 'bb:crr:ops',
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"homepage": "https://github.com/scality/S3#readme",
"dependencies": {
"arsenal": "github:scality/Arsenal#db743f8",
"arsenal": "github:scality/Arsenal#06dfdd9",
"async": "~2.5.0",
"aws-sdk": "2.28.0",
"azure-storage": "^2.1.0",
Expand Down
3 changes: 2 additions & 1 deletion tests/functional/utilities/reportHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const testCRRKeys = [
];

const INTERVAL = 300;
const CRR_METRIC_EXPIRY = 86400;

function _normalizeTimestamp(d) {
const m = d.getMinutes();
Expand Down Expand Up @@ -114,7 +115,7 @@ describe('reportHandler::_crrRequest', function testSuite() {
backbeatMetrics = new backbeat.Metrics({
redisConfig: config.redis,
validSites: sites,
internalStart: Date.now() - 900000,
internalStart: Date.now() - (CRR_METRIC_EXPIRY * 1000),
}, logger);
return done();
});
Expand Down

0 comments on commit 2417105

Please sign in to comment.