[Groonga-commit] groonga/groonga at a9d288b [master] doc: document thread_count

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Aug 13 23:10:57 JST 2015


Kouhei Sutou	2015-08-13 23:10:57 +0900 (Thu, 13 Aug 2015)

  New Revision: a9d288b7844588ba25261ba39a20ca8cb51ad6ea
  https://github.com/groonga/groonga/commit/a9d288b7844588ba25261ba39a20ca8cb51ad6ea

  Message:
    doc: document thread_count

  Added files:
    doc/source/example/reference/commands/thread_count/new_count.log
    doc/source/example/reference/commands/thread_count/usage_get.log
    doc/source/example/reference/commands/thread_count/usage_set.log
    doc/source/reference/commands/thread_count.rst

  Added: doc/source/example/reference/commands/thread_count/new_count.log (+4 -0) 100644
===================================================================
--- /dev/null
+++ doc/source/example/reference/commands/thread_count/new_count.log    2015-08-13 23:10:57 +0900 (63a37e3)
@@ -0,0 +1,4 @@
+Execution example::
+
+  thread_count --new_count 3
+  # [[0, 1337566253.89858, 0.000355720520019531], 4]

  Added: doc/source/example/reference/commands/thread_count/usage_get.log (+4 -0) 100644
===================================================================
--- /dev/null
+++ doc/source/example/reference/commands/thread_count/usage_get.log    2015-08-13 23:10:57 +0900 (31a8ed5)
@@ -0,0 +1,4 @@
+Execution example::
+
+  thread_count
+  # [[0, 1337566253.89858, 0.000355720520019531], 2]

  Added: doc/source/example/reference/commands/thread_count/usage_set.log (+4 -0) 100644
===================================================================
--- /dev/null
+++ doc/source/example/reference/commands/thread_count/usage_set.log    2015-08-13 23:10:57 +0900 (30b645e)
@@ -0,0 +1,4 @@
+Execution example::
+
+  thread_count --new_count 4
+  # [[0, 1337566253.89858, 0.000355720520019531], 2]

  Added: doc/source/reference/commands/thread_count.rst (+108 -0) 100644
===================================================================
--- /dev/null
+++ doc/source/reference/commands/thread_count.rst    2015-08-13 23:10:57 +0900 (960736c)
@@ -0,0 +1,108 @@
+.. -*- rst -*-
+
+.. highlightlang:: none
+
+.. groonga-command
+.. database: commands_thread_count
+
+.. groonga-command
+.. thread_count 2
+
+``thread_count``
+================
+
+Summary
+-------
+
+.. versionadded:: 5.0.7
+
+``thread_count`` has the following two features:
+
+  * It returns the max number of threads.
+  * It sets the max number of threads.
+
+:doc:`/reference/executables/groonga` is the only Groonga server that
+supports full ``thread_count`` features.
+
+:doc:`/reference/executables/groonga-httpd` supports only one feature
+that returns the max number of threads. ``thread_count`` for
+:doc:`/reference/executables/groonga-httpd` always returns ``1``
+because :doc:`/reference/executables/groonga-httpd` uses single thread
+model.
+
+If you're using Groonga as a library, ``thread_count`` doesn't work
+without you set custom functions by
+:c:func:`grn_thread_set_get_count_func()` and
+:c:func:`grn_thread_set_set_count_func()`. If you set a function by
+:c:func:`grn_thread_set_get_count_func()`, the feature that returns
+the max number of threads works. If you set a function by
+:c:func:`grn_thread_set_set_count_func()`, the feature that sets the
+max number of threads works.
+
+Syntax
+------
+
+``thread_count`` has only one optional parameter::
+
+  thread_count [new_count=null]
+
+Usage
+-----
+
+You can get the max number of threads by calling without any parameters:
+
+.. groonga-command
+.. include:: ../../example/reference/commands/thread_count/usage_get.log
+.. thread_count
+
+If it returns ``0``, your Groonga server doesn't support the feature.
+
+You can set the max number of threads by calling ``new_count`` parameter:
+
+.. groonga-command
+.. include:: ../../example/reference/commands/thread_count/usage_set.log
+.. thread_count --new_count 4
+
+It returns the previous max number of threads when you pass
+``new_count`` parameter.
+
+Parameters
+----------
+
+This section describes all parameters.
+
+Required parameters
+^^^^^^^^^^^^^^^^^^^
+
+There is no required parameters.
+
+Optional parameters
+^^^^^^^^^^^^^^^^^^^
+
+.. _thread-count-new-count:
+
+``new_count``
+"""""""""""""
+
+Specifies the new max number of threads.
+
+You must specify unsigned integer:
+
+.. groonga-command
+.. include:: ../../example/reference/commands/thread_count/new_count.log
+.. thread_count --new_count 3
+
+If you specify ``new_count`` parameter, ``thread_count`` returns the
+max number of threads before ``new_count`` is applied.
+
+Return value
+------------
+
+The command returns the max number of threads as body::
+
+  [HEADER, N_MAX_THREADS]
+
+If ``new_count`` is specified, ``N_MAX_THREADS`` is the max number of
+threads before ``new_count`` is applied.
+
+See :doc:`/reference/command/output_format` for ``HEADER``.
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index