{"action":"created","comment":{"url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/pulls/comments/33664158","id":33664158,"diff_hunk":"@@ -222,15 +222,16 @@ def build_records_array_to_put(data_list)\n       records_payload_length = 0\n       data_list.each{|data_to_put|\n         payload = data_to_put[:data]\n-        if records.length >= PUT_RECORDS_MAX_COUNT or (records_payload_length + payload.length) >= PUT_RECORDS_MAX_DATA_SIZE\n+        partition_key = data_to_put[:partition_key]\n+        if records.length >= PUT_RECORDS_MAX_COUNT or (records_payload_length + payload.length + partition_key.length) >= PUT_RECORDS_MAX_DATA_SIZE\n           records_array.push(records)\n           records = []\n           records_payload_length = 0\n         end\n         records.push(data_to_put)\n-        records_payload_length += payload.length\n+        records_payload_length += (payload.length + partition_key.length)\n       }\n-      records_array.push(records)\n+      records_array.push(records) unless records.empty?","path":"lib/fluent/plugin/out_kinesis.rb","position":34,"original_position":34,"commit_id":"94eb827e80506d7b7e14a3147ba1583a38d0d154","original_commit_id":"94eb827e80506d7b7e14a3147ba1583a38d0d154","user":{"login":"trongnhanbmt","id":4046353,"avatar_url":"https://avatars.githubusercontent.com/u/4046353?v=3","gravatar_id":"","url":"https://api.github.com/users/trongnhanbmt","html_url":"https://github.com/trongnhanbmt","followers_url":"https://api.github.com/users/trongnhanbmt/followers","following_url":"https://api.github.com/users/trongnhanbmt/following{/other_user}","gists_url":"https://api.github.com/users/trongnhanbmt/gists{/gist_id}","starred_url":"https://api.github.com/users/trongnhanbmt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trongnhanbmt/subscriptions","organizations_url":"https://api.github.com/users/trongnhanbmt/orgs","repos_url":"https://api.github.com/users/trongnhanbmt/repos","events_url":"https://api.github.com/users/trongnhanbmt/events{/privacy}","received_events_url":"https://api.github.com/users/trongnhanbmt/received_events","type":"User","site_admin":false},"body":"Don't push empty array to an array.","created_at":"2015-07-01T09:54:47Z","updated_at":"2015-07-01T09:54:47Z","html_url":"https://github.com/awslabs/aws-fluent-plugin-kinesis/pull/23#discussion_r33664158","pull_request_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/pulls/23","_links":{"self":{"href":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/pulls/comments/33664158"},"html":{"href":"https://github.com/awslabs/aws-fluent-plugin-kinesis/pull/23#discussion_r33664158"},"pull_request":{"href":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/pulls/23"}}},"pull_request":{"url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/pulls/23","id":38956062,"html_url":"https://github.com/awslabs/aws-fluent-plugin-kinesis/pull/23","diff_url":"https://github.com/awslabs/aws-fluent-plugin-kinesis/pull/23.diff","patch_url":"https://github.com/awslabs/aws-fluent-plugin-kinesis/pull/23.patch","issue_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/issues/23","number":23,"state":"open","locked":false,"title":"Included partition_key's length when calculating request size to kinesis. Increased record size limit from 50KB to 1MB","user":{"login":"trongnhanbmt","id":4046353,"avatar_url":"https://avatars.githubusercontent.com/u/4046353?v=3","gravatar_id":"","url":"https://api.github.com/users/trongnhanbmt","html_url":"https://github.com/trongnhanbmt","followers_url":"https://api.github.com/users/trongnhanbmt/followers","following_url":"https://api.github.com/users/trongnhanbmt/following{/other_user}","gists_url":"https://api.github.com/users/trongnhanbmt/gists{/gist_id}","starred_url":"https://api.github.com/users/trongnhanbmt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trongnhanbmt/subscriptions","organizations_url":"https://api.github.com/users/trongnhanbmt/orgs","repos_url":"https://api.github.com/users/trongnhanbmt/repos","events_url":"https://api.github.com/users/trongnhanbmt/events{/privacy}","received_events_url":"https://api.github.com/users/trongnhanbmt/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-07-01T07:45:21Z","updated_at":"2015-07-01T09:54:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3ec0e6ee1a302a120f32075723861c7e0ab8bd05","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/pulls/23/commits","review_comments_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/pulls/23/comments","review_comment_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/pulls/comments{/number}","comments_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/issues/23/comments","statuses_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/statuses/94eb827e80506d7b7e14a3147ba1583a38d0d154","head":{"label":"trongnhanbmt:fix-kinesis-limits","ref":"fix-kinesis-limits","sha":"94eb827e80506d7b7e14a3147ba1583a38d0d154","user":{"login":"trongnhanbmt","id":4046353,"avatar_url":"https://avatars.githubusercontent.com/u/4046353?v=3","gravatar_id":"","url":"https://api.github.com/users/trongnhanbmt","html_url":"https://github.com/trongnhanbmt","followers_url":"https://api.github.com/users/trongnhanbmt/followers","following_url":"https://api.github.com/users/trongnhanbmt/following{/other_user}","gists_url":"https://api.github.com/users/trongnhanbmt/gists{/gist_id}","starred_url":"https://api.github.com/users/trongnhanbmt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trongnhanbmt/subscriptions","organizations_url":"https://api.github.com/users/trongnhanbmt/orgs","repos_url":"https://api.github.com/users/trongnhanbmt/repos","events_url":"https://api.github.com/users/trongnhanbmt/events{/privacy}","received_events_url":"https://api.github.com/users/trongnhanbmt/received_events","type":"User","site_admin":false},"repo":{"id":35398490,"name":"aws-fluent-plugin-kinesis","full_name":"trongnhanbmt/aws-fluent-plugin-kinesis","owner":{"login":"trongnhanbmt","id":4046353,"avatar_url":"https://avatars.githubusercontent.com/u/4046353?v=3","gravatar_id":"","url":"https://api.github.com/users/trongnhanbmt","html_url":"https://github.com/trongnhanbmt","followers_url":"https://api.github.com/users/trongnhanbmt/followers","following_url":"https://api.github.com/users/trongnhanbmt/following{/other_user}","gists_url":"https://api.github.com/users/trongnhanbmt/gists{/gist_id}","starred_url":"https://api.github.com/users/trongnhanbmt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trongnhanbmt/subscriptions","organizations_url":"https://api.github.com/users/trongnhanbmt/orgs","repos_url":"https://api.github.com/users/trongnhanbmt/repos","events_url":"https://api.github.com/users/trongnhanbmt/events{/privacy}","received_events_url":"https://api.github.com/users/trongnhanbmt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/trongnhanbmt/aws-fluent-plugin-kinesis","description":"Fluent Plugin for Amazon Kinesis","fork":true,"url":"https://api.github.com/repos/trongnhanbmt/aws-fluent-plugin-kinesis","forks_url":"https://api.github.com/repos/trongnhanbmt/aws-fluent-plugin-kinesis/forks","keys_url":"https://api.github.com/repos/trongnhanbmt/aws-fluent-plugin-kinesis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/trongnhanbmt/aws-fluent-plugin-kinesis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/trongnhanbmt/aws-fluent-plugin-kinesis/teams","hooks_url":"https://api.github.com/repos/trongnhanbmt/aws-fluent-plugin-kinesis/hooks","issue_events_url":"https://api.github.com/repos/trongnhanbmt/aws-fluent-plugin-kinesis/issues/events{/number}","events_url":"https://api.github.com/repos/trongnhanbmt/aws-fluent-plugin-kinesis/events","assignees_url":"https://api.github.com/repos/trongnhanbmt/aws-fluent-plugin-kinesis/assignees{/user}","branches_url":"https://api.github.com/repos/trongnhanbmt/aws-fluent-plugin-kinesis/branches{/branch}","tags_url":"https://api.github.com/repos/trongnhanbmt/aws-fluent-plugin-kinesis/tags","blobs_url":"https://api.github.com/repos/trongnhanbmt/aws-fluent-plugin-kinesis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/trongnhanbmt/aws-fluent-plugin-kinesis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/trongnhanbmt/aws-fluent-plugin-kinesis/git/refs{/sha}","trees_url":"https://api.github.com/repos/trongnhanbmt/aws-fluent-plugin-kinesis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/trongnhanbmt/aws-fluent-plugin-kinesis/statuses/{sha}","languages_url":"https://api.github.com/repos/trongnhanbmt/aws-fluent-plugin-kinesis/languages","stargazers_url":"https://api.github.com/repos/trongnhanbmt/aws-fluent-plugin-kinesis/stargazers","contributors_url":"https://api.github.com/repos/trongnhanbmt/aws-fluent-plugin-kinesis/contributors","subscribers_url":"https://api.github.com/repos/trongnhanbmt/aws-fluent-plugin-kinesis/subscribers","subscription_url":"https://api.github.com/repos/trongnhanbmt/aws-fluent-plugin-kinesis/subscription","commits_url":"https://api.github.com/repos/trongnhanbmt/aws-fluent-plugin-kinesis/commits{/sha}","git_commits_url":"https://api.github.com/repos/trongnhanbmt/aws-fluent-plugin-kinesis/git/commits{/sha}","comments_url":"https://api.github.com/repos/trongnhanbmt/aws-fluent-plugin-kinesis/comments{/number}","issue_comment_url":"https://api.github.com/repos/trongnhanbmt/aws-fluent-plugin-kinesis/issues/comments{/number}","contents_url":"https://api.github.com/repos/trongnhanbmt/aws-fluent-plugin-kinesis/contents/{+path}","compare_url":"https://api.github.com/repos/trongnhanbmt/aws-fluent-plugin-kinesis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/trongnhanbmt/aws-fluent-plugin-kinesis/merges","archive_url":"https://api.github.com/repos/trongnhanbmt/aws-fluent-plugin-kinesis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/trongnhanbmt/aws-fluent-plugin-kinesis/downloads","issues_url":"https://api.github.com/repos/trongnhanbmt/aws-fluent-plugin-kinesis/issues{/number}","pulls_url":"https://api.github.com/repos/trongnhanbmt/aws-fluent-plugin-kinesis/pulls{/number}","milestones_url":"https://api.github.com/repos/trongnhanbmt/aws-fluent-plugin-kinesis/milestones{/number}","notifications_url":"https://api.github.com/repos/trongnhanbmt/aws-fluent-plugin-kinesis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/trongnhanbmt/aws-fluent-plugin-kinesis/labels{/name}","releases_url":"https://api.github.com/repos/trongnhanbmt/aws-fluent-plugin-kinesis/releases{/id}","created_at":"2015-05-11T02:48:16Z","updated_at":"2015-05-11T02:48:17Z","pushed_at":"2015-07-01T09:46:55Z","git_url":"git://github.com/trongnhanbmt/aws-fluent-plugin-kinesis.git","ssh_url":"git@github.com:trongnhanbmt/aws-fluent-plugin-kinesis.git","clone_url":"https://github.com/trongnhanbmt/aws-fluent-plugin-kinesis.git","svn_url":"https://github.com/trongnhanbmt/aws-fluent-plugin-kinesis","homepage":"","size":161,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"awslabs:master","ref":"master","sha":"246d9da5058e5703cc09ab2eab6b2d831f9ec5e3","user":{"login":"awslabs","id":3299148,"avatar_url":"https://avatars.githubusercontent.com/u/3299148?v=3","gravatar_id":"","url":"https://api.github.com/users/awslabs","html_url":"https://github.com/awslabs","followers_url":"https://api.github.com/users/awslabs/followers","following_url":"https://api.github.com/users/awslabs/following{/other_user}","gists_url":"https://api.github.com/users/awslabs/gists{/gist_id}","starred_url":"https://api.github.com/users/awslabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awslabs/subscriptions","organizations_url":"https://api.github.com/users/awslabs/orgs","repos_url":"https://api.github.com/users/awslabs/repos","events_url":"https://api.github.com/users/awslabs/events{/privacy}","received_events_url":"https://api.github.com/users/awslabs/received_events","type":"Organization","site_admin":false},"repo":{"id":18643403,"name":"aws-fluent-plugin-kinesis","full_name":"awslabs/aws-fluent-plugin-kinesis","owner":{"login":"awslabs","id":3299148,"avatar_url":"https://avatars.githubusercontent.com/u/3299148?v=3","gravatar_id":"","url":"https://api.github.com/users/awslabs","html_url":"https://github.com/awslabs","followers_url":"https://api.github.com/users/awslabs/followers","following_url":"https://api.github.com/users/awslabs/following{/other_user}","gists_url":"https://api.github.com/users/awslabs/gists{/gist_id}","starred_url":"https://api.github.com/users/awslabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awslabs/subscriptions","organizations_url":"https://api.github.com/users/awslabs/orgs","repos_url":"https://api.github.com/users/awslabs/repos","events_url":"https://api.github.com/users/awslabs/events{/privacy}","received_events_url":"https://api.github.com/users/awslabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/awslabs/aws-fluent-plugin-kinesis","description":"Fluent Plugin for Amazon Kinesis","fork":false,"url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis","forks_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/forks","keys_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/teams","hooks_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/hooks","issue_events_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/issues/events{/number}","events_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/events","assignees_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/assignees{/user}","branches_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/branches{/branch}","tags_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/tags","blobs_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/git/refs{/sha}","trees_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/statuses/{sha}","languages_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/languages","stargazers_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/stargazers","contributors_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/contributors","subscribers_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/subscribers","subscription_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/subscription","commits_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/commits{/sha}","git_commits_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/git/commits{/sha}","comments_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/comments{/number}","issue_comment_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/issues/comments{/number}","contents_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/contents/{+path}","compare_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/merges","archive_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/downloads","issues_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/issues{/number}","pulls_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/pulls{/number}","milestones_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/milestones{/number}","notifications_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/labels{/name}","releases_url":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/releases{/id}","created_at":"2014-04-10T16:26:47Z","updated_at":"2015-06-30T18:57:28Z","pushed_at":"2015-07-01T09:46:56Z","git_url":"git://github.com/awslabs/aws-fluent-plugin-kinesis.git","ssh_url":"git@github.com:awslabs/aws-fluent-plugin-kinesis.git","clone_url":"https://github.com/awslabs/aws-fluent-plugin-kinesis.git","svn_url":"https://github.com/awslabs/aws-fluent-plugin-kinesis","homepage":"","size":515,"stargazers_count":53,"watchers_count":53,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":27,"mirror_url":null,"open_issues_count":5,"forks":27,"open_issues":5,"watchers":53,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/pulls/23"},"html":{"href":"https://github.com/awslabs/aws-fluent-plugin-kinesis/pull/23"},"issue":{"href":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/issues/23"},"comments":{"href":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/issues/23/comments"},"review_comments":{"href":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/pulls/23/comments"},"review_comment":{"href":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/pulls/23/commits"},"statuses":{"href":"https://api.github.com/repos/awslabs/aws-fluent-plugin-kinesis/statuses/94eb827e80506d7b7e14a3147ba1583a38d0d154"}}}}