Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 62 lines (33 sloc) 2.56 kb
50aa675 @gflarity initial revision of the Heat Tracer article
gflarity authored
1 Title: Realtime Performance Visualizations using Node.js
2 Author: Geoff Flarity
9a7310b Update timestamp and node version.
Tim Caswell authored
3 Date: Mon, 21 Feb 2011 19:04:30 GMT
4 Node: v0.4.0
50aa675 @gflarity initial revision of the Heat Tracer article
gflarity authored
5
622a639 @gflarity added a picture of Heat Tracer in action and polished up the article
gflarity authored
6
bdf9b1c @gflarity typo
gflarity authored
7 This article outlines how to create a realtime heatmap of your syscall latency using HTML5, some great node modules, and DTrace. It was inspired by talk that Bryan Cantrill and Brendan Greg gave on Joyent's cool cloud analytics tools. While specific, the code provided could easily be adapted to provide a heatmap of any type of aggregation Dtrace is capable of providing.
50aa675 @gflarity initial revision of the Heat Tracer article
gflarity authored
8
9 ## System Requirements
10
11 First thing's first, you're going to need a system with DTrace. This likely means Solaris (or one of its decedents), OS X, or a BSD variant. There doesn't appear to be Dtrace available for Linux.
12
13 ## Security
14
a44f399 Fixed some common issues with word form.
Zearin authored
15 Secondly, please be aware that at the time of writing the demo code contains a fairly substantial secruity vulnerabilty. Namely the d script is sent from the client with no authentication whatsoever. If you bind to localhost this shouldn't be a big deal for a demo. Time permitting I intend to clean up the code.
50aa675 @gflarity initial revision of the Heat Tracer article
gflarity authored
16
17 ## Dependencies
18
19 For this tutorial you'll also need:
20
21 node - http://nodejs.org/#download (duh)
22 npm - https://github.com/isaacs/npm (makes installing modules a breeze)
23 node-libdtrace - https://github.com/bcantrill/node-libdtrace (provides dtrace functionality)
24 Socket.IO - 'npm install socket.io' (web sockets made easy)
25
26 ## Server
27
28 Now we're ready to start writing our web server:
29
30 <heat-tracer/heat_tracer.js>
31
32 ## Client
33
34 In order to display our heatmap, we're going to need some basic HTML with a canvas element:
35
36 <heat-tracer/public/heat_tracer.html>
37
38 Finally the JavaScript client which translates the raw streaming data into pretty picture:
39
40 <heat-tracer/public/heat_tracer_client.js>
41
622a639 @gflarity added a picture of Heat Tracer in action and polished up the article
gflarity authored
42 ## Run It!
50aa675 @gflarity initial revision of the Heat Tracer article
gflarity authored
43
622a639 @gflarity added a picture of Heat Tracer in action and polished up the article
gflarity authored
44 Run Heat Tacer with the following. Note, sudo is required by dtrace as it does kernal magic.
45
46 sudo node heat_tracer.js
47
48 If all goes well you should see something a moving version of something like the image below.
49
50 > ![Alt value of image](heat-tracer/heat_tracer.png)
50aa675 @gflarity initial revision of the Heat Tracer article
gflarity authored
51
622a639 @gflarity added a picture of Heat Tracer in action and polished up the article
gflarity authored
52 ## Contribute
53
54
55 You can find the latest version of Heat Tracer [here](https://github.com/gflarity/Heat-Tracer). It is my hope that this article will provide the ground work for a much more abitious performance analytics project. If you're interested in contributing please let me know.
56
57 ## Further Research
50aa675 @gflarity initial revision of the Heat Tracer article
gflarity authored
58
622a639 @gflarity added a picture of Heat Tracer in action and polished up the article
gflarity authored
59 More information about Bryan and Brendan's demo can be found [here](http://dtrace.org/blogs/brendan/2011/01/24/cloud-analytics-first-video/).
50aa675 @gflarity initial revision of the Heat Tracer article
gflarity authored
60
622a639 @gflarity added a picture of Heat Tracer in action and polished up the article
gflarity authored
61 Socket.IO can be found [here](http://socket.io/).
Something went wrong with that request. Please try again.