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
Deno Tunnel を使ってみた話
kamekyame
0
240
안드로이드 9년차 개발자, 프론트엔드 주니어로 커리어 리셋하기
maryang
1
140
re:Invent 2025 トレンドからみる製品開発への AI Agent 活用
yoskoh
0
420
Combinatorial Interview Problems with Backtracking Solutions - From Imperative Procedural Programming to Declarative Functional Programming - Part 2
philipschwarz
PRO
0
120
Findy AI+の開発、運用におけるMCP活用事例
starfish719
0
1.8k
JETLS.jl ─ A New Language Server for Julia
abap34
2
460
Rubyで鍛える仕組み化プロヂュース力
muryoimpl
0
160
20251212 AI 時代的 Legacy Code 營救術 2025 WebConf
mouson
0
210
認証・認可の基本を学ぼう後編
kouyuume
0
250
Developing static sites with Ruby
okuramasafumi
0
330
Patterns of Patterns
denyspoltorak
0
350
マスタデータ問題、マイクロサービスでどう解くか
kts
0
130
Featured
See All Featured
Paper Plane
katiecoart
PRO
0
44k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
65
The browser strikes back
jonoalderson
0
120
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.1k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
1
210
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
0
210
Ruling the World: When Life Gets Gamed
codingconduct
0
100
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
92
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
45
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
31
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
0
130
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?