diff --git a/source/reference/command/configureFailPoint-field.yaml b/source/reference/command/configureFailPoint-field.yaml new file mode 100644 index 00000000000..598b95bc6e1 --- /dev/null +++ b/source/reference/command/configureFailPoint-field.yaml @@ -0,0 +1,43 @@ +object: + name: configureFailPoint + type: dbcommand +field: + optional: false + type: field +name: configureFailPoint +type: string +position: 1 +description: "The name of the failure point." +--- +object: + name: configureFailPoint + type: dbcommand +field: + optional: false + type: field +name: mode +type: + - document + - string +position: 2 +description: | + Controls the behavior of a failure point. The possible values are + ``alwaysOn``, ``off``, or a document in the form of ``{times: n}`` + that specifies the number of times the failure point remains on + before it deactivates. The maximum value for the number is a + 32-bit signed integer. +--- +object: + name: configureFailPoint + type: dbcommand +field: + optional: true + type: field +name: data +type: document +position: 3 +description: | + Passes in additional data for use in configuring the fail point. For + example, to imitate a slow connection pass in a document that + contains a delay time. +... diff --git a/source/reference/command/configureFailPoint.txt b/source/reference/command/configureFailPoint.txt index e9688aef6eb..7737d6eaa51 100644 --- a/source/reference/command/configureFailPoint.txt +++ b/source/reference/command/configureFailPoint.txt @@ -4,19 +4,38 @@ configureFailPoint .. default-domain:: mongodb +Definition +---------- + .. dbcommand:: configureFailPoint - :dbcommand:`configureFailPoint` is an internal testing command that - configures failure points. + This is an internal testing command that onfigures a failure point + that you can turn on and off while MongoDB runs. To use this command, + :program:`mongod` must run with the :parameter:`enableTestCommands` + parameter enabled. You can enable the parameter from the command line + using the :option:`--setParameter ` option: + + .. code-block:: javascript + + --setParameter enableTestCommands=1 + + Issue the :dbcommand:`configureFailPoint` command against the + :term:`admin database`. The command takes the following form: + + .. code-block:: javascript + + {configureFailPoint: "", mode: } + + The command contains the following fields: + + .. include:: /reference/command/configureFailPoint-field.rst - :param string: Specifies the name of the failure point. +Example +------- - :param string mode: Controls behavior of failure point. Possible - values are: ``alwaysOn`` and ``off``. + .. code-block:: javascript - :param mode: Specify a document ``{times: n}`` - to control the number of times that MongoDB will - activate the failure point. + db.adminCommand( { configureFailPoint: "blocking_thread", mode: {times: 21} } ) .. |dbcommand| replace:: :dbcommand:`configureFailPoint` .. include:: /includes/note-enabletestcommands.rst