{"action":"created","comment":{"url":"https://api.github.com/repos/apache/tomee/pulls/comments/236337860","pull_request_review_id":178393000,"id":236337860,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNjMzNzg2MA==","diff_hunk":"@@ -0,0 +1,151 @@\n+/**\n+ * Licensed to the Apache Software Foundation (ASF) under one or more\n+ * contributor license agreements.  See the NOTICE file distributed with\n+ * this work for additional information regarding copyright ownership.\n+ * The ASF licenses this file to You under the Apache License, Version 2.0\n+ * (the \"License\"); you may not use this file except in compliance with\n+ * the License.  You may obtain a copy of the License at\n+ * <p/>\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ * <p/>\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+import org.apache.cxf.jaxrs.client.WebClient;\n+import org.jboss.arquillian.container.test.api.Deployment;\n+import org.jboss.arquillian.junit.Arquillian;\n+import org.jboss.arquillian.test.api.ArquillianResource;\n+import org.jboss.shrinkwrap.api.ShrinkWrap;\n+import org.jboss.shrinkwrap.api.asset.StringAsset;\n+import org.jboss.shrinkwrap.api.spec.WebArchive;\n+import org.junit.Test;\n+import org.junit.runner.RunWith;\n+\n+import javax.json.Json;\n+import javax.json.JsonObject;\n+import javax.ws.rs.core.MediaType;\n+import javax.ws.rs.core.Response;\n+import java.io.StringReader;\n+import java.net.URL;\n+\n+import static org.junit.Assert.assertEquals;\n+import static org.junit.Assert.assertTrue;\n+\n+@RunWith(Arquillian.class)\n+public class WeatherServiceTest {\n+\n+    @Deployment(testable = false)\n+    public static WebArchive createDeployment() {\n+        final WebArchive webArchive = ShrinkWrap.create(WebArchive.class, \"test.war\")\n+                .addClass(WeatherService.class)\n+                .addAsWebInfResource(new StringAsset(\"<beans/>\"), \"beans.xml\");\n+        return webArchive;\n+    }\n+\n+    @ArquillianResource\n+    private URL base;\n+\n+    @Test\n+    public void testTimedMetric() {\n+        WebClient.create(base.toExternalForm())\n+                .path(\"/weather/day/status\")\n+                .get(String.class);\n+\n+        final String metricPath = \"/metrics/application/weather_day_status\";\n+        assertPrometheusFormat(metricPath);\n+        assertJsonFormat(metricPath);\n+    }\n+\n+    private void assertPrometheusFormat(final String metricPath) {\n+        final String metric = WebClient.create(base.toExternalForm())\n+                .path(metricPath)\n+                .accept(MediaType.TEXT_PLAIN)\n+                .get(String.class);\n+\n+        assertTrue(metric.contains(\"# TYPE application:weather_day_status_seconds summary timer\"));","path":"examples/mp-metrics-timed/src/test/java/WeatherServiceTest.java","position":null,"original_position":69,"commit_id":"30b75da997ad92822dd08d46830555ca0084787a","original_commit_id":"0d5c911f864b14d024836d2075f4cb1021c95863","user":{"login":"ivanjunckes","id":2260551,"node_id":"MDQ6VXNlcjIyNjA1NTE=","avatar_url":"https://avatars1.githubusercontent.com/u/2260551?v=4","gravatar_id":"","url":"https://api.github.com/users/ivanjunckes","html_url":"https://github.com/ivanjunckes","followers_url":"https://api.github.com/users/ivanjunckes/followers","following_url":"https://api.github.com/users/ivanjunckes/following{/other_user}","gists_url":"https://api.github.com/users/ivanjunckes/gists{/gist_id}","starred_url":"https://api.github.com/users/ivanjunckes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivanjunckes/subscriptions","organizations_url":"https://api.github.com/users/ivanjunckes/orgs","repos_url":"https://api.github.com/users/ivanjunckes/repos","events_url":"https://api.github.com/users/ivanjunckes/events{/privacy}","received_events_url":"https://api.github.com/users/ivanjunckes/received_events","type":"User","site_admin":false},"body":"I think keeping extra tests will not hurt :)","created_at":"2018-11-26T16:53:49Z","updated_at":"2018-11-26T16:53:49Z","html_url":"https://github.com/apache/tomee/pull/218#discussion_r236337860","pull_request_url":"https://api.github.com/repos/apache/tomee/pulls/218","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/apache/tomee/pulls/comments/236337860"},"html":{"href":"https://github.com/apache/tomee/pull/218#discussion_r236337860"},"pull_request":{"href":"https://api.github.com/repos/apache/tomee/pulls/218"}},"in_reply_to_id":236249672},"pull_request":{"url":"https://api.github.com/repos/apache/tomee/pulls/218","id":233261066,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMzMjYxMDY2","html_url":"https://github.com/apache/tomee/pull/218","diff_url":"https://github.com/apache/tomee/pull/218.diff","patch_url":"https://github.com/apache/tomee/pull/218.patch","issue_url":"https://api.github.com/repos/apache/tomee/issues/218","number":218,"state":"open","locked":false,"title":"TOMEE-2290 - Metrics timer example","user":{"login":"ivanjunckes","id":2260551,"node_id":"MDQ6VXNlcjIyNjA1NTE=","avatar_url":"https://avatars1.githubusercontent.com/u/2260551?v=4","gravatar_id":"","url":"https://api.github.com/users/ivanjunckes","html_url":"https://github.com/ivanjunckes","followers_url":"https://api.github.com/users/ivanjunckes/followers","following_url":"https://api.github.com/users/ivanjunckes/following{/other_user}","gists_url":"https://api.github.com/users/ivanjunckes/gists{/gist_id}","starred_url":"https://api.github.com/users/ivanjunckes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivanjunckes/subscriptions","organizations_url":"https://api.github.com/users/ivanjunckes/orgs","repos_url":"https://api.github.com/users/ivanjunckes/repos","events_url":"https://api.github.com/users/ivanjunckes/events{/privacy}","received_events_url":"https://api.github.com/users/ivanjunckes/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-11-23T18:11:11Z","updated_at":"2018-11-26T16:53:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a5b6062b3a8a5b7ac0c3d0123e74f077489cd3f6","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/tomee/pulls/218/commits","review_comments_url":"https://api.github.com/repos/apache/tomee/pulls/218/comments","review_comment_url":"https://api.github.com/repos/apache/tomee/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/tomee/issues/218/comments","statuses_url":"https://api.github.com/repos/apache/tomee/statuses/30b75da997ad92822dd08d46830555ca0084787a","head":{"label":"ivanjunckes:metrics-timed-example","ref":"metrics-timed-example","sha":"30b75da997ad92822dd08d46830555ca0084787a","user":{"login":"ivanjunckes","id":2260551,"node_id":"MDQ6VXNlcjIyNjA1NTE=","avatar_url":"https://avatars1.githubusercontent.com/u/2260551?v=4","gravatar_id":"","url":"https://api.github.com/users/ivanjunckes","html_url":"https://github.com/ivanjunckes","followers_url":"https://api.github.com/users/ivanjunckes/followers","following_url":"https://api.github.com/users/ivanjunckes/following{/other_user}","gists_url":"https://api.github.com/users/ivanjunckes/gists{/gist_id}","starred_url":"https://api.github.com/users/ivanjunckes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivanjunckes/subscriptions","organizations_url":"https://api.github.com/users/ivanjunckes/orgs","repos_url":"https://api.github.com/users/ivanjunckes/repos","events_url":"https://api.github.com/users/ivanjunckes/events{/privacy}","received_events_url":"https://api.github.com/users/ivanjunckes/received_events","type":"User","site_admin":false},"repo":{"id":61973849,"node_id":"MDEwOlJlcG9zaXRvcnk2MTk3Mzg0OQ==","name":"tomee","full_name":"ivanjunckes/tomee","private":false,"owner":{"login":"ivanjunckes","id":2260551,"node_id":"MDQ6VXNlcjIyNjA1NTE=","avatar_url":"https://avatars1.githubusercontent.com/u/2260551?v=4","gravatar_id":"","url":"https://api.github.com/users/ivanjunckes","html_url":"https://github.com/ivanjunckes","followers_url":"https://api.github.com/users/ivanjunckes/followers","following_url":"https://api.github.com/users/ivanjunckes/following{/other_user}","gists_url":"https://api.github.com/users/ivanjunckes/gists{/gist_id}","starred_url":"https://api.github.com/users/ivanjunckes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivanjunckes/subscriptions","organizations_url":"https://api.github.com/users/ivanjunckes/orgs","repos_url":"https://api.github.com/users/ivanjunckes/repos","events_url":"https://api.github.com/users/ivanjunckes/events{/privacy}","received_events_url":"https://api.github.com/users/ivanjunckes/received_events","type":"User","site_admin":false},"html_url":"https://github.com/ivanjunckes/tomee","description":"Mirror of Apache Tomee","fork":true,"url":"https://api.github.com/repos/ivanjunckes/tomee","forks_url":"https://api.github.com/repos/ivanjunckes/tomee/forks","keys_url":"https://api.github.com/repos/ivanjunckes/tomee/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ivanjunckes/tomee/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ivanjunckes/tomee/teams","hooks_url":"https://api.github.com/repos/ivanjunckes/tomee/hooks","issue_events_url":"https://api.github.com/repos/ivanjunckes/tomee/issues/events{/number}","events_url":"https://api.github.com/repos/ivanjunckes/tomee/events","assignees_url":"https://api.github.com/repos/ivanjunckes/tomee/assignees{/user}","branches_url":"https://api.github.com/repos/ivanjunckes/tomee/branches{/branch}","tags_url":"https://api.github.com/repos/ivanjunckes/tomee/tags","blobs_url":"https://api.github.com/repos/ivanjunckes/tomee/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ivanjunckes/tomee/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ivanjunckes/tomee/git/refs{/sha}","trees_url":"https://api.github.com/repos/ivanjunckes/tomee/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ivanjunckes/tomee/statuses/{sha}","languages_url":"https://api.github.com/repos/ivanjunckes/tomee/languages","stargazers_url":"https://api.github.com/repos/ivanjunckes/tomee/stargazers","contributors_url":"https://api.github.com/repos/ivanjunckes/tomee/contributors","subscribers_url":"https://api.github.com/repos/ivanjunckes/tomee/subscribers","subscription_url":"https://api.github.com/repos/ivanjunckes/tomee/subscription","commits_url":"https://api.github.com/repos/ivanjunckes/tomee/commits{/sha}","git_commits_url":"https://api.github.com/repos/ivanjunckes/tomee/git/commits{/sha}","comments_url":"https://api.github.com/repos/ivanjunckes/tomee/comments{/number}","issue_comment_url":"https://api.github.com/repos/ivanjunckes/tomee/issues/comments{/number}","contents_url":"https://api.github.com/repos/ivanjunckes/tomee/contents/{+path}","compare_url":"https://api.github.com/repos/ivanjunckes/tomee/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ivanjunckes/tomee/merges","archive_url":"https://api.github.com/repos/ivanjunckes/tomee/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ivanjunckes/tomee/downloads","issues_url":"https://api.github.com/repos/ivanjunckes/tomee/issues{/number}","pulls_url":"https://api.github.com/repos/ivanjunckes/tomee/pulls{/number}","milestones_url":"https://api.github.com/repos/ivanjunckes/tomee/milestones{/number}","notifications_url":"https://api.github.com/repos/ivanjunckes/tomee/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ivanjunckes/tomee/labels{/name}","releases_url":"https://api.github.com/repos/ivanjunckes/tomee/releases{/id}","deployments_url":"https://api.github.com/repos/ivanjunckes/tomee/deployments","created_at":"2016-06-26T04:37:52Z","updated_at":"2018-11-19T19:45:58Z","pushed_at":"2018-11-26T16:52:51Z","git_url":"git://github.com/ivanjunckes/tomee.git","ssh_url":"git@github.com:ivanjunckes/tomee.git","clone_url":"https://github.com/ivanjunckes/tomee.git","svn_url":"https://github.com/ivanjunckes/tomee","homepage":null,"size":60838,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"4a6183a11775933818eadba394d6e106d393df91","user":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":7748336,"node_id":"MDEwOlJlcG9zaXRvcnk3NzQ4MzM2","name":"tomee","full_name":"apache/tomee","private":false,"owner":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/apache/tomee","description":"Mirror of Apache Tomee","fork":false,"url":"https://api.github.com/repos/apache/tomee","forks_url":"https://api.github.com/repos/apache/tomee/forks","keys_url":"https://api.github.com/repos/apache/tomee/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/tomee/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/tomee/teams","hooks_url":"https://api.github.com/repos/apache/tomee/hooks","issue_events_url":"https://api.github.com/repos/apache/tomee/issues/events{/number}","events_url":"https://api.github.com/repos/apache/tomee/events","assignees_url":"https://api.github.com/repos/apache/tomee/assignees{/user}","branches_url":"https://api.github.com/repos/apache/tomee/branches{/branch}","tags_url":"https://api.github.com/repos/apache/tomee/tags","blobs_url":"https://api.github.com/repos/apache/tomee/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/tomee/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/tomee/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/tomee/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/tomee/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/tomee/languages","stargazers_url":"https://api.github.com/repos/apache/tomee/stargazers","contributors_url":"https://api.github.com/repos/apache/tomee/contributors","subscribers_url":"https://api.github.com/repos/apache/tomee/subscribers","subscription_url":"https://api.github.com/repos/apache/tomee/subscription","commits_url":"https://api.github.com/repos/apache/tomee/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/tomee/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/tomee/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/tomee/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/tomee/contents/{+path}","compare_url":"https://api.github.com/repos/apache/tomee/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/tomee/merges","archive_url":"https://api.github.com/repos/apache/tomee/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/tomee/downloads","issues_url":"https://api.github.com/repos/apache/tomee/issues{/number}","pulls_url":"https://api.github.com/repos/apache/tomee/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/tomee/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/tomee/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/tomee/labels{/name}","releases_url":"https://api.github.com/repos/apache/tomee/releases{/id}","deployments_url":"https://api.github.com/repos/apache/tomee/deployments","created_at":"2013-01-22T08:00:16Z","updated_at":"2018-11-26T15:02:35Z","pushed_at":"2018-11-26T16:52:54Z","git_url":"git://github.com/apache/tomee.git","ssh_url":"git@github.com:apache/tomee.git","clone_url":"https://github.com/apache/tomee.git","svn_url":"https://github.com/apache/tomee","homepage":null,"size":62539,"stargazers_count":238,"watchers_count":238,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":507,"mirror_url":null,"archived":false,"open_issues_count":42,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":507,"open_issues":42,"watchers":238,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/tomee/pulls/218"},"html":{"href":"https://github.com/apache/tomee/pull/218"},"issue":{"href":"https://api.github.com/repos/apache/tomee/issues/218"},"comments":{"href":"https://api.github.com/repos/apache/tomee/issues/218/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/tomee/pulls/218/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/tomee/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/tomee/pulls/218/commits"},"statuses":{"href":"https://api.github.com/repos/apache/tomee/statuses/30b75da997ad92822dd08d46830555ca0084787a"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ivanjunckes"}}