{"action":"created","comment":{"url":"https://api.github.com/repos/4finance/micro-infra-spring/pulls/comments/33357923","id":33357923,"diff_hunk":"@@ -0,0 +1,154 @@\n+package com.ofg.infrastructure.web.resttemplate\n+\n+import com.codahale.metrics.MetricRegistry\n+import com.codahale.metrics.Timer\n+import com.ofg.infrastructure.base.MvcWiremockIntegrationSpec\n+import com.ofg.infrastructure.web.resttemplate.custom.RestTemplate\n+import com.ofg.infrastructure.web.resttemplate.fluent.ServiceRestClientConfiguration\n+import org.springframework.beans.factory.annotation.Autowired\n+import org.springframework.boot.test.SpringApplicationContextLoader\n+import org.springframework.context.annotation.Bean\n+import org.springframework.context.annotation.EnableAspectJAutoProxy\n+import org.springframework.context.support.PropertySourcesPlaceholderConfigurer\n+import org.springframework.core.ParameterizedTypeReference\n+import org.springframework.http.HttpEntity\n+import org.springframework.http.HttpMethod\n+import org.springframework.http.RequestEntity\n+import org.springframework.test.context.ContextConfiguration\n+import org.springframework.web.client.RequestCallback\n+import org.springframework.web.client.ResponseExtractor\n+import org.springframework.web.client.RestOperations\n+\n+import javax.annotation.Resource\n+import java.util.concurrent.Callable\n+\n+import static com.github.tomakehurst.wiremock.client.WireMock.*\n+\n+@ContextConfiguration(classes = [ServiceRestClientConfiguration, Config], loader = SpringApplicationContextLoader)\n+class MetricsAspectIntegrationSpec extends MvcWiremockIntegrationSpec {\n+\n+    @Resource\n+    RestOperations restTemplate\n+\n+    @Autowired\n+    MetricRegistry metricRegistry\n+\n+    URI wireMockUri\n+\n+    def setup() {\n+        wireMockUri = new URI(wireMockUrl)\n+        stubInteraction(any(urlMatching('/.*')), aResponse().withStatus(200))\n+    }\n+\n+    def 'should elide subsequent path parts in metric name'() {\n+        expect:","path":"micro-infra-spring-base/src/test/groovy/com/ofg/infrastructure/web/resttemplate/MetricsAspectIntegrationSpec.groovy","position":44,"original_position":44,"commit_id":"565b222f6166dbef30241cd2024c29931d4e0c75","original_commit_id":"565b222f6166dbef30241cd2024c29931d4e0c75","user":{"login":"szpak","id":148013,"avatar_url":"https://avatars.githubusercontent.com/u/148013?v=3","gravatar_id":"","url":"https://api.github.com/users/szpak","html_url":"https://github.com/szpak","followers_url":"https://api.github.com/users/szpak/followers","following_url":"https://api.github.com/users/szpak/following{/other_user}","gists_url":"https://api.github.com/users/szpak/gists{/gist_id}","starred_url":"https://api.github.com/users/szpak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szpak/subscriptions","organizations_url":"https://api.github.com/users/szpak/orgs","repos_url":"https://api.github.com/users/szpak/repos","events_url":"https://api.github.com/users/szpak/events{/privacy}","received_events_url":"https://api.github.com/users/szpak/received_events","type":"User","site_admin":false},"body":"Couldn't `where` be used here?","created_at":"2015-06-26T14:00:43Z","updated_at":"2015-06-26T14:00:43Z","html_url":"https://github.com/4finance/micro-infra-spring/pull/455#discussion_r33357923","pull_request_url":"https://api.github.com/repos/4finance/micro-infra-spring/pulls/455","_links":{"self":{"href":"https://api.github.com/repos/4finance/micro-infra-spring/pulls/comments/33357923"},"html":{"href":"https://github.com/4finance/micro-infra-spring/pull/455#discussion_r33357923"},"pull_request":{"href":"https://api.github.com/repos/4finance/micro-infra-spring/pulls/455"}}},"pull_request":{"url":"https://api.github.com/repos/4finance/micro-infra-spring/pulls/455","id":38155108,"html_url":"https://github.com/4finance/micro-infra-spring/pull/455","diff_url":"https://github.com/4finance/micro-infra-spring/pull/455.diff","patch_url":"https://github.com/4finance/micro-infra-spring/pull/455.patch","issue_url":"https://api.github.com/repos/4finance/micro-infra-spring/issues/455","number":455,"state":"open","locked":false,"title":"Improvements of metrics gathering for RestTemplate calls","user":{"login":"ArturGajowy","id":460141,"avatar_url":"https://avatars.githubusercontent.com/u/460141?v=3","gravatar_id":"","url":"https://api.github.com/users/ArturGajowy","html_url":"https://github.com/ArturGajowy","followers_url":"https://api.github.com/users/ArturGajowy/followers","following_url":"https://api.github.com/users/ArturGajowy/following{/other_user}","gists_url":"https://api.github.com/users/ArturGajowy/gists{/gist_id}","starred_url":"https://api.github.com/users/ArturGajowy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArturGajowy/subscriptions","organizations_url":"https://api.github.com/users/ArturGajowy/orgs","repos_url":"https://api.github.com/users/ArturGajowy/repos","events_url":"https://api.github.com/users/ArturGajowy/events{/privacy}","received_events_url":"https://api.github.com/users/ArturGajowy/received_events","type":"User","site_admin":false},"body":"- introduced 'rest.client.metrics.enabled' property (enabled by default) for toggling gathering of metrics for requests made with RestOperations instances\r\n- renamed MetricsAspect to RestOperationsMetricsAspect,\r\n- introduced UrlMetricNamer - a configurable collaborator Strategy of RestOperationsMetricsAspect used to determine a sensible (not containing dynamic parts) metric name for any URL used in a rest call\r\n- added RegexMatchingPathElidingURIMetricNamer as a default implementation,\r\n- Made RestOperationsMetricsAspect correctly intercept all methods of RestOperations, added integration test\r\n- added Utility methods for getting wireMock properties in MvcWiremockIntegrationSpec","created_at":"2015-06-19T22:52:26Z","updated_at":"2015-06-26T14:00:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ef7057e528a02551a63fb0336bba16df39f0984f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/4finance/micro-infra-spring/pulls/455/commits","review_comments_url":"https://api.github.com/repos/4finance/micro-infra-spring/pulls/455/comments","review_comment_url":"https://api.github.com/repos/4finance/micro-infra-spring/pulls/comments{/number}","comments_url":"https://api.github.com/repos/4finance/micro-infra-spring/issues/455/comments","statuses_url":"https://api.github.com/repos/4finance/micro-infra-spring/statuses/565b222f6166dbef30241cd2024c29931d4e0c75","head":{"label":"4finance:feature/rest-template-metrics-improvements","ref":"feature/rest-template-metrics-improvements","sha":"565b222f6166dbef30241cd2024c29931d4e0c75","user":{"login":"4finance","id":7083380,"avatar_url":"https://avatars.githubusercontent.com/u/7083380?v=3","gravatar_id":"","url":"https://api.github.com/users/4finance","html_url":"https://github.com/4finance","followers_url":"https://api.github.com/users/4finance/followers","following_url":"https://api.github.com/users/4finance/following{/other_user}","gists_url":"https://api.github.com/users/4finance/gists{/gist_id}","starred_url":"https://api.github.com/users/4finance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4finance/subscriptions","organizations_url":"https://api.github.com/users/4finance/orgs","repos_url":"https://api.github.com/users/4finance/repos","events_url":"https://api.github.com/users/4finance/events{/privacy}","received_events_url":"https://api.github.com/users/4finance/received_events","type":"Organization","site_admin":false},"repo":{"id":22647956,"name":"micro-infra-spring","full_name":"4finance/micro-infra-spring","owner":{"login":"4finance","id":7083380,"avatar_url":"https://avatars.githubusercontent.com/u/7083380?v=3","gravatar_id":"","url":"https://api.github.com/users/4finance","html_url":"https://github.com/4finance","followers_url":"https://api.github.com/users/4finance/followers","following_url":"https://api.github.com/users/4finance/following{/other_user}","gists_url":"https://api.github.com/users/4finance/gists{/gist_id}","starred_url":"https://api.github.com/users/4finance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4finance/subscriptions","organizations_url":"https://api.github.com/users/4finance/orgs","repos_url":"https://api.github.com/users/4finance/repos","events_url":"https://api.github.com/users/4finance/events{/privacy}","received_events_url":"https://api.github.com/users/4finance/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/4finance/micro-infra-spring","description":"Repository containing default microservice infrastructure set up using Spring configuration","fork":false,"url":"https://api.github.com/repos/4finance/micro-infra-spring","forks_url":"https://api.github.com/repos/4finance/micro-infra-spring/forks","keys_url":"https://api.github.com/repos/4finance/micro-infra-spring/keys{/key_id}","collaborators_url":"https://api.github.com/repos/4finance/micro-infra-spring/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/4finance/micro-infra-spring/teams","hooks_url":"https://api.github.com/repos/4finance/micro-infra-spring/hooks","issue_events_url":"https://api.github.com/repos/4finance/micro-infra-spring/issues/events{/number}","events_url":"https://api.github.com/repos/4finance/micro-infra-spring/events","assignees_url":"https://api.github.com/repos/4finance/micro-infra-spring/assignees{/user}","branches_url":"https://api.github.com/repos/4finance/micro-infra-spring/branches{/branch}","tags_url":"https://api.github.com/repos/4finance/micro-infra-spring/tags","blobs_url":"https://api.github.com/repos/4finance/micro-infra-spring/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/4finance/micro-infra-spring/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/4finance/micro-infra-spring/git/refs{/sha}","trees_url":"https://api.github.com/repos/4finance/micro-infra-spring/git/trees{/sha}","statuses_url":"https://api.github.com/repos/4finance/micro-infra-spring/statuses/{sha}","languages_url":"https://api.github.com/repos/4finance/micro-infra-spring/languages","stargazers_url":"https://api.github.com/repos/4finance/micro-infra-spring/stargazers","contributors_url":"https://api.github.com/repos/4finance/micro-infra-spring/contributors","subscribers_url":"https://api.github.com/repos/4finance/micro-infra-spring/subscribers","subscription_url":"https://api.github.com/repos/4finance/micro-infra-spring/subscription","commits_url":"https://api.github.com/repos/4finance/micro-infra-spring/commits{/sha}","git_commits_url":"https://api.github.com/repos/4finance/micro-infra-spring/git/commits{/sha}","comments_url":"https://api.github.com/repos/4finance/micro-infra-spring/comments{/number}","issue_comment_url":"https://api.github.com/repos/4finance/micro-infra-spring/issues/comments{/number}","contents_url":"https://api.github.com/repos/4finance/micro-infra-spring/contents/{+path}","compare_url":"https://api.github.com/repos/4finance/micro-infra-spring/compare/{base}...{head}","merges_url":"https://api.github.com/repos/4finance/micro-infra-spring/merges","archive_url":"https://api.github.com/repos/4finance/micro-infra-spring/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/4finance/micro-infra-spring/downloads","issues_url":"https://api.github.com/repos/4finance/micro-infra-spring/issues{/number}","pulls_url":"https://api.github.com/repos/4finance/micro-infra-spring/pulls{/number}","milestones_url":"https://api.github.com/repos/4finance/micro-infra-spring/milestones{/number}","notifications_url":"https://api.github.com/repos/4finance/micro-infra-spring/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/4finance/micro-infra-spring/labels{/name}","releases_url":"https://api.github.com/repos/4finance/micro-infra-spring/releases{/id}","created_at":"2014-08-05T15:07:55Z","updated_at":"2015-06-25T14:51:48Z","pushed_at":"2015-06-26T12:15:09Z","git_url":"git://github.com/4finance/micro-infra-spring.git","ssh_url":"git@github.com:4finance/micro-infra-spring.git","clone_url":"https://github.com/4finance/micro-infra-spring.git","svn_url":"https://github.com/4finance/micro-infra-spring","homepage":"","size":3798,"stargazers_count":109,"watchers_count":109,"language":"Groovy","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":73,"forks":21,"open_issues":73,"watchers":109,"default_branch":"master"}},"base":{"label":"4finance:master","ref":"master","sha":"76fc337fd2b4c20a04d7abeeda455467e68a0d94","user":{"login":"4finance","id":7083380,"avatar_url":"https://avatars.githubusercontent.com/u/7083380?v=3","gravatar_id":"","url":"https://api.github.com/users/4finance","html_url":"https://github.com/4finance","followers_url":"https://api.github.com/users/4finance/followers","following_url":"https://api.github.com/users/4finance/following{/other_user}","gists_url":"https://api.github.com/users/4finance/gists{/gist_id}","starred_url":"https://api.github.com/users/4finance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4finance/subscriptions","organizations_url":"https://api.github.com/users/4finance/orgs","repos_url":"https://api.github.com/users/4finance/repos","events_url":"https://api.github.com/users/4finance/events{/privacy}","received_events_url":"https://api.github.com/users/4finance/received_events","type":"Organization","site_admin":false},"repo":{"id":22647956,"name":"micro-infra-spring","full_name":"4finance/micro-infra-spring","owner":{"login":"4finance","id":7083380,"avatar_url":"https://avatars.githubusercontent.com/u/7083380?v=3","gravatar_id":"","url":"https://api.github.com/users/4finance","html_url":"https://github.com/4finance","followers_url":"https://api.github.com/users/4finance/followers","following_url":"https://api.github.com/users/4finance/following{/other_user}","gists_url":"https://api.github.com/users/4finance/gists{/gist_id}","starred_url":"https://api.github.com/users/4finance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4finance/subscriptions","organizations_url":"https://api.github.com/users/4finance/orgs","repos_url":"https://api.github.com/users/4finance/repos","events_url":"https://api.github.com/users/4finance/events{/privacy}","received_events_url":"https://api.github.com/users/4finance/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/4finance/micro-infra-spring","description":"Repository containing default microservice infrastructure set up using Spring configuration","fork":false,"url":"https://api.github.com/repos/4finance/micro-infra-spring","forks_url":"https://api.github.com/repos/4finance/micro-infra-spring/forks","keys_url":"https://api.github.com/repos/4finance/micro-infra-spring/keys{/key_id}","collaborators_url":"https://api.github.com/repos/4finance/micro-infra-spring/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/4finance/micro-infra-spring/teams","hooks_url":"https://api.github.com/repos/4finance/micro-infra-spring/hooks","issue_events_url":"https://api.github.com/repos/4finance/micro-infra-spring/issues/events{/number}","events_url":"https://api.github.com/repos/4finance/micro-infra-spring/events","assignees_url":"https://api.github.com/repos/4finance/micro-infra-spring/assignees{/user}","branches_url":"https://api.github.com/repos/4finance/micro-infra-spring/branches{/branch}","tags_url":"https://api.github.com/repos/4finance/micro-infra-spring/tags","blobs_url":"https://api.github.com/repos/4finance/micro-infra-spring/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/4finance/micro-infra-spring/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/4finance/micro-infra-spring/git/refs{/sha}","trees_url":"https://api.github.com/repos/4finance/micro-infra-spring/git/trees{/sha}","statuses_url":"https://api.github.com/repos/4finance/micro-infra-spring/statuses/{sha}","languages_url":"https://api.github.com/repos/4finance/micro-infra-spring/languages","stargazers_url":"https://api.github.com/repos/4finance/micro-infra-spring/stargazers","contributors_url":"https://api.github.com/repos/4finance/micro-infra-spring/contributors","subscribers_url":"https://api.github.com/repos/4finance/micro-infra-spring/subscribers","subscription_url":"https://api.github.com/repos/4finance/micro-infra-spring/subscription","commits_url":"https://api.github.com/repos/4finance/micro-infra-spring/commits{/sha}","git_commits_url":"https://api.github.com/repos/4finance/micro-infra-spring/git/commits{/sha}","comments_url":"https://api.github.com/repos/4finance/micro-infra-spring/comments{/number}","issue_comment_url":"https://api.github.com/repos/4finance/micro-infra-spring/issues/comments{/number}","contents_url":"https://api.github.com/repos/4finance/micro-infra-spring/contents/{+path}","compare_url":"https://api.github.com/repos/4finance/micro-infra-spring/compare/{base}...{head}","merges_url":"https://api.github.com/repos/4finance/micro-infra-spring/merges","archive_url":"https://api.github.com/repos/4finance/micro-infra-spring/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/4finance/micro-infra-spring/downloads","issues_url":"https://api.github.com/repos/4finance/micro-infra-spring/issues{/number}","pulls_url":"https://api.github.com/repos/4finance/micro-infra-spring/pulls{/number}","milestones_url":"https://api.github.com/repos/4finance/micro-infra-spring/milestones{/number}","notifications_url":"https://api.github.com/repos/4finance/micro-infra-spring/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/4finance/micro-infra-spring/labels{/name}","releases_url":"https://api.github.com/repos/4finance/micro-infra-spring/releases{/id}","created_at":"2014-08-05T15:07:55Z","updated_at":"2015-06-25T14:51:48Z","pushed_at":"2015-06-26T12:15:09Z","git_url":"git://github.com/4finance/micro-infra-spring.git","ssh_url":"git@github.com:4finance/micro-infra-spring.git","clone_url":"https://github.com/4finance/micro-infra-spring.git","svn_url":"https://github.com/4finance/micro-infra-spring","homepage":"","size":3798,"stargazers_count":109,"watchers_count":109,"language":"Groovy","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":73,"forks":21,"open_issues":73,"watchers":109,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/4finance/micro-infra-spring/pulls/455"},"html":{"href":"https://github.com/4finance/micro-infra-spring/pull/455"},"issue":{"href":"https://api.github.com/repos/4finance/micro-infra-spring/issues/455"},"comments":{"href":"https://api.github.com/repos/4finance/micro-infra-spring/issues/455/comments"},"review_comments":{"href":"https://api.github.com/repos/4finance/micro-infra-spring/pulls/455/comments"},"review_comment":{"href":"https://api.github.com/repos/4finance/micro-infra-spring/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/4finance/micro-infra-spring/pulls/455/commits"},"statuses":{"href":"https://api.github.com/repos/4finance/micro-infra-spring/statuses/565b222f6166dbef30241cd2024c29931d4e0c75"}}}}