{"action":"created","comment":{"url":"https://api.github.com/repos/sul-dlss/argo/pulls/comments/45530326","id":45530326,"diff_hunk":"@@ -0,0 +1,151 @@\n+module Argo\n+  class SimpleLogJob\n+    def initialize(log_val)\n+      @log_val = log_val\n+    end\n+\n+    def perform\n+      sleep(rand 10)\n+\n+      log_filename = \"tmp/simple_job.log\"\n+      File.open(log_filename, 'a') { |log|\n+        log.puts \"#{@log_val}\"\n+      }\n+    end\n+  end\n+\n+  #TODO: DRY up the repetition btwn here and dor_controller\n+  class Indexer\n+    @@index_logger = nil\n+    def self.index_logger\n+      return @@index_logger if @@index_logger\n+\n+      @@index_logger ||= Logger.new(\"#{Rails.root}/log/indexer.log\", 10, 3240000)\n+      @@index_logger.formatter = proc do |severity, datetime, progname, msg|\n+        date_format_str = Argo::Config.date_format_str\n+        \"[---] [#{datetime.utc.strftime(date_format_str)}] #{msg}\\n\"\n+      end\n+      @@index_logger\n+    end\n+\n+    def self.reindex_object obj","path":"lib/indexer.rb","position":31,"original_position":31,"commit_id":"0c72be95427c27ccb351d0466ddcb737b04a1a6d","original_commit_id":"0c72be95427c27ccb351d0466ddcb737b04a1a6d","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Use def with parentheses when there are parameters.","created_at":"2015-11-20T23:02:49Z","updated_at":"2015-11-20T23:02:49Z","html_url":"https://github.com/sul-dlss/argo/pull/246#discussion_r45530326","pull_request_url":"https://api.github.com/repos/sul-dlss/argo/pulls/246","_links":{"self":{"href":"https://api.github.com/repos/sul-dlss/argo/pulls/comments/45530326"},"html":{"href":"https://github.com/sul-dlss/argo/pull/246#discussion_r45530326"},"pull_request":{"href":"https://api.github.com/repos/sul-dlss/argo/pulls/246"}}},"pull_request":{"url":"https://api.github.com/repos/sul-dlss/argo/pulls/246","id":51419993,"html_url":"https://github.com/sul-dlss/argo/pull/246","diff_url":"https://github.com/sul-dlss/argo/pull/246.diff","patch_url":"https://github.com/sul-dlss/argo/pull/246.patch","issue_url":"https://api.github.com/repos/sul-dlss/argo/issues/246","number":246,"state":"open","locked":false,"title":"profiler refactoring and cleanup, move indexing code to class in lib, improved indexing tools","user":{"login":"jmartin-sul","id":7741604,"avatar_url":"https://avatars.githubusercontent.com/u/7741604?v=3","gravatar_id":"","url":"https://api.github.com/users/jmartin-sul","html_url":"https://github.com/jmartin-sul","followers_url":"https://api.github.com/users/jmartin-sul/followers","following_url":"https://api.github.com/users/jmartin-sul/following{/other_user}","gists_url":"https://api.github.com/users/jmartin-sul/gists{/gist_id}","starred_url":"https://api.github.com/users/jmartin-sul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmartin-sul/subscriptions","organizations_url":"https://api.github.com/users/jmartin-sul/orgs","repos_url":"https://api.github.com/users/jmartin-sul/repos","events_url":"https://api.github.com/users/jmartin-sul/events{/privacy}","received_events_url":"https://api.github.com/users/jmartin-sul/received_events","type":"User","site_admin":false},"body":"(cleans up the commit history and keeps the improvements made in the indexing and profiling experimentation of the last few days)\r\n\r\n* include the ruby-prof gem all the time, might want to profile in any env\r\n* move DevelopmentProfiler to Argo::Profiler, give it an output dir, let it output callgrind\r\n* min_percent passed to CallTreePrinter to keep callgrind output size somewhat reasonable\r\n\r\n* old reindex_all code is deprecated\r\n* method to query fedora for pids by model type\r\n* reindex_pid_list and reindex_pid_list_with_profiling, with supporting methods for reindexing individual objects (with logging and fault tolerance).  repeats and slightly modifies code from dor_controller.rb, should probably find ways to generalize the new lib code and call it from dor_controller.\r\n\r\n* simple test job (SimpleLogJob) for testing delayed_job behavior.  initially used to see how strictly delayed_job adhered to the job priority setting.\r\n* a reindexing ActiveJob subclass, which takes a list of pids.  optionally commits to solr and does performance profiling.\r\n* Set ActiveJobs to use delayed_jobs, needed for Rails 4.2 https://github.com/collectiveidea/delayed_job#rails-42\r\n\r\nthis commit is the result of squashing a bunch of work many times.  thanks to @mejackreed for the many structural improvements and refactorings along the way.","created_at":"2015-11-20T23:02:43Z","updated_at":"2015-11-20T23:02:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2511b2718eab3f710c9a17c88512d19f9a6b1b4c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sul-dlss/argo/pulls/246/commits","review_comments_url":"https://api.github.com/repos/sul-dlss/argo/pulls/246/comments","review_comment_url":"https://api.github.com/repos/sul-dlss/argo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sul-dlss/argo/issues/246/comments","statuses_url":"https://api.github.com/repos/sul-dlss/argo/statuses/0c72be95427c27ccb351d0466ddcb737b04a1a6d","head":{"label":"sul-dlss:profiling_and_indexing_improvements","ref":"profiling_and_indexing_improvements","sha":"0c72be95427c27ccb351d0466ddcb737b04a1a6d","user":{"login":"sul-dlss","id":230583,"avatar_url":"https://avatars.githubusercontent.com/u/230583?v=3","gravatar_id":"","url":"https://api.github.com/users/sul-dlss","html_url":"https://github.com/sul-dlss","followers_url":"https://api.github.com/users/sul-dlss/followers","following_url":"https://api.github.com/users/sul-dlss/following{/other_user}","gists_url":"https://api.github.com/users/sul-dlss/gists{/gist_id}","starred_url":"https://api.github.com/users/sul-dlss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sul-dlss/subscriptions","organizations_url":"https://api.github.com/users/sul-dlss/orgs","repos_url":"https://api.github.com/users/sul-dlss/repos","events_url":"https://api.github.com/users/sul-dlss/events{/privacy}","received_events_url":"https://api.github.com/users/sul-dlss/received_events","type":"Organization","site_admin":false},"repo":{"id":4989164,"name":"argo","full_name":"sul-dlss/argo","owner":{"login":"sul-dlss","id":230583,"avatar_url":"https://avatars.githubusercontent.com/u/230583?v=3","gravatar_id":"","url":"https://api.github.com/users/sul-dlss","html_url":"https://github.com/sul-dlss","followers_url":"https://api.github.com/users/sul-dlss/followers","following_url":"https://api.github.com/users/sul-dlss/following{/other_user}","gists_url":"https://api.github.com/users/sul-dlss/gists{/gist_id}","starred_url":"https://api.github.com/users/sul-dlss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sul-dlss/subscriptions","organizations_url":"https://api.github.com/users/sul-dlss/orgs","repos_url":"https://api.github.com/users/sul-dlss/repos","events_url":"https://api.github.com/users/sul-dlss/events{/privacy}","received_events_url":"https://api.github.com/users/sul-dlss/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sul-dlss/argo","description":"The administrative discovery interface for Stanford's Digital Object Registry","fork":false,"url":"https://api.github.com/repos/sul-dlss/argo","forks_url":"https://api.github.com/repos/sul-dlss/argo/forks","keys_url":"https://api.github.com/repos/sul-dlss/argo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sul-dlss/argo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sul-dlss/argo/teams","hooks_url":"https://api.github.com/repos/sul-dlss/argo/hooks","issue_events_url":"https://api.github.com/repos/sul-dlss/argo/issues/events{/number}","events_url":"https://api.github.com/repos/sul-dlss/argo/events","assignees_url":"https://api.github.com/repos/sul-dlss/argo/assignees{/user}","branches_url":"https://api.github.com/repos/sul-dlss/argo/branches{/branch}","tags_url":"https://api.github.com/repos/sul-dlss/argo/tags","blobs_url":"https://api.github.com/repos/sul-dlss/argo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sul-dlss/argo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sul-dlss/argo/git/refs{/sha}","trees_url":"https://api.github.com/repos/sul-dlss/argo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sul-dlss/argo/statuses/{sha}","languages_url":"https://api.github.com/repos/sul-dlss/argo/languages","stargazers_url":"https://api.github.com/repos/sul-dlss/argo/stargazers","contributors_url":"https://api.github.com/repos/sul-dlss/argo/contributors","subscribers_url":"https://api.github.com/repos/sul-dlss/argo/subscribers","subscription_url":"https://api.github.com/repos/sul-dlss/argo/subscription","commits_url":"https://api.github.com/repos/sul-dlss/argo/commits{/sha}","git_commits_url":"https://api.github.com/repos/sul-dlss/argo/git/commits{/sha}","comments_url":"https://api.github.com/repos/sul-dlss/argo/comments{/number}","issue_comment_url":"https://api.github.com/repos/sul-dlss/argo/issues/comments{/number}","contents_url":"https://api.github.com/repos/sul-dlss/argo/contents/{+path}","compare_url":"https://api.github.com/repos/sul-dlss/argo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sul-dlss/argo/merges","archive_url":"https://api.github.com/repos/sul-dlss/argo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sul-dlss/argo/downloads","issues_url":"https://api.github.com/repos/sul-dlss/argo/issues{/number}","pulls_url":"https://api.github.com/repos/sul-dlss/argo/pulls{/number}","milestones_url":"https://api.github.com/repos/sul-dlss/argo/milestones{/number}","notifications_url":"https://api.github.com/repos/sul-dlss/argo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sul-dlss/argo/labels{/name}","releases_url":"https://api.github.com/repos/sul-dlss/argo/releases{/id}","created_at":"2012-07-11T13:15:05Z","updated_at":"2015-11-09T08:17:26Z","pushed_at":"2015-11-20T23:02:44Z","git_url":"git://github.com/sul-dlss/argo.git","ssh_url":"git@github.com:sul-dlss/argo.git","clone_url":"https://github.com/sul-dlss/argo.git","svn_url":"https://github.com/sul-dlss/argo","homepage":null,"size":29202,"stargazers_count":12,"watchers_count":12,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":83,"forks":1,"open_issues":83,"watchers":12,"default_branch":"develop"}},"base":{"label":"sul-dlss:develop","ref":"develop","sha":"50b5352dbcf57a20772d9e394f517111b6eb3f73","user":{"login":"sul-dlss","id":230583,"avatar_url":"https://avatars.githubusercontent.com/u/230583?v=3","gravatar_id":"","url":"https://api.github.com/users/sul-dlss","html_url":"https://github.com/sul-dlss","followers_url":"https://api.github.com/users/sul-dlss/followers","following_url":"https://api.github.com/users/sul-dlss/following{/other_user}","gists_url":"https://api.github.com/users/sul-dlss/gists{/gist_id}","starred_url":"https://api.github.com/users/sul-dlss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sul-dlss/subscriptions","organizations_url":"https://api.github.com/users/sul-dlss/orgs","repos_url":"https://api.github.com/users/sul-dlss/repos","events_url":"https://api.github.com/users/sul-dlss/events{/privacy}","received_events_url":"https://api.github.com/users/sul-dlss/received_events","type":"Organization","site_admin":false},"repo":{"id":4989164,"name":"argo","full_name":"sul-dlss/argo","owner":{"login":"sul-dlss","id":230583,"avatar_url":"https://avatars.githubusercontent.com/u/230583?v=3","gravatar_id":"","url":"https://api.github.com/users/sul-dlss","html_url":"https://github.com/sul-dlss","followers_url":"https://api.github.com/users/sul-dlss/followers","following_url":"https://api.github.com/users/sul-dlss/following{/other_user}","gists_url":"https://api.github.com/users/sul-dlss/gists{/gist_id}","starred_url":"https://api.github.com/users/sul-dlss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sul-dlss/subscriptions","organizations_url":"https://api.github.com/users/sul-dlss/orgs","repos_url":"https://api.github.com/users/sul-dlss/repos","events_url":"https://api.github.com/users/sul-dlss/events{/privacy}","received_events_url":"https://api.github.com/users/sul-dlss/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sul-dlss/argo","description":"The administrative discovery interface for Stanford's Digital Object Registry","fork":false,"url":"https://api.github.com/repos/sul-dlss/argo","forks_url":"https://api.github.com/repos/sul-dlss/argo/forks","keys_url":"https://api.github.com/repos/sul-dlss/argo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sul-dlss/argo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sul-dlss/argo/teams","hooks_url":"https://api.github.com/repos/sul-dlss/argo/hooks","issue_events_url":"https://api.github.com/repos/sul-dlss/argo/issues/events{/number}","events_url":"https://api.github.com/repos/sul-dlss/argo/events","assignees_url":"https://api.github.com/repos/sul-dlss/argo/assignees{/user}","branches_url":"https://api.github.com/repos/sul-dlss/argo/branches{/branch}","tags_url":"https://api.github.com/repos/sul-dlss/argo/tags","blobs_url":"https://api.github.com/repos/sul-dlss/argo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sul-dlss/argo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sul-dlss/argo/git/refs{/sha}","trees_url":"https://api.github.com/repos/sul-dlss/argo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sul-dlss/argo/statuses/{sha}","languages_url":"https://api.github.com/repos/sul-dlss/argo/languages","stargazers_url":"https://api.github.com/repos/sul-dlss/argo/stargazers","contributors_url":"https://api.github.com/repos/sul-dlss/argo/contributors","subscribers_url":"https://api.github.com/repos/sul-dlss/argo/subscribers","subscription_url":"https://api.github.com/repos/sul-dlss/argo/subscription","commits_url":"https://api.github.com/repos/sul-dlss/argo/commits{/sha}","git_commits_url":"https://api.github.com/repos/sul-dlss/argo/git/commits{/sha}","comments_url":"https://api.github.com/repos/sul-dlss/argo/comments{/number}","issue_comment_url":"https://api.github.com/repos/sul-dlss/argo/issues/comments{/number}","contents_url":"https://api.github.com/repos/sul-dlss/argo/contents/{+path}","compare_url":"https://api.github.com/repos/sul-dlss/argo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sul-dlss/argo/merges","archive_url":"https://api.github.com/repos/sul-dlss/argo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sul-dlss/argo/downloads","issues_url":"https://api.github.com/repos/sul-dlss/argo/issues{/number}","pulls_url":"https://api.github.com/repos/sul-dlss/argo/pulls{/number}","milestones_url":"https://api.github.com/repos/sul-dlss/argo/milestones{/number}","notifications_url":"https://api.github.com/repos/sul-dlss/argo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sul-dlss/argo/labels{/name}","releases_url":"https://api.github.com/repos/sul-dlss/argo/releases{/id}","created_at":"2012-07-11T13:15:05Z","updated_at":"2015-11-09T08:17:26Z","pushed_at":"2015-11-20T23:02:44Z","git_url":"git://github.com/sul-dlss/argo.git","ssh_url":"git@github.com:sul-dlss/argo.git","clone_url":"https://github.com/sul-dlss/argo.git","svn_url":"https://github.com/sul-dlss/argo","homepage":null,"size":29202,"stargazers_count":12,"watchers_count":12,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":83,"forks":1,"open_issues":83,"watchers":12,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/sul-dlss/argo/pulls/246"},"html":{"href":"https://github.com/sul-dlss/argo/pull/246"},"issue":{"href":"https://api.github.com/repos/sul-dlss/argo/issues/246"},"comments":{"href":"https://api.github.com/repos/sul-dlss/argo/issues/246/comments"},"review_comments":{"href":"https://api.github.com/repos/sul-dlss/argo/pulls/246/comments"},"review_comment":{"href":"https://api.github.com/repos/sul-dlss/argo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sul-dlss/argo/pulls/246/commits"},"statuses":{"href":"https://api.github.com/repos/sul-dlss/argo/statuses/0c72be95427c27ccb351d0466ddcb737b04a1a6d"}}}}