Project

General

Profile

Feature #4471

DTrace count() with histogram

Added by Rich Lowe about 6 years ago. Updated about 6 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
DTrace
Start date:
2014-01-14
Due date:
% Done:

90%

Estimated time:
Difficulty:
Medium
Tags:

Description

From the report at Joyent:

I'd like to print a count() aggregation with a histogram representation of the value. Histograms are commonly used to visualize other DTrace aggregations.

Here is an example use case:

# dtrace -n 'profile-99 /curthread->t_pri != -1/ { @[execname] = count(); }'
dtrace: description 'profile-99 ' matched 1 probe
^C

  beam.smp                                                          1
  cat                                                               1
  dtrace                                                            1
  intrd                                                             1
  rsyslogd                                                          1
  sed                                                               1
  zpool-zones                                                       1
  mysqld                                                            2
  locale                                                            6
  sshd                                                              7
  fsflush                                                          11
  node                                                             17
  unicorn                                                          24
  bash                                                            139
  qemu-system-x86_                                                223

Here's how it could be presented:

# dtrace -n 'profile-99 /curthread->t_pri != -1/ { @[execname] = hcount(); }'
dtrace: description 'profile-99 ' matched 1 probe
^C

  Key                     ------------- Distribution -------------      Count
  beam.smp                |                                                 1
  cat                     |                                                 1
  dtrace                  |                                                 1
  intrd                   |                                                 1
  rsyslogd                |                                                 1
  sed                     |                                                 1
  zpool-zones             |                                                 1
  mysqld                  |                                                 2
  locale                  |@                                                6
  sshd                    |@                                                7
  fsflush                 |@@                                              11
  node                    |@@                                              17
  unicorn                 |@@@                                             24
  bash                    |@@@@@@@@@@@@@@@@@@@                            139
  qemu-system-x86_        |@@@@@@@@@@@@@@@@@@@@@@@@@@@                    223

This could be a new printa() character, a different aggregation type (@hcount), or something else.

--

We are calling this "agghist"

History

#1

Updated by Rich Lowe about 6 years ago

  • Status changed from In Progress to Resolved
#2

Updated by Electric Monk about 6 years ago

git commit 33093f5bcdc51014933497dd39374080c1ac5705

Author: Bryan Cantrill <bryan@joyent.com>

4471 DTrace count() with histogram
4472 DTrace full width distribution histograms
4473 DTrace frequency trails
Reviewed by: Dan McDonald <danmcd@omniti.com>
Approved by: Gordon Ross <gwr@nexenta.com>

Also available in: Atom PDF