🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

sand-influx

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sand-influx

Influx DB support

latest
Source
npmnpm
Version
1.2.0
Version published
Maintainers
1
Created
Source

sand-influx

An InfluxDB sand grain. This module is a wrapper for node-influx.

Installation

npm install sand-influx

Usage

Add influx to your sand config

const sand = require('sand');
const influx = require('influx');

new sand()
    .use(influx)
    .start();

A list of configuration values can be found below

Configuration Options

OptionDescription
usernameusername
passwordpassword
databasedatabase name
hostnamehostname, e.g. 'localhost'
port [optional]influx db port, defult: 8086
requestTimeout [optional]number of ms to wait before request times out. defaults to 'null' (waits until connection is closed). Use with caution !
maxRetries[optional]max number of retries until a request raises an error (e.g 'no hosts available'), default: 2

Functions

writePoint

Writes a point to a series

let point = {value: 100};
sand.influx.writePoint(seriesName, point, options, callback);

writePoints

Write multiple points to a series

let points = [{value: 100}, {value: 200}];
sand.influx.writePoints(seriesName, points, options, callback);

Please note that there's a POST limit at about 2MB per request. Do not submit too many points at once

query

Queries the database, This function manipulates the data that comes back and returns an array of series rows with columns and values mapped automatically.

let query = 'SELECT mean(column) FROM my_series WHERE time > now() - 24h';
sand.influx.query(query, function(err, rows) {
    // Rows should be an array of objects
});

queryRaw

Queries the database using raw influx

let query = 'SELECT mean(column) FROM my_series WHERE time > now() - 24h';
sand.influx.queryRaw(query, callback);

Keywords

sand

FAQs

Package last updated on 13 Mar 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts