BrandNewCongress / dashboard

0 stars 0 forks source link

Metrics Tracking Wrapper Library #6

Open traviskaufman opened 7 years ago

ben-pr-p commented 7 years ago

So the idea here is that this repository exports some wrapper functions for use throughout different BNC back-end repositories.

The API that comes to mind is

metrics.track('nomination', nominationData, callback)

but most of the time the callback will be empty, as the most common use case for this wrapper is

app.post('/nomination', (req, res) => 
  // do handling
  res.send(response)
  metrics.track('nomination', req.body)

where success doesn't matter and it's happening after the response