Metrics or measurements
● CPU load
● Memory usage
● Average response times
● Counts over fixed intervals
Slide 6
Slide 6 text
Things you want to know
about over time
Slide 7
Slide 7 text
InfluxDB
● Written in Go
● No external dependencies
● 3 full time developers (YC W13)
Slide 8
Slide 8 text
How data is organized
● Databases (like in MySQL, Postgres, etc)
● Time series
○ like tables, but you can have millions of them
○ no need to define ahead of time
● Points or events
○ like rows, but schemaless like Mongo
○ single level hash
Other functions
● Percentiles
● Min, max, first, last, sum, count, stddev
● Histogram
● Lag, lead, funnel (next release)
Slide 19
Slide 19 text
Built in UI
Slide 20
Slide 20 text
# install influxdb
brew update && brew install influxdb
influxdb -config=/usr/local/etc/influxdb.conf
# set up the admin dashboard
git clone https://github.com/influxdb/influxdb-admin
cd influxdb-admin
bundle install
middleman server
open http://localhost:4567
Building Custom UIs
Slide 21
Slide 21 text
No content
Slide 22
Slide 22 text
Starting the Interface
# make the dir in the local admin interface
# dir so it shows up on the drop down
mkdir /usr/local/opt/influxdb/share/admin/interfaces/paul_owns
# make the dir and file in the influxdb-admin repo
mkdir source/interfaces/paul_owns
touch source/interfaces/paul_owns/index.html # or slim, etc.
Slide 23
Slide 23 text
# line 36 in config.rb
# activate :livereload
Kill Live Reload
Slide 24
Slide 24 text
Paul's Custom Dash
Slide 25
Slide 25 text
No content
Slide 26
Slide 26 text
Slide 27
Slide 27 text
Write some data
[
{
"name": "events",
"columns": ["type", "email"],
"points": [
["signup", "paul@influxdb.com"],
["paid", "foo@asdf.com"]
]
}
]
Slide 28
Slide 28 text
...
Graph it!
Slide 29
Slide 29 text
q = "SELECT COUNT(type) FROM events GROUP BY time(1h), type fill(0)"
parent.influxdb.query(q, (points) =>
typeToSeries = {}
points.forEach((point) =>
series = typeToSeries[point.type]
if !series
typeToSeries[point.type] = [];
series = typeToSeries[point.type];
series.push({x: point.time / 1000, y: point.count})
)
Slide 30
Slide 30 text
lastColorUsed = -1
colors = d3.scale.category10()
data = for type, series of typeToSeries
lastColorUsed += 1
{
data: series.reverse(),
color: colors(lastColorUsed),
name: type
}
Slide 31
Slide 31 text
graph = new Rickshaw.Graph(
height: 200,
element: document.querySelector("#events_graph"),
renderer: 'area',
stroke: true,
series: data
)
graph.render()
renderDetail = (series, x) =>
startTime = x
endTime = startTime + 3600
q = "select * from events where time > " + startTime +
"s and time < " + endTime +
"s and type = '" + series + "'"
Slide 36
Slide 36 text
parent.influxdb.query(q, (points) =>
ul = "
"
points.forEach (point) =>
li = "
"
li += point.email
li += "
"
ul += li
ul += "
"
$("#events_detail").html(ul)
)
Slide 37
Slide 37 text
No content
Slide 38
Slide 38 text
Many possibilities
● Histograms over time
● Pulling in context
● Drilling down
Slide 39
Slide 39 text
We’re looking for help
● Dashboard builder
● Explorer