Skip to content

Commit

Permalink
Adds profiling to changeHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
waldemarnt committed Mar 21, 2017
1 parent 0774aed commit 8639c38
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/events-reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,15 @@ module.exports = function (harvesterApp) {

return _.chain(changeHandlersPerResource)
.filter(function (changeHandler, resource) {
var regexProfileMessage = 'matchChangeHandler regex to cl ' + ns;
log.profile(regexProfileMessage);

var resourcePlural = inflect.pluralize(resource);
var regex = new RegExp('.*\\.' + resourcePlural + '$', 'i');
return regex.test(ns);
var testedRegex = regex.test(ns);

log.profile(regexProfileMessage);
return testedRegex;
})
.flatten()
.value();
Expand Down

0 comments on commit 8639c38

Please sign in to comment.