cachethq / core

🚦 The core of Cachet, the open-source status page system.
https://cachethq.io
MIT License
131 stars 26 forks source link

Implement Create Metric Points API #9

Closed jbrooksuk closed 1 year ago

jbrooksuk commented 1 year ago

The API needs implementing for creating metric points. This isn't super straightforward as we need to first check whether the last created point was within the metrics threshold and increment a counter instead. You can see the past implementation at https://github.com/cachethq/cachet/blob/f40da226670a92934170c1adcfff3d1c40a6096b/app/Bus/Handlers/Commands/Metric/CreateMetricPointCommandHandler.php#L80-L98

However, metrics should be considered an "expensive" operation and so, I think we should make use of the cache instead of querying the database each time.