Skip to content

Instantly share code, notes, and snippets.

@mariusoe
Last active March 10, 2021 10:07
Show Gist options
  • Save mariusoe/aa78f99d4880b4521a28d632e3c1c202 to your computer and use it in GitHub Desktop.
Save mariusoe/aa78f99d4880b4521a28d632e3c1c202 to your computer and use it in GitHub Desktop.
inspectit:
instrumentation:
actions:
'a_get_size_of_stream':
imports:
- 'java.io.ByteArrayOutputStream'
input:
_arg1: Object
value-body: |
try {
ByteArrayOutputStream os = new ByteArrayOutputStream();
_arg1.writeTo(os);
return Integer.valueOf(os.size());
} catch (Throwable t) {
// ignored
return null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment