Constructor
new Sender(options)
Parameters:
Name | Type | Description |
---|---|---|
options |
SenderOptions | Sender configuration object. See SenderOptions documentation for detailed description of configuration options. |
Methods
(async) at(timestamp, unitopt)
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
timestamp |
number | bigint | Designated epoch timestamp, accepts numbers or BigInts. | ||
unit |
string |
<optional> |
us | Timestamp unit. Supported values: 'ns' - nanoseconds, 'us' - microseconds, 'ms' - milliseconds. Defaults to 'us'. |
(async) atNow()
Designated timestamp will be populated by the server on this record.
booleanColumn(name, value) → {Sender}
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Column name. |
value |
boolean | Column value, accepts only boolean values. |
Returns:
- Type
- Sender
(async) close()
Data sitting in the Sender's buffer will be lost unless flush() is called before close().
connect(connectOptions) → {Promise.<boolean>}
Parameters:
Name | Type | Description |
---|---|---|
connectOptions |
net.NetConnectOpts | tls.ConnectionOptions | Connection options, host and port are required. |
Returns:
- Type
- Promise.<boolean>
floatColumn(name, value) → {Sender}
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Column name. |
value |
number | Column value, accepts only number values. |
Returns:
- Type
- Sender
(async) flush() → {Promise.<boolean>}
Returns:
- Type
- Promise.<boolean>
intColumn(name, value) → {Sender}
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Column name. |
value |
number | Column value, accepts only number values. |
Returns:
- Type
- Sender
reset() → {Sender}
In other words it clears the buffer and sets the writing position to the beginning of the buffer.
Returns:
- Type
- Sender
resize(bufferSize)
Can be used to increase the size of buffer if overflown. The buffer's content is copied into the new buffer.
Parameters:
Name | Type | Description |
---|---|---|
bufferSize |
number | New size of the buffer used by the sender, provided in bytes. |
stringColumn(name, value) → {Sender}
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Column name. |
value |
string | Column value, accepts only string values. |
Returns:
- Type
- Sender
symbol(name, value) → {Sender}
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Symbol name. |
value |
any | Symbol value, toString() will be called to extract the actual symbol value from the parameter. |
Returns:
- Type
- Sender
table(table) → {Sender}
Parameters:
Name | Type | Description |
---|---|---|
table |
string | Table name. |
Returns:
- Type
- Sender
timestampColumn(name, value, unitopt) → {Sender}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
name |
string | Column name. | ||
value |
number | bigint | Epoch timestamp, accepts numbers or BigInts. | ||
unit |
string |
<optional> |
us | Timestamp unit. Supported values: 'ns' - nanoseconds, 'us' - microseconds, 'ms' - milliseconds. Defaults to 'us'. |
Returns:
- Type
- Sender
(static) fromConfig(configurationString, extraOptions) → {Sender}
Parameters:
Name | Type | Description |
---|---|---|
configurationString |
string | Configuration string. |
extraOptions |
object | Optional extra configuration. - 'log' is a logging function used by the Sender. Prototype: (level: 'error'|'warn'|'info'|'debug', message: string) => void. - 'agent' is a custom http/https agent used by the Sender when http/https transport is used. A http.Agent or https.Agent object is expected. |
Returns:
- Type
- Sender
(static) fromEnv(extraOptions) → {Sender}
Parameters:
Name | Type | Description |
---|---|---|
extraOptions |
object | Optional extra configuration. - 'log' is a logging function used by the Sender. Prototype: (level: 'error'|'warn'|'info'|'debug', message: string) => void. - 'agent' is a custom http/https agent used by the Sender when http/https transport is used. A http.Agent or https.Agent object is expected. |
Returns:
- Type
- Sender