{"action":"created","issue":{"url":"https://api.github.com/repos/RuntimeTools/appmetrics/issues/46","labels_url":"https://api.github.com/repos/RuntimeTools/appmetrics/issues/46/labels{/name}","comments_url":"https://api.github.com/repos/RuntimeTools/appmetrics/issues/46/comments","events_url":"https://api.github.com/repos/RuntimeTools/appmetrics/issues/46/events","html_url":"https://github.com/RuntimeTools/appmetrics/issues/46","id":115882987,"number":46,"title":"Expose patched function name in aspects framework","user":{"login":"seabaylea","id":11974522,"avatar_url":"https://avatars.githubusercontent.com/u/11974522?v=3","gravatar_id":"","url":"https://api.github.com/users/seabaylea","html_url":"https://github.com/seabaylea","followers_url":"https://api.github.com/users/seabaylea/followers","following_url":"https://api.github.com/users/seabaylea/following{/other_user}","gists_url":"https://api.github.com/users/seabaylea/gists{/gist_id}","starred_url":"https://api.github.com/users/seabaylea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seabaylea/subscriptions","organizations_url":"https://api.github.com/users/seabaylea/orgs","repos_url":"https://api.github.com/users/seabaylea/repos","events_url":"https://api.github.com/users/seabaylea/events{/privacy}","received_events_url":"https://api.github.com/users/seabaylea/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/RuntimeTools/appmetrics/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"seabaylea","id":11974522,"avatar_url":"https://avatars.githubusercontent.com/u/11974522?v=3","gravatar_id":"","url":"https://api.github.com/users/seabaylea","html_url":"https://github.com/seabaylea","followers_url":"https://api.github.com/users/seabaylea/followers","following_url":"https://api.github.com/users/seabaylea/following{/other_user}","gists_url":"https://api.github.com/users/seabaylea/gists{/gist_id}","starred_url":"https://api.github.com/users/seabaylea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seabaylea/subscriptions","organizations_url":"https://api.github.com/users/seabaylea/orgs","repos_url":"https://api.github.com/users/seabaylea/repos","events_url":"https://api.github.com/users/seabaylea/events{/privacy}","received_events_url":"https://api.github.com/users/seabaylea/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/RuntimeTools/appmetrics/milestones/4","html_url":"https://github.com/RuntimeTools/appmetrics/milestones/1.0.4","labels_url":"https://api.github.com/repos/RuntimeTools/appmetrics/milestones/4/labels","id":1397998,"number":4,"title":"1.0.4","description":"","creator":{"login":"seabaylea","id":11974522,"avatar_url":"https://avatars.githubusercontent.com/u/11974522?v=3","gravatar_id":"","url":"https://api.github.com/users/seabaylea","html_url":"https://github.com/seabaylea","followers_url":"https://api.github.com/users/seabaylea/followers","following_url":"https://api.github.com/users/seabaylea/following{/other_user}","gists_url":"https://api.github.com/users/seabaylea/gists{/gist_id}","starred_url":"https://api.github.com/users/seabaylea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seabaylea/subscriptions","organizations_url":"https://api.github.com/users/seabaylea/orgs","repos_url":"https://api.github.com/users/seabaylea/repos","events_url":"https://api.github.com/users/seabaylea/events{/privacy}","received_events_url":"https://api.github.com/users/seabaylea/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":1,"state":"open","created_at":"2015-11-06T16:41:49Z","updated_at":"2015-11-10T12:56:06Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2015-11-09T14:07:20Z","updated_at":"2015-11-10T13:02:51Z","closed_at":null,"body":"The aspects patching framework allows you to specify an array of function names to patch. eg. for aspect.around:\r\n\r\n    var functionNames = [];\r\n    aspect.around(target.prototype, functionNames,\r\n        function(target, args) {},\r\n        function(target. args, rc) {}\r\n    );\r\n\r\nThis means you can patch multiple functions in the same way with the same code, but there's no way of knowing the name of the actual function that is running. This is useful if you want to add it to the raised monitoring event.\r\n\r\nPassing the function name through to the function callbacks as an additional (last) parameter provides access to the name of the function without breaking existing code, eg:\r\n\r\n    var functionNames = [];\r\n    aspect.around(target.prototype, functionNames,\r\n        function(target, args, funcName) {},\r\n        function(target. args, rc, funcName) {}\r\n    );\r\n"},"comment":{"url":"https://api.github.com/repos/RuntimeTools/appmetrics/issues/comments/155414015","html_url":"https://github.com/RuntimeTools/appmetrics/issues/46#issuecomment-155414015","issue_url":"https://api.github.com/repos/RuntimeTools/appmetrics/issues/46","id":155414015,"user":{"login":"tunniclm","id":5011883,"avatar_url":"https://avatars.githubusercontent.com/u/5011883?v=3","gravatar_id":"","url":"https://api.github.com/users/tunniclm","html_url":"https://github.com/tunniclm","followers_url":"https://api.github.com/users/tunniclm/followers","following_url":"https://api.github.com/users/tunniclm/following{/other_user}","gists_url":"https://api.github.com/users/tunniclm/gists{/gist_id}","starred_url":"https://api.github.com/users/tunniclm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tunniclm/subscriptions","organizations_url":"https://api.github.com/users/tunniclm/orgs","repos_url":"https://api.github.com/users/tunniclm/repos","events_url":"https://api.github.com/users/tunniclm/events{/privacy}","received_events_url":"https://api.github.com/users/tunniclm/received_events","type":"User","site_admin":false},"created_at":"2015-11-10T13:02:50Z","updated_at":"2015-11-10T13:02:50Z","body":"@seabaylea This approach seems reasonable to me, adding as the last argument should prevent breakage of existing usage code. "}}