Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
RethinkDB Cluster Monitoring
Search
Ryan Paul
February 17, 2015
Programming
0
800
RethinkDB Cluster Monitoring
Display RethinkDB cluster statistics in a live graph using Go, Socket.io, and Epoch.
Ryan Paul
February 17, 2015
Tweet
Share
More Decks by Ryan Paul
See All by Ryan Paul
Using Async Iterators in Node.js
segphault
0
1.1k
Introduction to Basejump
segphault
1
1.4k
Realtime data visualization with RethinkDB and Epoch
segphault
1
760
Realtime web apps with RethinkDB and full-stack Ruby
segphault
2
340
Jupyter and RethinkDB
segphault
1
750
Using RethinkDB with Tornado & EventMachine
segphault
0
710
RethinkDB Training Course
segphault
3
450
Composing frontend Web applications with MontageJS
segphault
4
1.5k
Intro to MontageJS
segphault
1
210
Other Decks in Programming
See All in Programming
C-Shared Buildで突破するAI Agent バックテストの壁
po3rin
0
390
堅牢なフロントエンドテスト基盤を構築するために行った取り組み
shogo4131
8
2.3k
関数実行の裏側では何が起きているのか?
minop1205
1
690
LLMで複雑な検索条件アセットから脱却する!! 生成的検索インタフェースの設計論
po3rin
3
720
モデル駆動設計をやってみようワークショップ開催報告(Modeling Forum2025) / model driven design workshop report
haru860
0
270
tparseでgo testの出力を見やすくする
utgwkk
2
220
SwiftUIで本格音ゲー実装してみた
hypebeans
0
360
tsgolintはいかにしてtypescript-goの非公開APIを呼び出しているのか
syumai
6
2.2k
AtCoder Conference 2025「LLM時代のAHC」
imjk
2
470
AIエンジニアリングのご紹介 / Introduction to AI Engineering
rkaga
6
2.1k
connect-python: convenient protobuf RPC for Python
anuraaga
0
410
実はマルチモーダルだった。ブラウザの組み込みAI🧠でWebの未来を感じてみよう #jsfes #gemini
n0bisuke2
2
1k
Featured
See All Featured
Side Projects
sachag
455
43k
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
GraphQLの誤解/rethinking-graphql
sonatard
73
11k
How to Think Like a Performance Engineer
csswizardry
28
2.4k
A designer walks into a library…
pauljervisheath
210
24k
Done Done
chrislema
186
16k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
It's Worth the Effort
3n
187
29k
Automating Front-end Workflow
addyosmani
1371
200k
Transcript
RethinkDB Cluster Monitoring
Ryan Paul RethinkDB Evangelist @segphault
None
RethinkDB 1.16 • Changefeeds • Cluster admin • System tables
Backend Go and RethinkDB
Watch cluster stats r.Db("rethinkdb").Table("stats").Changes()
"new_val": { "id": ["cluster"], "query_engine": { "client_connections": 10, "clients_active": 2,
"queries_per_sec": 12.971126524000002, "read_docs_per_sec": 0, "written_docs_per_sec": 7.4114252490000005 } }
Watch cluster stats r.Db("rethinkdb").Table("stats"). Filter(r.Row.Field("id").AtIndex(0).Eq("cluster")). Changes()
server, _ := socketio.NewServer(nil) stats, _ := r.Db("rethinkdb").Table("stats"). Filter(r.Row.Field("id").AtIndex(0).Eq("cluster")). Changes().Run(conn)
go func() { var change r.WriteChanges for stats.Next(&change) { server.BroadcastTo( "monitor", "stats", change.NewValue) } }() Pass changes to Socket.io
Frontend Epoch and Polymer
Epoch A realtime charting library for building high performance visualizations.
Plot data with Epoch function timestamp() { return (new Date).getTime()
/ 1000; } var chart = $("#chart").epoch({ type: "time.line", axes: ["left", "bottom"], data: [ {label: "Writes", values: [{time: timestamp(), y: 0}]}, {label: "Reads", values: [{time: timestamp(), y: 0}]} ] }); var socket = io.connect(); socket.on("stats", function(data) { cluster.stats = data.query_engine; chart.push([ {time: timestamp(), y: cluster.stats.written_docs_per_sec}, {time: timestamp(), y: cluster.stats.read_docs_per_sec} ]); });
Bonus IRC bot for issue notification
Initialize bot ircConf := irc.NewConfig("mybot") ircConf.Server = "localhost:6667" bot :=
irc.Client(ircConf) bot.HandleFunc("connected", func(conn *irc.Conn, line *irc.Line) { log.Println("Connected to IRC server") conn.Join("#mychannel") })
Attach changefeed type Issue struct { Description, Type string }
issues, _ := r.Db("rethinkdb").Table("current_issues"). Filter(r.Row.Field("critical").Eq(true)). Changes().Field("new_val").Run(db) go func() { var issue Issue for issues.Next(&issue) { if issue.Type != "" { text := strings.Split(issue.Description, "\n")[0] message := fmt.Sprintf("(%s) %s", issue.Type, text) bot.Privmsg("#mychannel", message) } } }()
Resources • http://rethinkdb.com/blog/realtime-cluster-monitoring/ • https://github.com/rethinkdb/rethink-status/tree/go-backend • http://rethinkdb.com/docs/quickstart/ Questions?