Skip to content

Instantly share code, notes, and snippets.

@szaydel
Created September 5, 2022 17:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save szaydel/effc91220805fb4cba9864e7e36cf147 to your computer and use it in GitHub Desktop.
Save szaydel/effc91220805fb4cba9864e7e36cf147 to your computer and use it in GitHub Desktop.
#!/usr/sbin/dtrace -Cs
#pragma D option quiet
#define NSECS_IN_MSEC 1000000
:zfs:dmu_tx_wait:entry {
self->in = timestamp;
self->spa = (string)((char *)args[0]->tx_pool->dp_spa->spa_name);
}
:zfs:dmu_tx_wait:return /self->in/ {
this->delta = timestamp - self->in;
@q[self->spa] = quantize(this->delta);
@max_delay[self->spa] = max(this->delta);
self->in = 0; self->spa = 0;
}
tick-5sec {
normalize(@max_delay, NSECS_IN_MSEC); /* convert nano to milliseconds */
printa("\t(%s) max delay: %@d(mS)%@d\n", @max_delay, @q);
trunc(@q); trunc(@max_delay);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment