{"action":"created","issue":{"url":"https://api.github.com/repos/census-instrumentation/opencensus-java/issues/676","repository_url":"https://api.github.com/repos/census-instrumentation/opencensus-java","labels_url":"https://api.github.com/repos/census-instrumentation/opencensus-java/issues/676/labels{/name}","comments_url":"https://api.github.com/repos/census-instrumentation/opencensus-java/issues/676/comments","events_url":"https://api.github.com/repos/census-instrumentation/opencensus-java/issues/676/events","html_url":"https://github.com/census-instrumentation/opencensus-java/pull/676","id":260797386,"number":676,"title":"Move MeasureMap from the API to the implementation.","user":{"login":"sebright","id":19807615,"avatar_url":"https://avatars0.githubusercontent.com/u/19807615?v=4","gravatar_id":"","url":"https://api.github.com/users/sebright","html_url":"https://github.com/sebright","followers_url":"https://api.github.com/users/sebright/followers","following_url":"https://api.github.com/users/sebright/following{/other_user}","gists_url":"https://api.github.com/users/sebright/gists{/gist_id}","starred_url":"https://api.github.com/users/sebright/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebright/subscriptions","organizations_url":"https://api.github.com/users/sebright/orgs","repos_url":"https://api.github.com/users/sebright/repos","events_url":"https://api.github.com/users/sebright/events{/privacy}","received_events_url":"https://api.github.com/users/sebright/received_events","type":"User","site_admin":false},"labels":[{"id":566180716,"url":"https://api.github.com/repos/census-instrumentation/opencensus-java/labels/API","name":"API","color":"cc11aa","default":false},{"id":616301408,"url":"https://api.github.com/repos/census-instrumentation/opencensus-java/labels/cla:%20yes","name":"cla: yes","color":"0e8a16","default":false},{"id":528872031,"url":"https://api.github.com/repos/census-instrumentation/opencensus-java/labels/discussion","name":"discussion","color":"666bff","default":false},{"id":566180202,"url":"https://api.github.com/repos/census-instrumentation/opencensus-java/labels/stats","name":"stats","color":"9919ff","default":false}],"state":"open","locked":false,"assignee":{"login":"bogdandrutu","id":1373887,"avatar_url":"https://avatars0.githubusercontent.com/u/1373887?v=4","gravatar_id":"","url":"https://api.github.com/users/bogdandrutu","html_url":"https://github.com/bogdandrutu","followers_url":"https://api.github.com/users/bogdandrutu/followers","following_url":"https://api.github.com/users/bogdandrutu/following{/other_user}","gists_url":"https://api.github.com/users/bogdandrutu/gists{/gist_id}","starred_url":"https://api.github.com/users/bogdandrutu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bogdandrutu/subscriptions","organizations_url":"https://api.github.com/users/bogdandrutu/orgs","repos_url":"https://api.github.com/users/bogdandrutu/repos","events_url":"https://api.github.com/users/bogdandrutu/events{/privacy}","received_events_url":"https://api.github.com/users/bogdandrutu/received_events","type":"User","site_admin":false},"assignees":[{"login":"bogdandrutu","id":1373887,"avatar_url":"https://avatars0.githubusercontent.com/u/1373887?v=4","gravatar_id":"","url":"https://api.github.com/users/bogdandrutu","html_url":"https://github.com/bogdandrutu","followers_url":"https://api.github.com/users/bogdandrutu/followers","following_url":"https://api.github.com/users/bogdandrutu/following{/other_user}","gists_url":"https://api.github.com/users/bogdandrutu/gists{/gist_id}","starred_url":"https://api.github.com/users/bogdandrutu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bogdandrutu/subscriptions","organizations_url":"https://api.github.com/users/bogdandrutu/orgs","repos_url":"https://api.github.com/users/bogdandrutu/repos","events_url":"https://api.github.com/users/bogdandrutu/events{/privacy}","received_events_url":"https://api.github.com/users/bogdandrutu/received_events","type":"User","site_admin":false},{"login":"dinooliva","id":12284450,"avatar_url":"https://avatars1.githubusercontent.com/u/12284450?v=4","gravatar_id":"","url":"https://api.github.com/users/dinooliva","html_url":"https://github.com/dinooliva","followers_url":"https://api.github.com/users/dinooliva/followers","following_url":"https://api.github.com/users/dinooliva/following{/other_user}","gists_url":"https://api.github.com/users/dinooliva/gists{/gist_id}","starred_url":"https://api.github.com/users/dinooliva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dinooliva/subscriptions","organizations_url":"https://api.github.com/users/dinooliva/orgs","repos_url":"https://api.github.com/users/dinooliva/repos","events_url":"https://api.github.com/users/dinooliva/events{/privacy}","received_events_url":"https://api.github.com/users/dinooliva/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/census-instrumentation/opencensus-java/milestones/6","html_url":"https://github.com/census-instrumentation/opencensus-java/milestone/6","labels_url":"https://api.github.com/repos/census-instrumentation/opencensus-java/milestones/6/labels","id":2707786,"number":6,"title":"Initial stats API release","description":"This milestone covers everything that should be finished before the stats API classes are moved into the `api` directory in preparation for a release.","creator":{"login":"sebright","id":19807615,"avatar_url":"https://avatars0.githubusercontent.com/u/19807615?v=4","gravatar_id":"","url":"https://api.github.com/users/sebright","html_url":"https://github.com/sebright","followers_url":"https://api.github.com/users/sebright/followers","following_url":"https://api.github.com/users/sebright/following{/other_user}","gists_url":"https://api.github.com/users/sebright/gists{/gist_id}","starred_url":"https://api.github.com/users/sebright/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebright/subscriptions","organizations_url":"https://api.github.com/users/sebright/orgs","repos_url":"https://api.github.com/users/sebright/repos","events_url":"https://api.github.com/users/sebright/events{/privacy}","received_events_url":"https://api.github.com/users/sebright/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":23,"state":"open","created_at":"2017-08-17T17:07:44Z","updated_at":"2017-10-18T22:42:12Z","due_on":"2018-10-27T07:00:00Z","closed_at":null},"comments":12,"created_at":"2017-09-26T23:08:18Z","updated_at":"2017-10-19T18:18:28Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/census-instrumentation/opencensus-java/pulls/676","html_url":"https://github.com/census-instrumentation/opencensus-java/pull/676","diff_url":"https://github.com/census-instrumentation/opencensus-java/pull/676.diff","patch_url":"https://github.com/census-instrumentation/opencensus-java/pull/676.patch"},"body":"I wrote a rough implementation of #639 and wanted to ask for feedback.\r\n\r\nThis commit adds an abstract builder-like class (`StatsBuilder`) for setting measures.  The new class has a record method to record all of the measures with the same timestamp.\r\n\r\nHere is an example with implicit propagation.\r\n\r\nmaster:\r\n\r\n```java\r\n        statsRecorder.record(\r\n            MeasureMap.builder()\r\n                .put(RPC_CLIENT_ROUNDTRIP_LATENCY, 100)\r\n                .put(RPC_CLIENT_REQUEST_BYTES, 2000)\r\n                .build());\r\n```\r\n\r\nthis PR:\r\n\r\n```java\r\n        statsRecorder\r\n            .newStatsBuilder()\r\n            .put(RPC_CLIENT_ROUNDTRIP_LATENCY, 100)\r\n            .put(RPC_CLIENT_REQUEST_BYTES, 2000)\r\n            .record();\r\n```\r\n\r\nI'm not sure what names to use for the new class or methods.  I'm also not sure how to handle tags for explicit propagation, because they could be an argument to `newStatsBuilder` or `record`.  (They are currently an argument to `newStatsBuilder` in this PR.)\r\n\r\nHere are some reasons for making this change.  The first two also applied to making TagContext abstract.\r\n1. We don't need to put the concrete `MeasureMap` class in the API.  This gives us more flexibility to change it later.  For example, the stats implementation could access its list of measure values directly, rather than going through the iterator.  This API doesn't even require us to build the immutable map of measures.\r\n2. We don't need to create a `MeasureMap` when stats collection isn't enabled.\r\n3. This API requires slightly less code to record stats.\r\n\r\nReasons to keep `MeasureMap` in the API:\r\n1. `MeasureMap` is simpler to understand and document than `StatsBuilder`.\r\n2. `MeasureMap` is threadsafe and can be reused.\r\n3. `StatsRecorder.record(MeasureMap stats)` is easier to mock.\r\n\r\n/cc @adriancole "},"comment":{"url":"https://api.github.com/repos/census-instrumentation/opencensus-java/issues/comments/337993529","html_url":"https://github.com/census-instrumentation/opencensus-java/pull/676#issuecomment-337993529","issue_url":"https://api.github.com/repos/census-instrumentation/opencensus-java/issues/676","id":337993529,"user":{"login":"coveralls","id":2354108,"avatar_url":"https://avatars1.githubusercontent.com/u/2354108?v=4","gravatar_id":"","url":"https://api.github.com/users/coveralls","html_url":"https://github.com/coveralls","followers_url":"https://api.github.com/users/coveralls/followers","following_url":"https://api.github.com/users/coveralls/following{/other_user}","gists_url":"https://api.github.com/users/coveralls/gists{/gist_id}","starred_url":"https://api.github.com/users/coveralls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coveralls/subscriptions","organizations_url":"https://api.github.com/users/coveralls/orgs","repos_url":"https://api.github.com/users/coveralls/repos","events_url":"https://api.github.com/users/coveralls/events{/privacy}","received_events_url":"https://api.github.com/users/coveralls/received_events","type":"User","site_admin":false},"created_at":"2017-10-19T18:18:28Z","updated_at":"2017-10-19T18:18:28Z","author_association":"NONE","body":"\n[![Coverage Status](https://coveralls.io/builds/13798300/badge)](https://coveralls.io/builds/13798300)\n\nCoverage increased (+0.07%) to 79.077% when pulling **ee484e206a28a4aaa0abeb76fb5314efea16c725 on sebright:abstract-measure-map** into **dbff329210261a13e5a8c5ab525114cfdbfd8448 on census-instrumentation:master**.\n"}}
{"actor":{"display_login":"coveralls"}}