{"action":"created","comment":{"url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/pulls/comments/47493830","id":47493830,"diff_hunk":"@@ -47,23 +47,13 @@\n     @Column(name = \"operation_type\")\n     public String operation_type;\n \n-/*\n-    public static List<BgSendQueue> queue() {\n-        return new Select()\n-                .from(BgSendQueue.class)\n-                .where(\"success = ?\", false)\n-                .orderBy(\"_ID asc\")\n-                .limit(20)\n-                .execute();\n-    }\n-*/\n     public static List<BgSendQueue> mongoQueue() {\n         return new Select()\n                 .from(BgSendQueue.class)\n                 .where(\"mongo_success = ?\", false)\n                 .where(\"operation_type = ?\", \"create\")\n-                .orderBy(\"_ID desc\")\n-                .limit(30)\n+                .orderBy(\"_ID asc\")","path":"app/src/main/java/com/eveningoutpost/dexdrip/UtilityModels/BgSendQueue.java","position":21,"original_position":21,"commit_id":"a4b40b8c5538b87be13f2df64627c0b445cb3100","original_commit_id":"a4b40b8c5538b87be13f2df64627c0b445cb3100","user":{"login":"AdrianLxM","id":9692866,"avatar_url":"https://avatars.githubusercontent.com/u/9692866?v=3","gravatar_id":"","url":"https://api.github.com/users/AdrianLxM","html_url":"https://github.com/AdrianLxM","followers_url":"https://api.github.com/users/AdrianLxM/followers","following_url":"https://api.github.com/users/AdrianLxM/following{/other_user}","gists_url":"https://api.github.com/users/AdrianLxM/gists{/gist_id}","starred_url":"https://api.github.com/users/AdrianLxM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdrianLxM/subscriptions","organizations_url":"https://api.github.com/users/AdrianLxM/orgs","repos_url":"https://api.github.com/users/AdrianLxM/repos","events_url":"https://api.github.com/users/AdrianLxM/events{/privacy}","received_events_url":"https://api.github.com/users/AdrianLxM/received_events","type":"User","site_admin":false},"body":"The most recent datum must always be uploaded first when it comes in.\r\nIf not, backfilling data from 2 month ago will stop people from receiving new values.","created_at":"2015-12-14T12:55:23Z","updated_at":"2015-12-14T12:55:23Z","html_url":"https://github.com/StephenBlackWasAlreadyTaken/xDrip-Experimental/pull/220#discussion_r47493830","pull_request_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/pulls/220","_links":{"self":{"href":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/pulls/comments/47493830"},"html":{"href":"https://github.com/StephenBlackWasAlreadyTaken/xDrip-Experimental/pull/220#discussion_r47493830"},"pull_request":{"href":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/pulls/220"}}},"pull_request":{"url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/pulls/220","id":53515860,"html_url":"https://github.com/StephenBlackWasAlreadyTaken/xDrip-Experimental/pull/220","diff_url":"https://github.com/StephenBlackWasAlreadyTaken/xDrip-Experimental/pull/220.diff","patch_url":"https://github.com/StephenBlackWasAlreadyTaken/xDrip-Experimental/pull/220.patch","issue_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/issues/220","number":220,"state":"open","locked":false,"title":"Send queue improvments","user":{"login":"tzachi-dar","id":7942372,"avatar_url":"https://avatars.githubusercontent.com/u/7942372?v=3","gravatar_id":"","url":"https://api.github.com/users/tzachi-dar","html_url":"https://github.com/tzachi-dar","followers_url":"https://api.github.com/users/tzachi-dar/followers","following_url":"https://api.github.com/users/tzachi-dar/following{/other_user}","gists_url":"https://api.github.com/users/tzachi-dar/gists{/gist_id}","starred_url":"https://api.github.com/users/tzachi-dar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tzachi-dar/subscriptions","organizations_url":"https://api.github.com/users/tzachi-dar/orgs","repos_url":"https://api.github.com/users/tzachi-dar/repos","events_url":"https://api.github.com/users/tzachi-dar/events{/privacy}","received_events_url":"https://api.github.com/users/tzachi-dar/received_events","type":"User","site_admin":false},"body":"This PR fixes a lot of issues on send queue that we have talked about in the last month:\r\n\r\n1) Use Upserts.\r\n2) Correct use of wake lock.\r\n3) Keep sending until there is nothing more to send (or error).\r\n4) More efficient sending. (bigger number of objects being uploaded).\r\n5) delete objects after using them in order not to make the db grow for ever.\r\n6) upload more needed fields.\r\n7) keep sending while there is work to do.\r\n\r\nI have checked it with both mongo and NS and it seems that uploading 300 objects takes around 10-15 seconds on mongo and ~25 seconds on NS rest api.\r\nOn the other hand uploading 3 objects is much faster on the NS REST api (0.7 second compared to 4-5 seconds on mongo).\r\n(There is a big fluctuation on measured times).\r\n\r\nChecked this by uploading 500 objects every time. Worked well on mongo, but caused Azure to collapse (not sure it was realy this...).\r\n\r\nI'll keep checking this with normal load for a few more days.","created_at":"2015-12-14T01:06:32Z","updated_at":"2015-12-14T12:55:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0f600503eded6e19a672499dd2b77511b3f6f6d3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/pulls/220/commits","review_comments_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/pulls/220/comments","review_comment_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/pulls/comments{/number}","comments_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/issues/220/comments","statuses_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/statuses/a4b40b8c5538b87be13f2df64627c0b445cb3100","head":{"label":"StephenBlackWasAlreadyTaken:SendQueueImprovments","ref":"SendQueueImprovments","sha":"a4b40b8c5538b87be13f2df64627c0b445cb3100","user":{"login":"StephenBlackWasAlreadyTaken","id":649942,"avatar_url":"https://avatars.githubusercontent.com/u/649942?v=3","gravatar_id":"","url":"https://api.github.com/users/StephenBlackWasAlreadyTaken","html_url":"https://github.com/StephenBlackWasAlreadyTaken","followers_url":"https://api.github.com/users/StephenBlackWasAlreadyTaken/followers","following_url":"https://api.github.com/users/StephenBlackWasAlreadyTaken/following{/other_user}","gists_url":"https://api.github.com/users/StephenBlackWasAlreadyTaken/gists{/gist_id}","starred_url":"https://api.github.com/users/StephenBlackWasAlreadyTaken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StephenBlackWasAlreadyTaken/subscriptions","organizations_url":"https://api.github.com/users/StephenBlackWasAlreadyTaken/orgs","repos_url":"https://api.github.com/users/StephenBlackWasAlreadyTaken/repos","events_url":"https://api.github.com/users/StephenBlackWasAlreadyTaken/events{/privacy}","received_events_url":"https://api.github.com/users/StephenBlackWasAlreadyTaken/received_events","type":"User","site_admin":false},"repo":{"id":30898542,"name":"xDrip-Experimental","full_name":"StephenBlackWasAlreadyTaken/xDrip-Experimental","owner":{"login":"StephenBlackWasAlreadyTaken","id":649942,"avatar_url":"https://avatars.githubusercontent.com/u/649942?v=3","gravatar_id":"","url":"https://api.github.com/users/StephenBlackWasAlreadyTaken","html_url":"https://github.com/StephenBlackWasAlreadyTaken","followers_url":"https://api.github.com/users/StephenBlackWasAlreadyTaken/followers","following_url":"https://api.github.com/users/StephenBlackWasAlreadyTaken/following{/other_user}","gists_url":"https://api.github.com/users/StephenBlackWasAlreadyTaken/gists{/gist_id}","starred_url":"https://api.github.com/users/StephenBlackWasAlreadyTaken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StephenBlackWasAlreadyTaken/subscriptions","organizations_url":"https://api.github.com/users/StephenBlackWasAlreadyTaken/orgs","repos_url":"https://api.github.com/users/StephenBlackWasAlreadyTaken/repos","events_url":"https://api.github.com/users/StephenBlackWasAlreadyTaken/events{/privacy}","received_events_url":"https://api.github.com/users/StephenBlackWasAlreadyTaken/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/StephenBlackWasAlreadyTaken/xDrip-Experimental","description":"Experimental Branches for Collaboration on DexDrip","fork":false,"url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental","forks_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/forks","keys_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/keys{/key_id}","collaborators_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/teams","hooks_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/hooks","issue_events_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/issues/events{/number}","events_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/events","assignees_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/assignees{/user}","branches_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/branches{/branch}","tags_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/tags","blobs_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/git/refs{/sha}","trees_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/git/trees{/sha}","statuses_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/statuses/{sha}","languages_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/languages","stargazers_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/stargazers","contributors_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/contributors","subscribers_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/subscribers","subscription_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/subscription","commits_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/commits{/sha}","git_commits_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/git/commits{/sha}","comments_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/comments{/number}","issue_comment_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/issues/comments{/number}","contents_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/contents/{+path}","compare_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/compare/{base}...{head}","merges_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/merges","archive_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/downloads","issues_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/issues{/number}","pulls_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/pulls{/number}","milestones_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/milestones{/number}","notifications_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/labels{/name}","releases_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/releases{/id}","created_at":"2015-02-17T02:04:01Z","updated_at":"2015-12-07T12:51:08Z","pushed_at":"2015-12-14T01:06:33Z","git_url":"git://github.com/StephenBlackWasAlreadyTaken/xDrip-Experimental.git","ssh_url":"git@github.com:StephenBlackWasAlreadyTaken/xDrip-Experimental.git","clone_url":"https://github.com/StephenBlackWasAlreadyTaken/xDrip-Experimental.git","svn_url":"https://github.com/StephenBlackWasAlreadyTaken/xDrip-Experimental","homepage":null,"size":6122,"stargazers_count":15,"watchers_count":15,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":41,"mirror_url":null,"open_issues_count":24,"forks":41,"open_issues":24,"watchers":15,"default_branch":"master"}},"base":{"label":"StephenBlackWasAlreadyTaken:master","ref":"master","sha":"3e42a7052fc102a26166bee2dd138312c6570b81","user":{"login":"StephenBlackWasAlreadyTaken","id":649942,"avatar_url":"https://avatars.githubusercontent.com/u/649942?v=3","gravatar_id":"","url":"https://api.github.com/users/StephenBlackWasAlreadyTaken","html_url":"https://github.com/StephenBlackWasAlreadyTaken","followers_url":"https://api.github.com/users/StephenBlackWasAlreadyTaken/followers","following_url":"https://api.github.com/users/StephenBlackWasAlreadyTaken/following{/other_user}","gists_url":"https://api.github.com/users/StephenBlackWasAlreadyTaken/gists{/gist_id}","starred_url":"https://api.github.com/users/StephenBlackWasAlreadyTaken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StephenBlackWasAlreadyTaken/subscriptions","organizations_url":"https://api.github.com/users/StephenBlackWasAlreadyTaken/orgs","repos_url":"https://api.github.com/users/StephenBlackWasAlreadyTaken/repos","events_url":"https://api.github.com/users/StephenBlackWasAlreadyTaken/events{/privacy}","received_events_url":"https://api.github.com/users/StephenBlackWasAlreadyTaken/received_events","type":"User","site_admin":false},"repo":{"id":30898542,"name":"xDrip-Experimental","full_name":"StephenBlackWasAlreadyTaken/xDrip-Experimental","owner":{"login":"StephenBlackWasAlreadyTaken","id":649942,"avatar_url":"https://avatars.githubusercontent.com/u/649942?v=3","gravatar_id":"","url":"https://api.github.com/users/StephenBlackWasAlreadyTaken","html_url":"https://github.com/StephenBlackWasAlreadyTaken","followers_url":"https://api.github.com/users/StephenBlackWasAlreadyTaken/followers","following_url":"https://api.github.com/users/StephenBlackWasAlreadyTaken/following{/other_user}","gists_url":"https://api.github.com/users/StephenBlackWasAlreadyTaken/gists{/gist_id}","starred_url":"https://api.github.com/users/StephenBlackWasAlreadyTaken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StephenBlackWasAlreadyTaken/subscriptions","organizations_url":"https://api.github.com/users/StephenBlackWasAlreadyTaken/orgs","repos_url":"https://api.github.com/users/StephenBlackWasAlreadyTaken/repos","events_url":"https://api.github.com/users/StephenBlackWasAlreadyTaken/events{/privacy}","received_events_url":"https://api.github.com/users/StephenBlackWasAlreadyTaken/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/StephenBlackWasAlreadyTaken/xDrip-Experimental","description":"Experimental Branches for Collaboration on DexDrip","fork":false,"url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental","forks_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/forks","keys_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/keys{/key_id}","collaborators_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/teams","hooks_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/hooks","issue_events_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/issues/events{/number}","events_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/events","assignees_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/assignees{/user}","branches_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/branches{/branch}","tags_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/tags","blobs_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/git/refs{/sha}","trees_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/git/trees{/sha}","statuses_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/statuses/{sha}","languages_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/languages","stargazers_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/stargazers","contributors_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/contributors","subscribers_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/subscribers","subscription_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/subscription","commits_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/commits{/sha}","git_commits_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/git/commits{/sha}","comments_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/comments{/number}","issue_comment_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/issues/comments{/number}","contents_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/contents/{+path}","compare_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/compare/{base}...{head}","merges_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/merges","archive_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/downloads","issues_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/issues{/number}","pulls_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/pulls{/number}","milestones_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/milestones{/number}","notifications_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/labels{/name}","releases_url":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/releases{/id}","created_at":"2015-02-17T02:04:01Z","updated_at":"2015-12-07T12:51:08Z","pushed_at":"2015-12-14T01:06:33Z","git_url":"git://github.com/StephenBlackWasAlreadyTaken/xDrip-Experimental.git","ssh_url":"git@github.com:StephenBlackWasAlreadyTaken/xDrip-Experimental.git","clone_url":"https://github.com/StephenBlackWasAlreadyTaken/xDrip-Experimental.git","svn_url":"https://github.com/StephenBlackWasAlreadyTaken/xDrip-Experimental","homepage":null,"size":6122,"stargazers_count":15,"watchers_count":15,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":41,"mirror_url":null,"open_issues_count":24,"forks":41,"open_issues":24,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/pulls/220"},"html":{"href":"https://github.com/StephenBlackWasAlreadyTaken/xDrip-Experimental/pull/220"},"issue":{"href":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/issues/220"},"comments":{"href":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/issues/220/comments"},"review_comments":{"href":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/pulls/220/comments"},"review_comment":{"href":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/pulls/220/commits"},"statuses":{"href":"https://api.github.com/repos/StephenBlackWasAlreadyTaken/xDrip-Experimental/statuses/a4b40b8c5538b87be13f2df64627c0b445cb3100"}}}}