Categorygithub.com/hyperworks/influxdb
modulepackage
0.9.0-rc9
Repository: https://github.com/hyperworks/influxdb.git
Documentation: pkg.go.dev

# README

InfluxDB Circle CI

An Open-Source, Distributed, Time Series Database

InfluxDB v0.9.0 is now in the RC phase. If you're building a new project, please build against master or the most current RC instead of using v0.8.8.

InfluxDB is an open source distributed time series database with no external dependencies. It's useful for recording metrics, events, and performing analytics.

Features

  • Built-in [HTTP API] (http://influxdb.com/docs/v0.9/concepts/reading_and_writing_data.html) so you don't have to write any server side code to get up and running.
  • Clustering is supported out of the box, so that you can scale horizontally to handle your data.
  • Simple to install and manage, and fast to get data in and out.
  • It aims to answer queries in real-time. That means every data point is indexed as it comes in and is immediately available in queries that should return in < 100ms.

Getting Started

The following directions apply only to the 0.9.0 release or building from the source on master.

Building

You don't need to build the project to use it - you can use any of our pre-built packages to install InfluxDB. That's the recommended way to get it running. However, if you want to contribute to the core of InfluxDB, you'll need to build. For those adventurous enough, you can follow along on our docs.

Starting InfluxDB

  • service influxdb start if you have installed InfluxDB using an official Debian or RPM package.
  • $GOPATH/bin/influxd if you have built InfluxDB from source.

Creating your first database

curl -G 'http://localhost:8086/query' \
--data-urlencode "q=CREATE DATABASE mydb"

Setting up the database's retention policy

curl -G 'http://localhost:8086/query' \
--data-urlencode "q=CREATE RETENTION POLICY mypolicy \
ON mydb DURATION 7d REPLICATION 1 DEFAULT"

Insert some data

curl -H "Content-Type: application/json" http://localhost:8086/write -d '
{
    "database": "mydb",
    "retentionPolicy": "mypolicy",
    "points": [
        {
            "timestamp": "2014-11-10T23:00:00Z",
            "name": "cpu",
             "tags": {
                 "region":"uswest",
                 "host": "server01"
            },
             "fields":{
                 "value": 100
            }
         }
      ]
}'

Query for the data

curl -G http://localhost:8086/query?pretty=true \
--data-urlencode "db=mydb" --data-urlencode "q=SELECT * FROM cpu"

Helpful Links

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Package influxql implements a parser for the InfluxDB query language.
Package messaging implements a distributed, raft-backed messaging system.
Package raft implements a streaming version of the Raft protocol.
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

HashPassword generates a cryptographically secure hash for password.
NewBroker returns a new instance of a Broker with default values.
NewContinuousQuery returns a ContinuousQuery object with a parsed influxql.CreateContinuousQueryStatement.
NewFieldCodec returns a FieldCodec for the given Measurement.
NewMeasurement allocates and initializes a new Measurement.
NewRetentionPolicy returns a new instance of RetentionPolicy with defaults set.
NewServer returns a new instance of Server.
NormalizeBatchPoints returns a slice of Points, created by populating individual points within the batch, which do not have timestamps or tags, with the top-level values.

# Constants

DefaultContinuousQueryCheckTime is how frequently the broker will ask a data node in the cluster to run any continuous queries that should be run.
DefaultDataNodeTimeout is how long the broker will wait before timing out on a data node that it has requested process continuous queries.
DefaultFailureSleep is how long the broker will sleep before trying the next data node in the cluster if the current data node failed to respond.
DefaultReplicaN represents the number of replicas data is written to.
DefaultRetentionPolicyName is the name of a databases's default shard space.
DefaultRootPassword is the password initially set for the root user.
DefaultShardDuration is the time period held by a shard.
DefaultShardRetention is the length of time before a shard is dropped.
DefaultSplitN represents the number of partitions a shard is split into.

# Variables

BcryptCost is the cost associated with generating password with Bcrypt.
ErrClusterAdminExists is returned when creating a duplicate admin.
ErrClusterAdminNotFound is returned when deleting a non-existent admin.
ErrContinuousQueryExists is returned when creating a duplicate continuous query.
ErrDatabaseExists is returned when creating a duplicate database.
ErrDatabaseNameRequired is returned when creating a database without a name.
ErrDatabaseNotFound is returned when dropping a non-existent database.
ErrDatabaseRequired is returned when using a blank database name.
ErrDataNodeExists is returned when creating a duplicate data node.
ErrDataNodeNotFound is returned when dropping a non-existent data node.
ErrDataNodeRequired is returned when using a blank data node id.
ErrDataNodeURLRequired is returned when creating a data node without a URL.
ErrDefaultRetentionPolicyNotFound is returned when using the default policy on a database but the default has not been set.
ErrFieldNotFound is returned when a field cannot be found.
ErrFieldOverflow is returned when too many fields are created on a measurement.
ErrFieldsRequired is returned when a point does not any fields.
ErrFieldTypeConflict is returned when a new field already exists with a different type.
ErrInvalidGrantRevoke is returned when a statement requests an invalid privilege for a user on the cluster or a database.
ErrInvalidPointBuffer is returned when a buffer containing data for writing is invalid.
ErrInvalidQuery is returned when executing an unknown query type.
ErrInvalidUsername is returned when using a username with invalid characters.
ErrMeasurementNameRequired is returned when a point does not contain a name.
ErrMeasurementNotFound is returned when a measurement does not exist.
ErrNotExecuted is returned when a statement is not executed in a query.
ErrPathRequired is returned when opening a server without a path.
ErrReadAccessDenied is returned when a user attempts to read data that he or she does not have permission to read.
ErrReadWritePermissionsRequired is returned when required read/write permissions aren't provided.
ErrRetentionPolicyExists is returned when creating a duplicate shard space.
ErrRetentionPolicyNameRequired is returned using a blank shard space name.
ErrRetentionPolicyNotFound is returned when deleting a non-existent shard space.
ErrSeriesExists is returned when attempting to set the id of a series by database, name and tags that already exists.
ErrSeriesNotFound is returned when looking up a non-existent series by database, name and tags.
ErrServerClosed is returned when closing an already closed server.
ErrServerOpen is returned when opening an already open server.
ErrShardNotFound is returned writing to a non-existent shard.
ErrUnableToJoin is returned when a server cannot join a cluster.
ErrUserExists is returned when creating a duplicate user.
ErrUsernameRequired is returned when using a blank username.
ErrUserNotFound is returned when deleting a non-existent user.

# Structs

BatchPoints is used to send batched data in a single write.
Broker represents an InfluxDB specific messaging broker.
ContinuousQuery represents a query that exists on the server and processes each incoming event.
DataNode represents a data node in the cluster.
ErrAuthorize represents an authorization error.
Field represents a series field.
FieldCodec providecs encoding and decoding functionality for the fields of a given Measurement.
Matcher can match either a Regex or plain string.
Measurement represents a collection of time series in a database.
Point defines the values that will be written to the database.
Result represents a resultset returned from a single statement.
Results represents a list of statement results.
RetentionPolicy represents a policy for creating new shards in a database and how long they're kept around for.
RetentionPolicyUpdate represents retention policy fields that need to be updated.
Series belong to a Measurement and represent unique time series in a database.
Server represents a collection of metadata and raw metric data.
Shard represents the logical storage for a given time range.
ShardGroup represents a group of shards created for a single time range.
TagFilter represents a tag filter when looking up other tags or measurements.
User represents a user account on the system.

# Interfaces

MessagingClient represents the client used to receive messages from brokers.

# Type aliases

Fields represents a list of fields.
Measurements represents a list of *Measurement.
Shards represents a list of shards.