LoginSignup
3
3

More than 5 years have passed since last update.

InfluxDB Go

Last updated at Posted at 2016-10-26

InfluxDB

  • Time Series DB
  • open source
  • Golang

[祝]version 1.0 release

もとめていたもの

DBやKVSなどをあえてストック、フロー、ワークという分け方で考えるとすれば、フロー
- 軽量DB(負荷が少ない)
- DBに親和的なgraph tool
- realTime

real-time-analytics
- cloud watch的な機能

InfluxDB install

Creating a database

InfluxDBへ接続
>influx

DATABASE作成

CREATE DATABASE mydb
USE mydb

gem influxdb-ruby

gem 'influxdb'

sample

      data = [
        {
          series: 'cpu',
          tags:   { host: 'server_1', region: 'us' },
          values: { internal: 5, external: 0.453345 }
        },
        {
          series: 'gpu',
          values: { value: 0.9999 },
        }
      ]
      influxdb = InfluxDB::Client.new ENV['INFLUXDB_DATABASE'], ['INFLUXDB_USERNAME'], ['INFLUXDB_PASSWORD']
      influxdb.write_points(data)
  • series
    テーブル
  • tags
    インデックスみたいなもの
  • values
    カラムと値(key-value?)

Time series data refers to the composition of metrics and tags.
A metric is an arrangement of numerical data in a successive time order,
consisting of a title and several time-value pairs.
Usually time series data is enriched by tags.

  • Regular – data that is sampled at regular intervals. For example every second, or every hour.
  • Irregular – for example, data that is only recorded when an event occurs, which might happen frequently, but always at completely random times.

Queries

graph

  • Chronograf
    image

  • re:dash
    image

副産物

おわりに

  • 大量ログデータのリアルタイム監視などに使えそう
  • 伝統的なファイル出力に替わる時代が来るかも
  • Time is in-out of joint

イベントに関する頻度と経過時間、
そして関連性をより細かく適切に把握できるツールを
使いこなすには意識が必要

余談

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3