This small set of changes will allow you to add the [gzip-true command-line parameter to the intrace javagent.
Once set, the agent will gzip all trace data and the UI un-gzips the data.
By default, this parameter is set to false and the new code will never execute.
GZip implementation came from a single java source file in the public domain: http://iharder.sourceforge.net/current/java/base64/
I added this .java to org.intrace.shared package.
This API is invoked in two places: NetworkDataSenderThread and NetworkDataReceiverThread.
See the new junit test org/intracetest/agent/CompressionTest.java for a rough idea of precisely how much smaller the gzipped trace messages are.
I opted not to add a GUI check box for compression to keep this enhancement less complicated.
Once a client connects to the agent, it discovers whether gzip is enabled or not. There is no switching between gzip-true and gzip-false while the connection is established.
The following details the manual testing done to verify this enhancement
I started the example.TraceExample program using these intrace arguments:
This small set of changes will allow you to add the [gzip-true command-line parameter to the intrace javagent. Once set, the agent will gzip all trace data and the UI un-gzips the data. By default, this parameter is set to false and the new code will never execute.
GZip implementation came from a single java source file in the public domain: http://iharder.sourceforge.net/current/java/base64/ I added this .java to org.intrace.shared package. This API is invoked in two places: NetworkDataSenderThread and NetworkDataReceiverThread.
See the new junit test org/intracetest/agent/CompressionTest.java for a rough idea of precisely how much smaller the gzipped trace messages are.
I opted not to add a GUI check box for compression to keep this enhancement less complicated. Once a client connects to the agent, it discovers whether gzip is enabled or not. There is no switching between gzip-true and gzip-false while the connection is established.
The following details the manual testing done to verify this enhancement
I started the example.TraceExample program using these intrace arguments:
Then I connected the InTrace GUI to 9123.
Then I get the port number of the trace connection (64097) as follows:
The above output showed me that I could trace on 64097.
So I started the capture with this:
Then I displayed the capture with this:
You can see the base64/gzip text below:
See the long string of ASCII that started with IAAAAA ?
That is roughly the start of the base64/gzip data
Then, I repeated the above testing without the new gzip compression.
I started the sample program like this:
But you can also omit the [gzip parameter and you will get the same result,
which is no gzip compression.