{"action":"created","comment":{"url":"https://api.github.com/repos/yahoo/fili/pulls/comments/166448710","pull_request_review_id":94512344,"id":166448710,"diff_hunk":"@@ -0,0 +1,124 @@\n+Parameterized Metric Support\n+============================\n+\n+Parameterized metrics are a subset of dynamic request metrics.  Specifically they focus on modifying the calculation of metrics by altering values used in the calculation of existing metrics or mapping their values at aggregation time.\n+\n+The expected contract of parameterized metrics is as follows: Given a base metric with api name `metricName`, it can be suffixed with a procedure-call list of keyword parameter names and values.  These values will be used in the calculation of the resulting new metric.\n+\n+So\n+```\n+\"metricName(parameterName=parameterValue)\"\n+```\n+\n+will result in a dynamic metric based on `metricName`, but substituting the parameter value when calculating it.  Also, the above string will be used as the column name in the resulting report response schema. \n+\n+Motivation\n+----------\n+\n+Standard metrics in Fili are configured at load time.  However if reporting requires many different similar caluclations, such as adjusting precision or converting values of different units into a shared aggregate, or applying custom metric filters, it may be impractical or even impossible to configure all the interesting report metrics.\n+\n+With parameterized metrics, open-ended variations may be supported for a given conceptual metric calculation, simplifying configuration and possibly unlocking otherwise impractical freedom in metric calculation.\n+\n+\n+The structure of a parameterized metric:\n+----------------------------------------\n+\n+```\n+metricName(parameterName=value)\n+```\n+\n+metricName -> an api metric name which should appear as a resource at the `/v1/metrics/metricName` endpoint.\n+\n+Balanced outer parentheses are the signal that a metric is to be processed as parameterized metric.  Imbalanced parentheses or unescaped internal parentheses will probably result in request errors.\n+\n+parameterName -> an identifier for a parameter supported by this metric.  Identifier names should follow the same format rules as api resource identifiers.\n+\n+value -> a value to be used for creating a modified version of baseMetric.  URL encoding may be required if some of the characters in the value contain special characters.  Escaping values containing ampersand is mandatory and it may also be necessary to encode values containing comma or parentheses depending on implementation.\n+\n+If multiple parameter names are used for this dimension they should be joined by commas with no intermediate spaces (similar to the filter value syntax)\n+\n+i.e.\n+\n+```\n+metricName(parameterName=value,otherParameter=otherValue)\n+```\n+\n+Response schema\n+---------------\n+\n+Unless aliasing is supported and used (see below), responses will use the full string of the metric expression as the column name for values resulting from parametrized metric evaluation.\n+\n+\n+Reserved parameter names\n+------------------------\n+\n+Two optional features which may be supported in some fili implementations are 'filter' and 'AS'.  These parameter names should be treated as reserved when configuring metrics.\n+\n+Dynamic aggregation filters, if supported, use the parameter name `filter`. Values will be parsed according to the same rules as the entries in the `filters` query parameter.  The expected behavior of the filter parameter is that rows in the base fact will not be aggregated unless the included filter is true.  This is potentially costly in performance and global filters should always be preferred to dynamic filters, if possible.\n+\n+The `AS` parameter name, if supported, will create an alias for the dynamic metric which will be used in the schema of the response as well as in the having clause of the request.\n+\n+Example:\n+\n+```\n+?metrics=users(filter,dim1|id-in['a','b'],AS=DimOneInAOrB)&having=DimOneInAOrB-gt[50]\n+```\n+\n+This would create a variation of the standard `users` aggregation which only counted users from records where the dimension `dim1` had values \"a\" or \"b\", and would display result rows only which for which this metric had at least 50 users.\n+\n+Parameterized Metric Metadata\n+=============================\n+\n+The metrics endpoint (and the corresponding serialization in the fullView format on the tables endpoint) will now contain an optional field for parameters.\n+\n+```\n+{ \n+    name:\"grossRevenue\",\n+    type:\"money\"\n+    parameters: {","path":"rfc/parameterizedMetrics.md","position":78,"original_position":78,"commit_id":"036665bdbece1224b4738daeac01e9760a0bc087","original_commit_id":"036665bdbece1224b4738daeac01e9760a0bc087","user":{"login":"michael-mclawhorn","id":4105159,"avatar_url":"https://avatars1.githubusercontent.com/u/4105159?v=4","gravatar_id":"","url":"https://api.github.com/users/michael-mclawhorn","html_url":"https://github.com/michael-mclawhorn","followers_url":"https://api.github.com/users/michael-mclawhorn/followers","following_url":"https://api.github.com/users/michael-mclawhorn/following{/other_user}","gists_url":"https://api.github.com/users/michael-mclawhorn/gists{/gist_id}","starred_url":"https://api.github.com/users/michael-mclawhorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michael-mclawhorn/subscriptions","organizations_url":"https://api.github.com/users/michael-mclawhorn/orgs","repos_url":"https://api.github.com/users/michael-mclawhorn/repos","events_url":"https://api.github.com/users/michael-mclawhorn/events{/privacy}","received_events_url":"https://api.github.com/users/michael-mclawhorn/received_events","type":"User","site_admin":false},"body":"we were going to use an object to create a clear key uniqueness.","created_at":"2018-02-06T21:32:23Z","updated_at":"2018-02-06T21:32:23Z","html_url":"https://github.com/yahoo/fili/pull/618#discussion_r166448710","pull_request_url":"https://api.github.com/repos/yahoo/fili/pulls/618","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/yahoo/fili/pulls/comments/166448710"},"html":{"href":"https://github.com/yahoo/fili/pull/618#discussion_r166448710"},"pull_request":{"href":"https://api.github.com/repos/yahoo/fili/pulls/618"}},"in_reply_to_id":164897768},"pull_request":{"url":"https://api.github.com/repos/yahoo/fili/pulls/618","id":166102719,"html_url":"https://github.com/yahoo/fili/pull/618","diff_url":"https://github.com/yahoo/fili/pull/618.diff","patch_url":"https://github.com/yahoo/fili/pull/618.patch","issue_url":"https://api.github.com/repos/yahoo/fili/issues/618","number":618,"state":"open","locked":false,"title":"Parameterized metric design","user":{"login":"michael-mclawhorn","id":4105159,"avatar_url":"https://avatars1.githubusercontent.com/u/4105159?v=4","gravatar_id":"","url":"https://api.github.com/users/michael-mclawhorn","html_url":"https://github.com/michael-mclawhorn","followers_url":"https://api.github.com/users/michael-mclawhorn/followers","following_url":"https://api.github.com/users/michael-mclawhorn/following{/other_user}","gists_url":"https://api.github.com/users/michael-mclawhorn/gists{/gist_id}","starred_url":"https://api.github.com/users/michael-mclawhorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michael-mclawhorn/subscriptions","organizations_url":"https://api.github.com/users/michael-mclawhorn/orgs","repos_url":"https://api.github.com/users/michael-mclawhorn/repos","events_url":"https://api.github.com/users/michael-mclawhorn/events{/privacy}","received_events_url":"https://api.github.com/users/michael-mclawhorn/received_events","type":"User","site_admin":false},"body":"The proposal for parameterized metrics.\r\nPlease review.\r\nThis proposal may close as soon at Monday, Feb 5th, 2018 if all feedback has been successfully responded to.\r\n","created_at":"2018-01-30T21:30:50Z","updated_at":"2018-02-06T21:32:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"da758c78c9edd8e8832daa015b2a9831f297b514","assignee":null,"assignees":[],"requested_reviewers":[{"login":"asifmansoora","id":4197663,"avatar_url":"https://avatars2.githubusercontent.com/u/4197663?v=4","gravatar_id":"","url":"https://api.github.com/users/asifmansoora","html_url":"https://github.com/asifmansoora","followers_url":"https://api.github.com/users/asifmansoora/followers","following_url":"https://api.github.com/users/asifmansoora/following{/other_user}","gists_url":"https://api.github.com/users/asifmansoora/gists{/gist_id}","starred_url":"https://api.github.com/users/asifmansoora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asifmansoora/subscriptions","organizations_url":"https://api.github.com/users/asifmansoora/orgs","repos_url":"https://api.github.com/users/asifmansoora/repos","events_url":"https://api.github.com/users/asifmansoora/events{/privacy}","received_events_url":"https://api.github.com/users/asifmansoora/received_events","type":"User","site_admin":false},{"login":"aklish","id":6979393,"avatar_url":"https://avatars1.githubusercontent.com/u/6979393?v=4","gravatar_id":"","url":"https://api.github.com/users/aklish","html_url":"https://github.com/aklish","followers_url":"https://api.github.com/users/aklish/followers","following_url":"https://api.github.com/users/aklish/following{/other_user}","gists_url":"https://api.github.com/users/aklish/gists{/gist_id}","starred_url":"https://api.github.com/users/aklish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aklish/subscriptions","organizations_url":"https://api.github.com/users/aklish/orgs","repos_url":"https://api.github.com/users/aklish/repos","events_url":"https://api.github.com/users/aklish/events{/privacy}","received_events_url":"https://api.github.com/users/aklish/received_events","type":"User","site_admin":false},{"login":"garyluoex","id":13069957,"avatar_url":"https://avatars3.githubusercontent.com/u/13069957?v=4","gravatar_id":"","url":"https://api.github.com/users/garyluoex","html_url":"https://github.com/garyluoex","followers_url":"https://api.github.com/users/garyluoex/followers","following_url":"https://api.github.com/users/garyluoex/following{/other_user}","gists_url":"https://api.github.com/users/garyluoex/gists{/gist_id}","starred_url":"https://api.github.com/users/garyluoex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garyluoex/subscriptions","organizations_url":"https://api.github.com/users/garyluoex/orgs","repos_url":"https://api.github.com/users/garyluoex/repos","events_url":"https://api.github.com/users/garyluoex/events{/privacy}","received_events_url":"https://api.github.com/users/garyluoex/received_events","type":"User","site_admin":false}],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/yahoo/fili/pulls/618/commits","review_comments_url":"https://api.github.com/repos/yahoo/fili/pulls/618/comments","review_comment_url":"https://api.github.com/repos/yahoo/fili/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yahoo/fili/issues/618/comments","statuses_url":"https://api.github.com/repos/yahoo/fili/statuses/036665bdbece1224b4738daeac01e9760a0bc087","head":{"label":"yahoo:RFCforDynamicMetrics","ref":"RFCforDynamicMetrics","sha":"036665bdbece1224b4738daeac01e9760a0bc087","user":{"login":"yahoo","id":16574,"avatar_url":"https://avatars1.githubusercontent.com/u/16574?v=4","gravatar_id":"","url":"https://api.github.com/users/yahoo","html_url":"https://github.com/yahoo","followers_url":"https://api.github.com/users/yahoo/followers","following_url":"https://api.github.com/users/yahoo/following{/other_user}","gists_url":"https://api.github.com/users/yahoo/gists{/gist_id}","starred_url":"https://api.github.com/users/yahoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yahoo/subscriptions","organizations_url":"https://api.github.com/users/yahoo/orgs","repos_url":"https://api.github.com/users/yahoo/repos","events_url":"https://api.github.com/users/yahoo/events{/privacy}","received_events_url":"https://api.github.com/users/yahoo/received_events","type":"Organization","site_admin":false},"repo":{"id":60879636,"name":"fili","full_name":"yahoo/fili","owner":{"login":"yahoo","id":16574,"avatar_url":"https://avatars1.githubusercontent.com/u/16574?v=4","gravatar_id":"","url":"https://api.github.com/users/yahoo","html_url":"https://github.com/yahoo","followers_url":"https://api.github.com/users/yahoo/followers","following_url":"https://api.github.com/users/yahoo/following{/other_user}","gists_url":"https://api.github.com/users/yahoo/gists{/gist_id}","starred_url":"https://api.github.com/users/yahoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yahoo/subscriptions","organizations_url":"https://api.github.com/users/yahoo/orgs","repos_url":"https://api.github.com/users/yahoo/repos","events_url":"https://api.github.com/users/yahoo/events{/privacy}","received_events_url":"https://api.github.com/users/yahoo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yahoo/fili","description":"Easily make RESTful web services for time series reporting with Big Data analytics engines like Druid and Hive.","fork":false,"url":"https://api.github.com/repos/yahoo/fili","forks_url":"https://api.github.com/repos/yahoo/fili/forks","keys_url":"https://api.github.com/repos/yahoo/fili/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yahoo/fili/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yahoo/fili/teams","hooks_url":"https://api.github.com/repos/yahoo/fili/hooks","issue_events_url":"https://api.github.com/repos/yahoo/fili/issues/events{/number}","events_url":"https://api.github.com/repos/yahoo/fili/events","assignees_url":"https://api.github.com/repos/yahoo/fili/assignees{/user}","branches_url":"https://api.github.com/repos/yahoo/fili/branches{/branch}","tags_url":"https://api.github.com/repos/yahoo/fili/tags","blobs_url":"https://api.github.com/repos/yahoo/fili/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yahoo/fili/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yahoo/fili/git/refs{/sha}","trees_url":"https://api.github.com/repos/yahoo/fili/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yahoo/fili/statuses/{sha}","languages_url":"https://api.github.com/repos/yahoo/fili/languages","stargazers_url":"https://api.github.com/repos/yahoo/fili/stargazers","contributors_url":"https://api.github.com/repos/yahoo/fili/contributors","subscribers_url":"https://api.github.com/repos/yahoo/fili/subscribers","subscription_url":"https://api.github.com/repos/yahoo/fili/subscription","commits_url":"https://api.github.com/repos/yahoo/fili/commits{/sha}","git_commits_url":"https://api.github.com/repos/yahoo/fili/git/commits{/sha}","comments_url":"https://api.github.com/repos/yahoo/fili/comments{/number}","issue_comment_url":"https://api.github.com/repos/yahoo/fili/issues/comments{/number}","contents_url":"https://api.github.com/repos/yahoo/fili/contents/{+path}","compare_url":"https://api.github.com/repos/yahoo/fili/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yahoo/fili/merges","archive_url":"https://api.github.com/repos/yahoo/fili/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yahoo/fili/downloads","issues_url":"https://api.github.com/repos/yahoo/fili/issues{/number}","pulls_url":"https://api.github.com/repos/yahoo/fili/pulls{/number}","milestones_url":"https://api.github.com/repos/yahoo/fili/milestones{/number}","notifications_url":"https://api.github.com/repos/yahoo/fili/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yahoo/fili/labels{/name}","releases_url":"https://api.github.com/repos/yahoo/fili/releases{/id}","deployments_url":"https://api.github.com/repos/yahoo/fili/deployments","created_at":"2016-06-10T22:07:59Z","updated_at":"2018-02-06T07:52:27Z","pushed_at":"2018-02-02T18:21:13Z","git_url":"git://github.com/yahoo/fili.git","ssh_url":"git@github.com:yahoo/fili.git","clone_url":"https://github.com/yahoo/fili.git","svn_url":"https://github.com/yahoo/fili","homepage":"","size":9220,"stargazers_count":71,"watchers_count":71,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":48,"mirror_url":null,"archived":false,"open_issues_count":189,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":48,"open_issues":189,"watchers":71,"default_branch":"master"}},"base":{"label":"yahoo:master","ref":"master","sha":"80ecc0795ac76f14432e71476afbe3b6ea9422b0","user":{"login":"yahoo","id":16574,"avatar_url":"https://avatars1.githubusercontent.com/u/16574?v=4","gravatar_id":"","url":"https://api.github.com/users/yahoo","html_url":"https://github.com/yahoo","followers_url":"https://api.github.com/users/yahoo/followers","following_url":"https://api.github.com/users/yahoo/following{/other_user}","gists_url":"https://api.github.com/users/yahoo/gists{/gist_id}","starred_url":"https://api.github.com/users/yahoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yahoo/subscriptions","organizations_url":"https://api.github.com/users/yahoo/orgs","repos_url":"https://api.github.com/users/yahoo/repos","events_url":"https://api.github.com/users/yahoo/events{/privacy}","received_events_url":"https://api.github.com/users/yahoo/received_events","type":"Organization","site_admin":false},"repo":{"id":60879636,"name":"fili","full_name":"yahoo/fili","owner":{"login":"yahoo","id":16574,"avatar_url":"https://avatars1.githubusercontent.com/u/16574?v=4","gravatar_id":"","url":"https://api.github.com/users/yahoo","html_url":"https://github.com/yahoo","followers_url":"https://api.github.com/users/yahoo/followers","following_url":"https://api.github.com/users/yahoo/following{/other_user}","gists_url":"https://api.github.com/users/yahoo/gists{/gist_id}","starred_url":"https://api.github.com/users/yahoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yahoo/subscriptions","organizations_url":"https://api.github.com/users/yahoo/orgs","repos_url":"https://api.github.com/users/yahoo/repos","events_url":"https://api.github.com/users/yahoo/events{/privacy}","received_events_url":"https://api.github.com/users/yahoo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yahoo/fili","description":"Easily make RESTful web services for time series reporting with Big Data analytics engines like Druid and Hive.","fork":false,"url":"https://api.github.com/repos/yahoo/fili","forks_url":"https://api.github.com/repos/yahoo/fili/forks","keys_url":"https://api.github.com/repos/yahoo/fili/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yahoo/fili/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yahoo/fili/teams","hooks_url":"https://api.github.com/repos/yahoo/fili/hooks","issue_events_url":"https://api.github.com/repos/yahoo/fili/issues/events{/number}","events_url":"https://api.github.com/repos/yahoo/fili/events","assignees_url":"https://api.github.com/repos/yahoo/fili/assignees{/user}","branches_url":"https://api.github.com/repos/yahoo/fili/branches{/branch}","tags_url":"https://api.github.com/repos/yahoo/fili/tags","blobs_url":"https://api.github.com/repos/yahoo/fili/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yahoo/fili/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yahoo/fili/git/refs{/sha}","trees_url":"https://api.github.com/repos/yahoo/fili/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yahoo/fili/statuses/{sha}","languages_url":"https://api.github.com/repos/yahoo/fili/languages","stargazers_url":"https://api.github.com/repos/yahoo/fili/stargazers","contributors_url":"https://api.github.com/repos/yahoo/fili/contributors","subscribers_url":"https://api.github.com/repos/yahoo/fili/subscribers","subscription_url":"https://api.github.com/repos/yahoo/fili/subscription","commits_url":"https://api.github.com/repos/yahoo/fili/commits{/sha}","git_commits_url":"https://api.github.com/repos/yahoo/fili/git/commits{/sha}","comments_url":"https://api.github.com/repos/yahoo/fili/comments{/number}","issue_comment_url":"https://api.github.com/repos/yahoo/fili/issues/comments{/number}","contents_url":"https://api.github.com/repos/yahoo/fili/contents/{+path}","compare_url":"https://api.github.com/repos/yahoo/fili/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yahoo/fili/merges","archive_url":"https://api.github.com/repos/yahoo/fili/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yahoo/fili/downloads","issues_url":"https://api.github.com/repos/yahoo/fili/issues{/number}","pulls_url":"https://api.github.com/repos/yahoo/fili/pulls{/number}","milestones_url":"https://api.github.com/repos/yahoo/fili/milestones{/number}","notifications_url":"https://api.github.com/repos/yahoo/fili/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yahoo/fili/labels{/name}","releases_url":"https://api.github.com/repos/yahoo/fili/releases{/id}","deployments_url":"https://api.github.com/repos/yahoo/fili/deployments","created_at":"2016-06-10T22:07:59Z","updated_at":"2018-02-06T07:52:27Z","pushed_at":"2018-02-02T18:21:13Z","git_url":"git://github.com/yahoo/fili.git","ssh_url":"git@github.com:yahoo/fili.git","clone_url":"https://github.com/yahoo/fili.git","svn_url":"https://github.com/yahoo/fili","homepage":"","size":9220,"stargazers_count":71,"watchers_count":71,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":48,"mirror_url":null,"archived":false,"open_issues_count":189,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":48,"open_issues":189,"watchers":71,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yahoo/fili/pulls/618"},"html":{"href":"https://github.com/yahoo/fili/pull/618"},"issue":{"href":"https://api.github.com/repos/yahoo/fili/issues/618"},"comments":{"href":"https://api.github.com/repos/yahoo/fili/issues/618/comments"},"review_comments":{"href":"https://api.github.com/repos/yahoo/fili/pulls/618/comments"},"review_comment":{"href":"https://api.github.com/repos/yahoo/fili/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yahoo/fili/pulls/618/commits"},"statuses":{"href":"https://api.github.com/repos/yahoo/fili/statuses/036665bdbece1224b4738daeac01e9760a0bc087"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"michael-mclawhorn"}}