Tom Erickson's Weblog

Tom Erickson's Weblog

All | General

20081219 Friday December 19, 2008

 Chime Python Category

I just added a Python category to Chime, in addition to the Ruby category added earlier.

list of Python displays in main Chime window

A PHP category is coming soon. These are all scripts from the DTraceToolkit. Chime has gotten pretty flexible in terms of supporting script options, so I was able to merge the py_cpudist.d and py_cputime.d scripts into py_calldist.d and py_calltime.d, which differ only in measuring on-CPU time instead of elapsed time.

dialog prompting for elapsed time or on-CPU time

The prompt defaults to elapsed time. Here's a trace of a Mercurial command:

py_calltime display

It shows time in two ways side-by-side: the entire time from entry to return including time spent in other functions, and time in the current stack frame excluding time spent calling other functions. Here are some other displays showing total bytes allocated alongside a malloc() size distribution, by function and by stack trace.

py_malloc display py_mallocstk display

The tagged stack traces are viewable by accessing a right-click popup menu on one or more selected rows.

selected stack traces side by side in the stack viewer

So have fun tracing your Python apps! Chime is downloadable here.

( Dec 19 2008, 07:45:25 PM PST / Dec 19 2008, 07:45:25 PM PST ) Permalink
Trackback: http://blogs.sun.com/tomee/entry/chime_python_category

20081216 Tuesday December 16, 2008

 Chime Data Scrolling

As I was scrolling through output of the dtrace command recently, it struck me that the command line allowed me to do something I could not do with Chime: look back at recent data. It bothered me to see Chime at a disadvantage in terms of visibility, where it actually tries to excel over the command line.

To remedy this, I added controls to provide the equivalent of scrolling in a command terminal. Since Chime already has a scrollbar to view whatever part of the current aggregate snapshot doesn't fit in the window, it didn't make sense for a scrollbar to access previous snapshots as well. Instead I added forward and back buttons next to the pause button in the lower right corner.

System Calls with back and pause buttons enabled and forward button disabled

The forward button is disabled because we're normally looking at the most recent aggregate snapshot. I replaced the text of the pause button with an icon so that the button no longer changes width when switching the text from "Pause" to "Resume" and back. Changing the button width shifts the location of the forward and back buttons by the difference in width, whereas switching same-size icons leaves the buttons in place and also looks cleaner.

Clicking the back button automatically pauses the display and steps it to the previous aggregate snapshot.

System Calls with mouse pointer over back button and back, forward, and pause buttons enabled

Clicking the back button repeatedly moves the spark backward on the sparkline until reaching the oldest snapshot in the recent data cache.

System Calls with mouse pointer over disabled back button; forward and pause buttons enabled

I chose ten as the default limit of the recent data cache, since I didn't want to consume a lot of memory, and the most recent snapshots are usually all you want to see. If you want to be able to scroll back farther, you can set the number of steps in the recent data cache using the Options menu.

Main Chime Window with Set Recent Data Count ... selected in Options menu Set Recent Data Count dialog launched by menu item

While the display is paused, you can step forward and back through recent aggregate snapshots in a temporary copy of the cache. The actual cache continues to add new snapshots at the front and roll old snapshots off the back as data comes in. To resume the display of current data, click the pause/resume button (displaying the resume icon while paused).

Another convenience of the command line is that in the case of data drops, you can easily change option values and re-run the command. That convenience is next on my list of things to add to Chime.

Get the latest version of Chime (1.4.39) to try out the forward and back buttons (link here). The latest version also includes a large number of scripts from the DTraceToolkit, including a new Ruby category.

( Dec 16 2008, 02:29:53 PM PST / Dec 16 2008, 02:29:53 PM PST ) Permalink Comments [1]
Trackback: http://blogs.sun.com/tomee/entry/chime_data_scrolling


« December 2008 »
SunMonTueWedThuFriSat
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
17
18
20
21
22
23
24
25
26
27
28
29
30
31
   
       
Today


XML






Today's Page Hits: 54