{"action":"created","issue":{"url":"https://api.github.com/repos/resin-io/resin-supervisor/issues/213","repository_url":"https://api.github.com/repos/resin-io/resin-supervisor","labels_url":"https://api.github.com/repos/resin-io/resin-supervisor/issues/213/labels{/name}","comments_url":"https://api.github.com/repos/resin-io/resin-supervisor/issues/213/comments","events_url":"https://api.github.com/repos/resin-io/resin-supervisor/issues/213/events","html_url":"https://github.com/resin-io/resin-supervisor/pull/213","id":166147554,"number":213,"title":"Change the logger to send at a specific interval and with a different…","user":{"login":"pcarranzav","id":2223590,"avatar_url":"https://avatars.githubusercontent.com/u/2223590?v=3","gravatar_id":"","url":"https://api.github.com/users/pcarranzav","html_url":"https://github.com/pcarranzav","followers_url":"https://api.github.com/users/pcarranzav/followers","following_url":"https://api.github.com/users/pcarranzav/following{/other_user}","gists_url":"https://api.github.com/users/pcarranzav/gists{/gist_id}","starred_url":"https://api.github.com/users/pcarranzav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcarranzav/subscriptions","organizations_url":"https://api.github.com/users/pcarranzav/orgs","repos_url":"https://api.github.com/users/pcarranzav/repos","events_url":"https://api.github.com/users/pcarranzav/events{/privacy}","received_events_url":"https://api.github.com/users/pcarranzav/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/resin-io/resin-supervisor/labels/flow/in-review","name":"flow/in-review","color":"e180ff"},{"url":"https://api.github.com/repos/resin-io/resin-supervisor/labels/prio/high","name":"prio/high","color":"d93f0b"},{"url":"https://api.github.com/repos/resin-io/resin-supervisor/labels/type/enhancement","name":"type/enhancement","color":"1d76db"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-18T17:26:50Z","updated_at":"2016-07-19T02:32:29Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/resin-io/resin-supervisor/pulls/213","html_url":"https://github.com/resin-io/resin-supervisor/pull/213","diff_url":"https://github.com/resin-io/resin-supervisor/pull/213.diff","patch_url":"https://github.com/resin-io/resin-supervisor/pull/213.patch"},"body":"… message format\r\n\r\nLog messages to PubNub are now an array instead of an object.\r\nEach element of the array is an object with m (message), t (timestamp) and s (isSystem, optional) attributes.\r\nLogs are sent at a specific interval (100ms, fit to PubNub's approximated 10 messages/s limit), and truncated to PubNub's 32KB limit.\r\n\r\nconnects to #174 \r\n\r\nThis proposed change affects Resin system-wide, as we'd need to change how we parse logs in the UI and the SDKs.\r\n@petrosagg @Page- @alexandrosm @shaunmulligan\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/resin-io/resin-supervisor/213)\n<!-- Reviewable:end -->\n"},"comment":{"url":"https://api.github.com/repos/resin-io/resin-supervisor/issues/comments/233514432","html_url":"https://github.com/resin-io/resin-supervisor/pull/213#issuecomment-233514432","issue_url":"https://api.github.com/repos/resin-io/resin-supervisor/issues/213","id":233514432,"user":{"login":"pcarranzav","id":2223590,"avatar_url":"https://avatars.githubusercontent.com/u/2223590?v=3","gravatar_id":"","url":"https://api.github.com/users/pcarranzav","html_url":"https://github.com/pcarranzav","followers_url":"https://api.github.com/users/pcarranzav/followers","following_url":"https://api.github.com/users/pcarranzav/following{/other_user}","gists_url":"https://api.github.com/users/pcarranzav/gists{/gist_id}","starred_url":"https://api.github.com/users/pcarranzav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcarranzav/subscriptions","organizations_url":"https://api.github.com/users/pcarranzav/orgs","repos_url":"https://api.github.com/users/pcarranzav/repos","events_url":"https://api.github.com/users/pcarranzav/events{/privacy}","received_events_url":"https://api.github.com/users/pcarranzav/received_events","type":"User","site_admin":false},"created_at":"2016-07-19T02:32:28Z","updated_at":"2016-07-19T02:32:28Z","body":"\n\n\n\nReview status: 2 of 3 files reviewed at latest revision, 4 unresolved discussions, some commit checks failed.\n\n---\n\n*[src/lib/logger.coffee, line 8 \\[r1\\]](https://reviewable.io:443/reviews/resin-io/resin-supervisor/213#-KMz6NMtsyVxOtFPuFiS:-KN-xQPRFxXsmJmGb47Y:-499146009) ([raw file](https://github.com/resin-io/resin-supervisor/blob/793c73de17b9161f5338c662444675b5015fbac9/src/lib/logger.coffee#L8)):*\n<details><summary><i>Previously, Page- wrote…</i></summary>\n> It might be worth using 110ms instead, just to reduce the chance of dropping a set of logs by going past the 10 messages/second limit due to timers having a bit of leeway on triggering\n</details>\nDone.\n\n---\n\n*[src/lib/logger.coffee, line 30 \\[r1\\]](https://reviewable.io:443/reviews/resin-io/resin-supervisor/213#-KMz7EeypeIMjnBlXZuY:-KN-xHpRKX-vmzic-LAn:1345584711) ([raw file](https://github.com/resin-io/resin-supervisor/blob/793c73de17b9161f5338c662444675b5015fbac9/src/lib/logger.coffee#L30)):*\n<details><summary><i>Previously, Page- wrote…</i></summary>\n> I don't think we need this lock, because we can never be in `doPublish` and `publish` at the same time anyway, due to javascript's single-threaded nature\n</details>\nTrue, I added it because I expected asynchronous stuff in these functions, which never happened. Done.\n\n---\n\n*[src/lib/logger.coffee, line 38 \\[r1\\]](https://reviewable.io:443/reviews/resin-io/resin-supervisor/213#-KMz630Mdb5oEodt8yEt:-KN-y0wB0D6Fg4LK4eDu:1517592224) ([raw file](https://github.com/resin-io/resin-supervisor/blob/8ce7b72854e930e041be439c0d7c5072cf949979/src/lib/logger.coffee#L38)):*\n<details><summary><i>Previously, Page- wrote…</i></summary>\n> So this is due to an error message that would otherwise occur, I wonder if that is from a time before this was an object, or whether `message` was a special property.  It's worth checking this out in testing\n</details>\nI think this error is actually logged if there's message attribute in the call to `pubnub.publish`, which is never the case.\nI'll replace this to an empty string so at least we ensure the type is always the same.\n\n---\n\n*[src/lib/logger.coffee, line 45 \\[r1\\]](https://reviewable.io:443/reviews/resin-io/resin-supervisor/213#-KMz7YbH_oei0SQKGBnG:-KN-xa5qY7zULqUVt2gK:-499146009) ([raw file](https://github.com/resin-io/resin-supervisor/blob/793c73de17b9161f5338c662444675b5015fbac9/src/lib/logger.coffee#L45)):*\n<details><summary><i>Previously, Page- wrote…</i></summary>\n> Can we use `return if publishQueue.length is 0`, in order to just bail on the function altogether, avoiding the two assignments as well as the pubnub publish\n</details>\nDone.\n\n---\n\n\n*Comments from [Reviewable](https://reviewable.io:443/reviews/resin-io/resin-supervisor/213)*\n<!-- Sent from Reviewable.io -->\n"}}
{"actor":{"display_login":"pcarranzav"}}