{"action":"created","comment":{"url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/pulls/comments/45734134","id":45734134,"diff_hunk":"@@ -0,0 +1,185 @@\n+require 'mongo'\n+require 'json'\n+require 'FileUtils'\n+\n+class BenchmarkHelper\n+  # Accessor methods for\n+  attr_reader :database, :collection\n+\n+\n+  # Initializes a client connection, creating a database and a collection.\n+  #\n+  # @example Initialize a client connection.\n+  #   BenchmarkHelper.initialize_collection(\"testing\")\n+  #\n+  # @param [ String, Symbol ] collection_name The name of the collection.\n+  # @param [ String, Symbol ] database_name The name of the database.\n+  #\n+  # @return [ Mongo::Collection ] The collection.\n+  #\n+  # @since 2.2.1\n+  def initialize(database_name, collection_name, pool_size = 5)\n+    Mongo::Logger.level = Logger::INFO\n+    @client = Mongo::Client.new(\n+        [ '127.0.0.1:27017' ],\n+        database: database_name,\n+        write: { :w => 1 },\n+        max_pool_size: pool_size\n+    )\n+    @database = @client.database\n+    @collection = @client[collection_name]\n+  end\n+\n+\n+  class << self\n+\n+\n+    # Load a file into a string\n+    #\n+    # @example Load a file into a string\n+    #   BenchmarkHelper.load_string_from_file(\"GRIDFS_LARGE.txt\")\n+    #\n+    # @param [ String ] data_file_name The name of the data file.","path":"profile/benchmark_helper.rb","position":42,"original_position":42,"commit_id":"df51d35b48f6ea7ddb214124d802f1677ea14c80","original_commit_id":"df51d35b48f6ea7ddb214124d802f1677ea14c80","user":{"login":"estolfo","id":699369,"avatar_url":"https://avatars.githubusercontent.com/u/699369?v=3","gravatar_id":"","url":"https://api.github.com/users/estolfo","html_url":"https://github.com/estolfo","followers_url":"https://api.github.com/users/estolfo/followers","following_url":"https://api.github.com/users/estolfo/following{/other_user}","gists_url":"https://api.github.com/users/estolfo/gists{/gist_id}","starred_url":"https://api.github.com/users/estolfo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/estolfo/subscriptions","organizations_url":"https://api.github.com/users/estolfo/orgs","repos_url":"https://api.github.com/users/estolfo/repos","events_url":"https://api.github.com/users/estolfo/events{/privacy}","received_events_url":"https://api.github.com/users/estolfo/received_events","type":"User","site_admin":false},"body":"Maybe just call this file_name","created_at":"2015-11-24T13:29:01Z","updated_at":"2015-11-24T13:29:01Z","html_url":"https://github.com/mongodb/mongo-ruby-driver/pull/728#discussion_r45734134","pull_request_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/pulls/728","_links":{"self":{"href":"https://api.github.com/repos/mongodb/mongo-ruby-driver/pulls/comments/45734134"},"html":{"href":"https://github.com/mongodb/mongo-ruby-driver/pull/728#discussion_r45734134"},"pull_request":{"href":"https://api.github.com/repos/mongodb/mongo-ruby-driver/pulls/728"}}},"pull_request":{"url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/pulls/728","id":51357554,"html_url":"https://github.com/mongodb/mongo-ruby-driver/pull/728","diff_url":"https://github.com/mongodb/mongo-ruby-driver/pull/728.diff","patch_url":"https://github.com/mongodb/mongo-ruby-driver/pull/728.patch","issue_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/issues/728","number":728,"state":"open","locked":false,"title":"Benchmarking","user":{"login":"DiannaHohensee","id":4016923,"avatar_url":"https://avatars.githubusercontent.com/u/4016923?v=3","gravatar_id":"","url":"https://api.github.com/users/DiannaHohensee","html_url":"https://github.com/DiannaHohensee","followers_url":"https://api.github.com/users/DiannaHohensee/followers","following_url":"https://api.github.com/users/DiannaHohensee/following{/other_user}","gists_url":"https://api.github.com/users/DiannaHohensee/gists{/gist_id}","starred_url":"https://api.github.com/users/DiannaHohensee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DiannaHohensee/subscriptions","organizations_url":"https://api.github.com/users/DiannaHohensee/orgs","repos_url":"https://api.github.com/users/DiannaHohensee/repos","events_url":"https://api.github.com/users/DiannaHohensee/events{/privacy}","received_events_url":"https://api.github.com/users/DiannaHohensee/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-20T13:44:24Z","updated_at":"2015-11-24T13:29:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5b3ee3ba2b6f758d9356b2620925866fd2f0d08e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/pulls/728/commits","review_comments_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/pulls/728/comments","review_comment_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/issues/728/comments","statuses_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/statuses/df51d35b48f6ea7ddb214124d802f1677ea14c80","head":{"label":"DiannaHohensee:Benchmarking","ref":"Benchmarking","sha":"df51d35b48f6ea7ddb214124d802f1677ea14c80","user":{"login":"DiannaHohensee","id":4016923,"avatar_url":"https://avatars.githubusercontent.com/u/4016923?v=3","gravatar_id":"","url":"https://api.github.com/users/DiannaHohensee","html_url":"https://github.com/DiannaHohensee","followers_url":"https://api.github.com/users/DiannaHohensee/followers","following_url":"https://api.github.com/users/DiannaHohensee/following{/other_user}","gists_url":"https://api.github.com/users/DiannaHohensee/gists{/gist_id}","starred_url":"https://api.github.com/users/DiannaHohensee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DiannaHohensee/subscriptions","organizations_url":"https://api.github.com/users/DiannaHohensee/orgs","repos_url":"https://api.github.com/users/DiannaHohensee/repos","events_url":"https://api.github.com/users/DiannaHohensee/events{/privacy}","received_events_url":"https://api.github.com/users/DiannaHohensee/received_events","type":"User","site_admin":false},"repo":{"id":46283892,"name":"mongo-ruby-driver","full_name":"DiannaHohensee/mongo-ruby-driver","owner":{"login":"DiannaHohensee","id":4016923,"avatar_url":"https://avatars.githubusercontent.com/u/4016923?v=3","gravatar_id":"","url":"https://api.github.com/users/DiannaHohensee","html_url":"https://github.com/DiannaHohensee","followers_url":"https://api.github.com/users/DiannaHohensee/followers","following_url":"https://api.github.com/users/DiannaHohensee/following{/other_user}","gists_url":"https://api.github.com/users/DiannaHohensee/gists{/gist_id}","starred_url":"https://api.github.com/users/DiannaHohensee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DiannaHohensee/subscriptions","organizations_url":"https://api.github.com/users/DiannaHohensee/orgs","repos_url":"https://api.github.com/users/DiannaHohensee/repos","events_url":"https://api.github.com/users/DiannaHohensee/events{/privacy}","received_events_url":"https://api.github.com/users/DiannaHohensee/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DiannaHohensee/mongo-ruby-driver","description":"Ruby driver for MongoDB","fork":true,"url":"https://api.github.com/repos/DiannaHohensee/mongo-ruby-driver","forks_url":"https://api.github.com/repos/DiannaHohensee/mongo-ruby-driver/forks","keys_url":"https://api.github.com/repos/DiannaHohensee/mongo-ruby-driver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DiannaHohensee/mongo-ruby-driver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DiannaHohensee/mongo-ruby-driver/teams","hooks_url":"https://api.github.com/repos/DiannaHohensee/mongo-ruby-driver/hooks","issue_events_url":"https://api.github.com/repos/DiannaHohensee/mongo-ruby-driver/issues/events{/number}","events_url":"https://api.github.com/repos/DiannaHohensee/mongo-ruby-driver/events","assignees_url":"https://api.github.com/repos/DiannaHohensee/mongo-ruby-driver/assignees{/user}","branches_url":"https://api.github.com/repos/DiannaHohensee/mongo-ruby-driver/branches{/branch}","tags_url":"https://api.github.com/repos/DiannaHohensee/mongo-ruby-driver/tags","blobs_url":"https://api.github.com/repos/DiannaHohensee/mongo-ruby-driver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DiannaHohensee/mongo-ruby-driver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DiannaHohensee/mongo-ruby-driver/git/refs{/sha}","trees_url":"https://api.github.com/repos/DiannaHohensee/mongo-ruby-driver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DiannaHohensee/mongo-ruby-driver/statuses/{sha}","languages_url":"https://api.github.com/repos/DiannaHohensee/mongo-ruby-driver/languages","stargazers_url":"https://api.github.com/repos/DiannaHohensee/mongo-ruby-driver/stargazers","contributors_url":"https://api.github.com/repos/DiannaHohensee/mongo-ruby-driver/contributors","subscribers_url":"https://api.github.com/repos/DiannaHohensee/mongo-ruby-driver/subscribers","subscription_url":"https://api.github.com/repos/DiannaHohensee/mongo-ruby-driver/subscription","commits_url":"https://api.github.com/repos/DiannaHohensee/mongo-ruby-driver/commits{/sha}","git_commits_url":"https://api.github.com/repos/DiannaHohensee/mongo-ruby-driver/git/commits{/sha}","comments_url":"https://api.github.com/repos/DiannaHohensee/mongo-ruby-driver/comments{/number}","issue_comment_url":"https://api.github.com/repos/DiannaHohensee/mongo-ruby-driver/issues/comments{/number}","contents_url":"https://api.github.com/repos/DiannaHohensee/mongo-ruby-driver/contents/{+path}","compare_url":"https://api.github.com/repos/DiannaHohensee/mongo-ruby-driver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DiannaHohensee/mongo-ruby-driver/merges","archive_url":"https://api.github.com/repos/DiannaHohensee/mongo-ruby-driver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DiannaHohensee/mongo-ruby-driver/downloads","issues_url":"https://api.github.com/repos/DiannaHohensee/mongo-ruby-driver/issues{/number}","pulls_url":"https://api.github.com/repos/DiannaHohensee/mongo-ruby-driver/pulls{/number}","milestones_url":"https://api.github.com/repos/DiannaHohensee/mongo-ruby-driver/milestones{/number}","notifications_url":"https://api.github.com/repos/DiannaHohensee/mongo-ruby-driver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DiannaHohensee/mongo-ruby-driver/labels{/name}","releases_url":"https://api.github.com/repos/DiannaHohensee/mongo-ruby-driver/releases{/id}","created_at":"2015-11-16T15:35:44Z","updated_at":"2015-11-16T15:35:48Z","pushed_at":"2015-11-24T05:52:21Z","git_url":"git://github.com/DiannaHohensee/mongo-ruby-driver.git","ssh_url":"git@github.com:DiannaHohensee/mongo-ruby-driver.git","clone_url":"https://github.com/DiannaHohensee/mongo-ruby-driver.git","svn_url":"https://github.com/DiannaHohensee/mongo-ruby-driver","homepage":"http://api.mongodb.org/ruby","size":31543,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"mongodb:master","ref":"master","sha":"5d41f7e42bcc5cafe40f5bf214d2f4ffe876de74","user":{"login":"mongodb","id":45120,"avatar_url":"https://avatars.githubusercontent.com/u/45120?v=3","gravatar_id":"","url":"https://api.github.com/users/mongodb","html_url":"https://github.com/mongodb","followers_url":"https://api.github.com/users/mongodb/followers","following_url":"https://api.github.com/users/mongodb/following{/other_user}","gists_url":"https://api.github.com/users/mongodb/gists{/gist_id}","starred_url":"https://api.github.com/users/mongodb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mongodb/subscriptions","organizations_url":"https://api.github.com/users/mongodb/orgs","repos_url":"https://api.github.com/users/mongodb/repos","events_url":"https://api.github.com/users/mongodb/events{/privacy}","received_events_url":"https://api.github.com/users/mongodb/received_events","type":"Organization","site_admin":false},"repo":{"id":108125,"name":"mongo-ruby-driver","full_name":"mongodb/mongo-ruby-driver","owner":{"login":"mongodb","id":45120,"avatar_url":"https://avatars.githubusercontent.com/u/45120?v=3","gravatar_id":"","url":"https://api.github.com/users/mongodb","html_url":"https://github.com/mongodb","followers_url":"https://api.github.com/users/mongodb/followers","following_url":"https://api.github.com/users/mongodb/following{/other_user}","gists_url":"https://api.github.com/users/mongodb/gists{/gist_id}","starred_url":"https://api.github.com/users/mongodb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mongodb/subscriptions","organizations_url":"https://api.github.com/users/mongodb/orgs","repos_url":"https://api.github.com/users/mongodb/repos","events_url":"https://api.github.com/users/mongodb/events{/privacy}","received_events_url":"https://api.github.com/users/mongodb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mongodb/mongo-ruby-driver","description":"Ruby driver for MongoDB","fork":false,"url":"https://api.github.com/repos/mongodb/mongo-ruby-driver","forks_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/forks","keys_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/teams","hooks_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/hooks","issue_events_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/issues/events{/number}","events_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/events","assignees_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/assignees{/user}","branches_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/branches{/branch}","tags_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/tags","blobs_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/git/refs{/sha}","trees_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/statuses/{sha}","languages_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/languages","stargazers_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/stargazers","contributors_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/contributors","subscribers_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/subscribers","subscription_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/subscription","commits_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/commits{/sha}","git_commits_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/git/commits{/sha}","comments_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/comments{/number}","issue_comment_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/issues/comments{/number}","contents_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/contents/{+path}","compare_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/merges","archive_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/downloads","issues_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/issues{/number}","pulls_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/pulls{/number}","milestones_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/milestones{/number}","notifications_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/labels{/name}","releases_url":"https://api.github.com/repos/mongodb/mongo-ruby-driver/releases{/id}","created_at":"2009-01-15T16:40:45Z","updated_at":"2015-11-23T22:24:01Z","pushed_at":"2015-11-24T05:52:21Z","git_url":"git://github.com/mongodb/mongo-ruby-driver.git","ssh_url":"git@github.com:mongodb/mongo-ruby-driver.git","clone_url":"https://github.com/mongodb/mongo-ruby-driver.git","svn_url":"https://github.com/mongodb/mongo-ruby-driver","homepage":"http://api.mongodb.org/ruby","size":32457,"stargazers_count":1211,"watchers_count":1211,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":387,"mirror_url":null,"open_issues_count":2,"forks":387,"open_issues":2,"watchers":1211,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mongodb/mongo-ruby-driver/pulls/728"},"html":{"href":"https://github.com/mongodb/mongo-ruby-driver/pull/728"},"issue":{"href":"https://api.github.com/repos/mongodb/mongo-ruby-driver/issues/728"},"comments":{"href":"https://api.github.com/repos/mongodb/mongo-ruby-driver/issues/728/comments"},"review_comments":{"href":"https://api.github.com/repos/mongodb/mongo-ruby-driver/pulls/728/comments"},"review_comment":{"href":"https://api.github.com/repos/mongodb/mongo-ruby-driver/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mongodb/mongo-ruby-driver/pulls/728/commits"},"statuses":{"href":"https://api.github.com/repos/mongodb/mongo-ruby-driver/statuses/df51d35b48f6ea7ddb214124d802f1677ea14c80"}}}}