summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/snapshotWindow_serverParameters.js
blob: fa0f004c511555e60f579cfbd9fb4d2357280d5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// Test server validation of snapshot history window related server parameters' settings on startup
// and via setParameter command.

(function() {
'use strict';

load("jstests/noPassthrough/libs/server_parameter_helpers.js");

// Valid parameter values are in the range [0, infinity).
testNumericServerParameter("maxTargetSnapshotHistoryWindowInSeconds",
                           true /*isStartupParameter*/,
                           true /*isRuntimeParameter*/,
                           5 /*defaultValue*/,
                           30 /*nonDefaultValidValue*/,
                           true /*hasLowerBound*/,
                           -1 /*lowerOutOfBounds*/,
                           false /*hasUpperBound*/,
                           "unused" /*upperOutOfBounds*/);

// Valid parameter values are in the range [0, 100].
testNumericServerParameter("cachePressureThreshold",
                           true /*isStartupParameter*/,
                           true /*isRuntimeParameter*/,
                           50 /*defaultValue*/,
                           70 /*nonDefaultValidValue*/,
                           true /*hasLowerBound*/,
                           -1 /*lowerOutOfBounds*/,
                           true /*hasUpperBound*/,
                           101 /*upperOutOfBounds*/);

// Valid parameter values are in the range (0, 1).
testNumericServerParameter("snapshotWindowMultiplicativeDecrease",
                           true /*isStartupParameter*/,
                           true /*isRuntimeParameter*/,
                           0.75 /*defaultValue*/,
                           0.50 /*nonDefaultValidValue*/,
                           true /*hasLowerBound*/,
                           -1 /*lowerOutOfBounds*/,
                           true /*hasUpperBound*/,
                           1.1 /*upperOutOfBounds*/);

// Valid parameter values are in the range [1, infinity).
testNumericServerParameter("snapshotWindowAdditiveIncreaseSeconds",
                           true /*isStartupParameter*/,
                           true /*isRuntimeParameter*/,
                           2 /*defaultValue*/,
                           10 /*nonDefaultValidValue*/,
                           true /*hasLowerBound*/,
                           0 /*lowerOutOfBounds*/,
                           false /*hasUpperBound*/,
                           "unused" /*upperOutOfBounds*/);

// Valid parameter values are in the range [1, infinity).
testNumericServerParameter("checkCachePressurePeriodSeconds",
                           true /*isStartupParameter*/,
                           true /*isRuntimeParameter*/,
                           5 /*defaultValue*/,
                           8 /*nonDefaultValidValue*/,
                           true /*hasLowerBound*/,
                           0 /*lowerOutOfBounds*/,
                           false /*hasUpperBound*/,
                           "unused" /*upperOutOfBounds*/);

// Valid parameter values are in the range [1, infinity).
testNumericServerParameter("minMillisBetweenSnapshotWindowInc",
                           true /*isStartupParameter*/,
                           true /*isRuntimeParameter*/,
                           500 /*defaultValue*/,
                           2 * 1000 /*nonDefaultValidValue*/,
                           true /*hasLowerBound*/,
                           0 /*lowerOutOfBounds*/,
                           false /*hasUpperBound*/,
                           "unused" /*upperOutOfBounds*/);

// Valid parameter values are in the range [1, infinity).
testNumericServerParameter("minMillisBetweenSnapshotWindowDec",
                           true /*isStartupParameter*/,
                           true /*isRuntimeParameter*/,
                           500 /*defaultValue*/,
                           2 * 1000 /*nonDefaultValidValue*/,
                           true /*hasLowerBound*/,
                           0 /*lowerOutOfBounds*/,
                           false /*hasUpperBound*/,
                           "unused" /*upperOutOfBounds*/);
})();