We currently do not support parsing the custom datagrams that DogStatsD support, i.e. service checks and events. Note that we are perfectly able to send them. But if we capture them, we cannot parse them. This is mostly a problem for test suites that want to run assertions on properties of the datagrams.
This PR implements parsing the datagrams by subclassing Datagram, add regular expressions for those datagram types, and use Regexp.union to construct a parser that supports all of the datagrams.
Note: we only support parsing datagrams as generated by this library, not necessarily every datagram out there. Given the use case, that is fine I think.
We currently do not support parsing the custom datagrams that DogStatsD support, i.e. service checks and events. Note that we are perfectly able to send them. But if we capture them, we cannot parse them. This is mostly a problem for test suites that want to run assertions on properties of the datagrams.
This PR implements parsing the datagrams by subclassing Datagram, add regular expressions for those datagram types, and use
Regexp.union
to construct a parser that supports all of the datagrams.Note: we only support parsing datagrams as generated by this library, not necessarily every datagram out there. Given the use case, that is fine I think.