summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/profile_options.js
blob: b0101d47283ed2cd3deed66fe1ba20b2c9007d35 (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
var baseName = "jstests_core_profile_options";

load('jstests/libs/command_line/test_parsed_options.js');

jsTest.log("Testing \"profile\" command line option with profiling off");
var expectedResult = {
    "parsed" : {
        "operationProfiling" : {
            "mode" : "off"
        }
    }
};
testGetCmdLineOptsMongod({ profile : "0" }, expectedResult);

jsTest.log("Testing \"profile\" command line option with profiling slow operations on");
var expectedResult = {
    "parsed" : {
        "operationProfiling" : {
            "mode" : "slowOp"
        }
    }
};
testGetCmdLineOptsMongod({ profile : "1" }, expectedResult);

jsTest.log("Testing \"profile\" command line option with profiling all on");
var expectedResult = {
    "parsed" : {
        "operationProfiling" : {
            "mode" : "all"
        }
    }
};
testGetCmdLineOptsMongod({ profile : "2" }, expectedResult);

jsTest.log("Testing \"operationProfiling.mode\" config file option");
expectedResult = {
    "parsed" : {
        "config" : "jstests/libs/config_files/set_profiling.json",
        "operationProfiling" : {
            "mode" : "all"
        }
    }
};
testGetCmdLineOptsMongod({ config : "jstests/libs/config_files/set_profiling.json" },
                         expectedResult);



print(baseName + " succeeded.");