Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
RethinkDB Cluster Monitoring
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Ryan Paul
February 17, 2015
Programming
820
0
Share
RethinkDB Cluster Monitoring
Display RethinkDB cluster statistics in a live graph using Go, Socket.io, and Epoch.
Ryan Paul
February 17, 2015
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.5k
Realtime data visualization with RethinkDB and Epoch
segphault
1
790
Realtime web apps with RethinkDB and full-stack Ruby
segphault
2
350
Jupyter and RethinkDB
segphault
1
770
Using RethinkDB with Tornado & EventMachine
segphault
0
740
RethinkDB Training Course
segphault
3
480
Composing frontend Web applications with MontageJS
segphault
4
1.5k
Intro to MontageJS
segphault
1
230
Other Decks in Programming
See All in Programming
GoogleCloudとterraform完全に理解した
terisuke
1
140
Going Multiplatform with Your Android App (Android Makers 2026)
zsmb
2
450
[RubyKaigi 2026] Require Hooks
palkan
1
220
Lightning-Fast Method Calls with Ruby 4.1 ZJIT / RubyKaigi 2026
k0kubun
3
1.1k
クラウドネイティブなエンジニアに向ける Raycastの魅力と実際の活用事例
nealle
2
210
Back to the roots of date
jinroq
0
320
The Monolith Strikes Back: Why AI Agents ❤️ Rails Monoliths
serradura
0
340
第3木曜LT会 #28
tinykitten
PRO
0
110
The Less-Told Story of Socket Timeouts
coe401_
3
580
CursorとClaudeCodeとCodexとOpenCodeを実際に比較してみた
terisuke
1
480
AIエージェントで業務改善してみた
taku271
0
540
forteeの改修から振り返るPHPerKaigi 2026
muno92
PRO
3
290
Featured
See All Featured
Chasing Engaging Ingredients in Design
codingconduct
0
170
Making Projects Easy
brettharned
120
6.6k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
170
My Coaching Mixtape
mlcsv
0
110
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.4k
The Cult of Friendly URLs
andyhume
79
6.8k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.5k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2k
GraphQLとの向き合い方2022年版
quramy
50
15k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
440
It's Worth the Effort
3n
188
29k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
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?