API Docs for:
Show:

plugin_rest_profiling Class

Module: plugins_rest
Parent Module: com_profiling_rest

REST plugin that provides profiling functions through the following REST API:

GET requests

  1. profiling/all
  2. profiling/proc_mem
  3. profiling/db_stats
  4. profiling/tot_users
  5. profiling/conn_clients

profiling/all

Returns all the profiling data.

Example JSON response:

{
    "pid": 23511,
    "uptime": "0 Days - 00:00:04",
    "node_ver": "v6.12.10",
    "pkg_ver": {
        "nethcti3": "nethcti3-3.0.5-1.ns7.noarch",
        "nethcti-server3": "nethcti-server3-3.0.4-1.ns7.x86_64",
        "janus-gateway": "janus-gateway-0.2.5-1.ns7.x86_64",
        "nethserver-nethvoice14": "nethserver-nethvoice14-14.0.9-1.ns7.noarch"
    },
    "proc_mem": {
        "rss": 96485376,
        "heapTotal": 77611008,
        "heapUsed": 55147992,
        "external": 2382791
    },
    "db_stats": {
        "numExecQueries": 7
    },
    "tot_users": 7,
    "conn_clients": {
        "ws_conn_clients": 1,
        "tcp_conn_clients": {
            "tot": 2,
            "<3.0.0": 1,
            "3.0.0": 1
        }
    }
}

profiling/proc_mem

Returns the quantity of the memory used by the process in byte.

Example JSON response:

{
    "rss": 66650112,
    "heapTotal": 43016192,
    "heapUsed": 36679920,
    "external": 4317024
}

profiling/conn_clients

Returns the number of connected clients.

Example JSON response:

{
     "ws_conn_clients": 4,
     "tcp_conn_clients": {
         "tot": 2,
         "<3.0.0": 1,
         "3.0.0": 1
    }
}

profiling/db_stats

Returns the database statistics.

Example JSON response:

{ "num_exec_queries": 151 }

Methods

all

(
  • req
  • res
  • next
)

Get all the profiling data by the following REST API:

all

Parameters:

  • req Object

    The client request

  • res Object

    The client response

  • next Function

    Function to run the next handler in the chain

all

(
  • req
  • res
  • next
)

Get the quantity of the memory usage by the process by the following REST API:

proc_mem

Parameters:

  • req Object

    The client request

  • res Object

    The client response

  • next Function

    Function to run the next handler in the chain

conn_clients

(
  • req
  • res
  • next
)

Gets the number of connected clients with the following REST API:

conn_clients

Parameters:

  • req Object

    The client request

  • res Object

    The client response

  • next Function

    Function to run the next handler in the chain

db_stats

(
  • req
  • res
  • next
)

Gets the number of executed queries with the following REST API:

db_stats

Parameters:

  • req Object

    The client request

  • res Object

    The client response

  • next Function

    Function to run the next handler in the chain

getConnectedClientsNum

() Object private

Returns the number of connected clients.

Returns:

Object:

The number of connected clients by websocket and tcp.

setCompConfigManager

(
  • comp
)

Sets the configuration architect component.

Parameters:

  • comp Object

    The configuration architect component.

setCompDbConn

(
  • comp
)

Sets the database architect component.

Parameters:

  • comp Object

    The database architect component.

setCompProfiling

(
  • comp
)

Sets the profiling architect component.

Parameters:

  • comp Object

    The profiling architect component.

setCompUtil

(
  • comp
)

Sets the utility architect component.

Parameters:

  • comp Object

    The utility architect component.

setLogger

(
  • log
)
static

Set the logger to be used.

Parameters:

  • log Object

    The logger object. It must have at least three methods: info, warn and error as console object.

Properties

compConfigManager

Object private

The configuration architect component.

compDbConn

Object private

The database architect component.

compProfiling

Object private

The profiling architect component.

compUtil

Object private

The utility architect component.

get

Array

REST API to be requested using HTTP GET request.

Sub-properties:

  • all String

    To get all the profiling data

  • proc_mem String

    To get the quantity of the memory usage by the process

  • db_stats String

    To get the database statistics

  • conn_clients String

    To get the number of connected clients

IDLOG

String private final

The module identifier used by the logger.

Default: [plugins_rest/profiling]

logger

Object private

The logger. It must have at least three methods: info, warn and error.

Default: console