Netflix / falcor-router

A Falcor JavaScript DataSource which creates a Virtual JSON Graph document on your app server.
http://netflix.github.io/falcor
Apache License 2.0
104 stars 46 forks source link

feat(routeSummary): add route summary hook for gathering metrics and … #205

Closed benlesh closed 7 years ago

benlesh commented 7 years ago

…meta data from get

Adds the following options:

{
  hooks: {
    // OPTIONAL: A function that is called with information and timings from the request (get, set or call)
    //  currently only fired for `get` requests.
    routeSummary: function (data) {
    }
  },
  // OPTIONAL: A function used to get the `Date.now()` time for
  //      `routeSummary`. Defaults to using `Date.now()`.
  now: function () { }
}
benlesh commented 7 years ago

cc @lrowe

lrowe commented 7 years ago

Looks good to me, though perhaps we can come up with a different name for summaryContext since context is a rather overloaded term in Falcor already.

benlesh commented 7 years ago

@lrowe, sounds good. However since that's an internal implementation detail, I'm going to merge this so I can move on, and we can circle back to a name refactor.