Skip to content

docs: add modules to usagestats #160

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/contents.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
configuration
scripting
certificates
usagestats
statusapi
howto/index
troubleshooting
community
2 changes: 1 addition & 1 deletion source/controlapi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ that comprises four primary options:

* - **/status**
- Queried for
:doc:`usage statistics <usagestats>`.
:doc:`usage statistics <statusapi>`.


.. _configuration-socket:
Expand Down
53 changes: 49 additions & 4 deletions source/usagestats.rst → source/statusapi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,23 @@
.. _configuration-stats:

****************
Usage statistics
Status API
****************

Unit collects instance- and app-wide metrics,
available via the **GET**-only **/status** section of the
:ref:`control API <configuration-api>`:
Unit collects information about the loaded language models, as well as
instance- and app-wide metrics, and makes them available via the **GET**-only
**/status** section of the :ref:`control API <configuration-api>`:

.. list-table::
:header-rows: 1

* - Option
- Description

* - **modules**
- Object;
lists currently loaded language modules.

* - **connections**
- Object;
lists per-instance connection statistics.
Expand All @@ -37,6 +41,24 @@ Example:
.. code-block:: json

{
"modules": {
"python": [
{
"version": "3.12.3",
"lib": "/opt/unit/modules/python.unit.so"
},
{
"version": "3.8",
"lib": "/opt/unit/modules/python-3.8.unit.so"
}
],

"php": {
"version": "8.3.4",
"lib": "/opt/unit/modules/php.unit.so"
}
},

"connections": {
"accepted": 1067,
"active": 13,
Expand All @@ -63,6 +85,29 @@ Example:
}
}

Each item in the **modules** object lists one of the currently loaded language
modules, the installed version (or versions) of the module, and the path to the
module file:

.. list-table::
:header-rows: 1

* - Option
- Description

* - **name**
- String;
language module name.

* - **version**
- String;
language module version. If multiple versions are loaded,
the list contains multiple items.

* - **lib**
- String;
path to the language module file.

The **connections** object offers the following Unit instance metrics:

.. list-table::
Expand Down