# &adminguide;

## Overview

This module provides a client connector for InfluxDB.

## Dependencies

### &kamailio; Modules

The following modules must be loaded before this module:

- none.

### External Libraries or Applications

The following libraries or applications must be installed before running &kamailio; with this module loaded:

- none.

## Parameters

### `server` (int)

Address of InfluxDB server.

Default value is empty.

#### Set `server` parameter

    ...
    modparam("influxdbc", "server", "127.0.0.1")
    ...

### `port` (int)

Address of InfluxDB server.

Default value is 8086.

#### Set `port` parameter

    ...
    modparam("influxdbc", "port", 8808)
    ...

### `database` (int)

Database of InfluxDB server.

Default value is empty.

#### Set `database` parameter

    ...
    modparam("influxdbc", "database", "stats")
    ...

## Functions

### `influxdbc_measure(name)`

Start a measure group with the given name.

This function can be used from ANY_ROUTE.

#### `influxdbc_measure()` usage

    ...
    request_route {
        ...
        influxdbc_measure("stats");
        ...
    }
    ...

### `influxdbc_measureend()`

End the current measure group.

This function can be used from ANY_ROUTE.

#### `influxdbc_measureend()` usage

    ...
    request_route {
        ...
        influxdbc_measureend();
        ...
    }
    ...

### `influxdbc_sub(name)`

Start a measure subgroup with the given name.

This function can be used from ANY_ROUTE.

#### `influxdbc_sub()` usage

    ...
    request_route {
        ...
        influxdbc_sub("grp1");
        ...
    }
    ...

### `influxdbc_subend()`

End the current measure subgroup.

This function can be used from ANY_ROUTE.

#### `influxdbc_subend()` usage

    ...
    request_route {
        ...
        influxdbc_subend();
        ...
    }
    ...

### `influxdbc_push()`

Push accumulated values to the server.

This function can be used from ANY_ROUTE.

#### `influxdbc_push()` usage

    ...
    request_route {
        ...
        influxdbc_push();
        ...
    }
    ...

### `influxdbc_long(name, value)`

Save the pair with provided name and value. Both parameters can have variables.

This function can be used from ANY_ROUTE.

#### `influxdbc_long()` usage

    ...
    request_route {
        ...
        influxdbc_long("active", "$shv(active)");
        ...
    }
    ...