facebookarchive / flashback

Capture and replay real mongodb workloads
Other
217 stars 72 forks source link

pcap_converter to output proper bson and added 'insert' operations #39

Closed timvaillancourt closed 7 years ago

timvaillancourt commented 8 years ago

As @tredman and I discussed in #38, this PR fixes the issue with pcap_converter outputting the older JSON-based format that the current go-based 'flashback' command did not recognise.

I also planned on adding any missing operations to the parser (it only parsed queries and commands), but I hit a wall with tmc/mongoproto missing functions for opDelete and opUpdate, so I'll come back with a 2nd PR to add deletes and updates. I was able to add 'insert' operations, however.

Summary of changes:

Lastly, I'm a golang noob who would love any pointers on my code. Fire away any suggestions!

timvaillancourt commented 7 years ago

Alright @tredman, I'm now using flashback.Op (with added 'omitempty' hints for anything except the required: "ts", "ns" and "op" fields) and plain funcs. I'm much happier with this now :)

tredman commented 7 years ago

LGTM. Thanks!