Skip to content

Instantly share code, notes, and snippets.

@dustin
Created September 12, 2011 19:32
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save dustin/6f73df27f67a7d123e63 to your computer and use it in GitHub Desktop.
Time between message send and process activation.
#
# We do have negative numbers here since we're running on multiple threads
# and it's possible, but rare that a message was sent to a process while we
# are scheduling that process for execution, causing small overlaps (up to
# 512ns or so in one case).
#
# With this, we don't know the amount of time it took to *receive* the
# message, but we know that it couldn't've been faster than the time it took
# to get the recipient on the CPU. I'll add a receive probe to get more info.
#
% dtrace -qn 'erlang*:::send { sent[copyinstr(arg1)] = timestamp } erlang*:::process_scheduled / sent[copyinstr(arg0)] / { @t = quantize(timestamp - sent[copyinstr(arg0)]); sent[copyinstr(arg0)] = 0;}'
value ------------- Distribution ------------- count
-1024 | 0
-512 | 1
-256 | 0
-128 | 0
-64 | 1
-32 | 1
-16 | 0
-8 | 0
-4 | 0
-2 | 0
-1 | 0
0 | 0
1 | 0
2 | 0
4 | 0
8 | 0
16 | 0
32 | 0
64 | 0
128 | 2
256 | 6
512 | 8
1024 | 26
2048 | 66
4096 |@@@@@ 17049
8192 |@@@@@@@@@@@@@@@@@@ 58315
16384 |@@@@@@@@@@ 31047
32768 |@@@ 10737
65536 |@ 3424
131072 |@ 1620
262144 | 1469
524288 |@ 1614
1048576 |@ 2016
2097152 | 151
4194304 | 53
8388608 | 47
16777216 | 34
33554432 | 44
67108864 | 26
134217728 | 28
268435456 | 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment