Add DServer::QueryEventSystem() command

This MR is quite large, but can be split into 3 pieces which might make it more digestible. I can split this into multiple MRs if that would be easier.

  1. For the implementation of the new commands, I have tried to avoid leaking any of the performance monitoring infrastructure into the API. This means I've put most of the performance monitoring objects into file static variables, which are local to the zmqeventsupplier.cpp and zmqeventconsumer.cpp files.

If anyone can think of anything else we should add to these commands, please speak up. Also, if you think I have named things in an unclear way, I am open to bike-shedding.

  1. To be able I have updated the Catch2 test infrastructure to support launching multiple device servers in the same context. I don't think this is the final API we will want for this feature, but this was the minimum I needed to write these tests.

For the new catch2_query_system tests, I am using the nlohmann json library to parse the command output. This is the same json library as is used by opentelemetry-cpp, so if you are building with telemetry enabled you should already have this. I setup the new query_event_system tests to be skipped if we cannot find the library, rather than making it a hard requirement for building the tests.

  1. As I am adding a new DServer command with this MR I have dutifully ported the cxx_cmd_query test to Catch2 as I needed to touch it. I slightly changed how this test works so that we query each command individually rather than using the output from command_list_query(). This is because I don't think that users should expect that command_list_query()[0] corresponds to the AddLoggingTarget command, and therefore our tests shouldn't either.

TODO:

  • Add documentation
  • Port cxx_cmd_query to catch2 and fix it to work with the new commands
  • Update (at least coverage) Linux images to have the JSON library I am using for the test

Closes #1403 (closed).

Edited by Thomas Ives

Merge request reports

Loading