mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-01 00:08:27 +01:00
add single toggle metric endpoint
This commit is contained in:
parent
5bf0b36588
commit
7513c045c1
@ -24,6 +24,17 @@ module.exports = function (app, config) {
|
||||
res.json(metrics.getTogglesMetrics());
|
||||
});
|
||||
|
||||
app.get('/client/metrics/feature-toggles/:name', (req, res) => {
|
||||
const name = req.params.name;
|
||||
const data = metrics.getTogglesMetrics();
|
||||
const lastHour = data.lastHour[name] || {};
|
||||
const lastMinute = data.lastMinute[name] || {};
|
||||
res.json({
|
||||
lastHour,
|
||||
lastMinute,
|
||||
});
|
||||
});
|
||||
|
||||
app.post('/client/metrics', (req, res) => {
|
||||
const data = req.body;
|
||||
const clientIp = req.ip;
|
||||
|
Loading…
Reference in New Issue
Block a user