Open mlouielu opened 6 years ago
Hi, thanks for your pull request! I can see that I should have some things cleaner in my code so that this would have been easier to implement. I'll do some refactoring as a result, but first, I have some questions/requests for changes to the pull request:
irtt_report.go
, please replace the condition and call to panic with a call to exitOnError(err, exitCodeRuntimeError)
cconfig.go
, can you find a clean way to share the same struct with MarshalJSON
?-o
flag can produce gzip'ed output. Please detect that and gunzip as necessary.ioutil.ReadFile
then using json.Unmarshal
, use json.Decoder
and take the data from an io.Reader
, to reduce memory consumption for large files.UnmarshalJSON
method, add UnmarshalJSON
methods for each nested type that needs it (ReceivedStats, StampAt, Clock, etc).UnmarshalJSON
for DurationStats
as it is if it works, but this is an example of where some refactoring would be useful. We're not restoring DurationStats
to its original state here, so this may be brittle after future changes.In case you don't get a chance to make these changes, I've added the report
command to the plans for version 0.9.2, but have some other work to do for 0.9.1 before I'll get to it. :)
This make irtt can reproduce the result and display on the screen from output json file