teragrep / aer_01

Azure EventHub to syslog bridge
GNU Affero General Public License v3.0
0 stars 3 forks source link

Metrics for monitoring endpoints #24

Open 51-code opened 1 month ago

51-code commented 1 month ago

Fixes #8

Added metrics for:

Dropwizard setup was inspired by CFE-35 Router.java

Needs to be tested, but this is the initial code.

UPDATE: Tests done!

kortemik commented 1 month ago

@StrongestNumber9 please check this out

51-code commented 1 month ago

Discussed with @kortemik that an EventContextFactory can be implemented for unit testing. When producing new events with the factory, we can then call EventContextConsumer's accept() function and test the metrics by getting the Gauge's and asserting the correct value of getValue(). Later the factory can be used for testing the class's other functionality as well.

I'll start working on developing this and I will add it to the PR when ready.

51-code commented 1 month ago

Added testing for the metrics and fixed the issues that came up in the first round of review.

Made a fake object for the Output to get rid of dependencies of the EventContextConsumer object, and the class was refactored with a few new constructors to allow this fake to be injected. Fakes were also done for multiple objects in Azure library for creating "data" for the object, the CheckPointlessEventContextFactory is responsible for data creation.

51-code commented 1 month ago

Ready with all the required fixes. @kortemik @StrongestNumber9