{"action":"created","comment":{"url":"https://api.github.com/repos/zalando/PGObserver/pulls/comments/67121590","id":67121590,"diff_hunk":"@@ -1,33 +1,49 @@\n package de.zalando.pgobserver.gatherer.config;\n \n-import java.io.File;\n+import java.io.FileReader;\n import java.io.IOException;\n-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;\n-import com.fasterxml.jackson.databind.ObjectMapper;\n+import java.io.Reader;\n+\n import org.slf4j.Logger;\n import org.slf4j.LoggerFactory;\n \n+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;\n+import com.fasterxml.jackson.databind.ObjectMapper;\n+import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;\n+\n @JsonIgnoreProperties(ignoreUnknown = true)\n public class Config {\n     public Database database;\n     public Frontend frontend;\n+    public Pool pool = new Pool();\n \n     private static Logger LOG = LoggerFactory.getLogger(Config.class);\n \n     @Override\n     public String toString() {\n-        return \"Config{\" + \"database=\" + database + \", frontend=\" + frontend + \"}\";\n+        return \"Config{\" + \"database=\" + database + \", frontend=\" + frontend + \", pool=\" + pool +\"}\";\n+    }\n+\n+    public static Config LoadConfigFromFile( final String file) {\n+        LOG.info(\"Reading config file from: {}\", file);\n+        try {\n+            final Reader reader = new FileReader(file);\n+            return LoadConfigFromStream(reader);\n+        } catch (IOException ex) { // TODO: check FileNotFoundException\n+            LOG.error(\"Error reading config file\", ex);\n+        }\n+        return null;\n     }\n \n-    public static Config LoadConfigFromFile(ObjectMapper mapper, String s) {\n-        LOG.info(\"Reading config file from: {}\", s);\n+\tpublic static Config LoadConfigFromStream(Reader reader) {","path":"gatherer/src/main/java/de/zalando/pgobserver/gatherer/config/Config.java","position":44,"original_position":44,"commit_id":"0231be4e97c408ac6e9a75d70a95ebb0122c6124","original_commit_id":"0231be4e97c408ac6e9a75d70a95ebb0122c6124","user":{"login":"avaczi","id":5435660,"avatar_url":"https://avatars.githubusercontent.com/u/5435660?v=3","gravatar_id":"","url":"https://api.github.com/users/avaczi","html_url":"https://github.com/avaczi","followers_url":"https://api.github.com/users/avaczi/followers","following_url":"https://api.github.com/users/avaczi/following{/other_user}","gists_url":"https://api.github.com/users/avaczi/gists{/gist_id}","starred_url":"https://api.github.com/users/avaczi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avaczi/subscriptions","organizations_url":"https://api.github.com/users/avaczi/orgs","repos_url":"https://api.github.com/users/avaczi/repos","events_url":"https://api.github.com/users/avaczi/events{/privacy}","received_events_url":"https://api.github.com/users/avaczi/received_events","type":"User","site_admin":false},"body":"unindent","created_at":"2016-06-15T08:44:09Z","updated_at":"2016-06-15T08:44:09Z","html_url":"https://github.com/zalando/PGObserver/pull/81#discussion_r67121590","pull_request_url":"https://api.github.com/repos/zalando/PGObserver/pulls/81","_links":{"self":{"href":"https://api.github.com/repos/zalando/PGObserver/pulls/comments/67121590"},"html":{"href":"https://github.com/zalando/PGObserver/pull/81#discussion_r67121590"},"pull_request":{"href":"https://api.github.com/repos/zalando/PGObserver/pulls/81"}}},"pull_request":{"url":"https://api.github.com/repos/zalando/PGObserver/pulls/81","id":73772976,"html_url":"https://github.com/zalando/PGObserver/pull/81","diff_url":"https://github.com/zalando/PGObserver/pull/81.diff","patch_url":"https://github.com/zalando/PGObserver/pull/81.patch","issue_url":"https://api.github.com/repos/zalando/PGObserver/issues/81","number":81,"state":"open","locked":false,"title":"Configurable pool","user":{"login":"slitsche","id":2462773,"avatar_url":"https://avatars.githubusercontent.com/u/2462773?v=3","gravatar_id":"","url":"https://api.github.com/users/slitsche","html_url":"https://github.com/slitsche","followers_url":"https://api.github.com/users/slitsche/followers","following_url":"https://api.github.com/users/slitsche/following{/other_user}","gists_url":"https://api.github.com/users/slitsche/gists{/gist_id}","starred_url":"https://api.github.com/users/slitsche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slitsche/subscriptions","organizations_url":"https://api.github.com/users/slitsche/orgs","repos_url":"https://api.github.com/users/slitsche/repos","events_url":"https://api.github.com/users/slitsche/events{/privacy}","received_events_url":"https://api.github.com/users/slitsche/received_events","type":"User","site_admin":false},"body":"The parameters for the connection pool (bonecp) should be configurable via the pgobserver.yaml file.","created_at":"2016-06-14T16:36:19Z","updated_at":"2016-06-15T08:44:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f2c1961808d6910786220810b6a71719bdd79e54","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/zalando/PGObserver/pulls/81/commits","review_comments_url":"https://api.github.com/repos/zalando/PGObserver/pulls/81/comments","review_comment_url":"https://api.github.com/repos/zalando/PGObserver/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zalando/PGObserver/issues/81/comments","statuses_url":"https://api.github.com/repos/zalando/PGObserver/statuses/0231be4e97c408ac6e9a75d70a95ebb0122c6124","head":{"label":"zalando:configurable-pool","ref":"configurable-pool","sha":"0231be4e97c408ac6e9a75d70a95ebb0122c6124","user":{"login":"zalando","id":1564818,"avatar_url":"https://avatars.githubusercontent.com/u/1564818?v=3","gravatar_id":"","url":"https://api.github.com/users/zalando","html_url":"https://github.com/zalando","followers_url":"https://api.github.com/users/zalando/followers","following_url":"https://api.github.com/users/zalando/following{/other_user}","gists_url":"https://api.github.com/users/zalando/gists{/gist_id}","starred_url":"https://api.github.com/users/zalando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zalando/subscriptions","organizations_url":"https://api.github.com/users/zalando/orgs","repos_url":"https://api.github.com/users/zalando/repos","events_url":"https://api.github.com/users/zalando/events{/privacy}","received_events_url":"https://api.github.com/users/zalando/received_events","type":"Organization","site_admin":false},"repo":{"id":6429662,"name":"PGObserver","full_name":"zalando/PGObserver","owner":{"login":"zalando","id":1564818,"avatar_url":"https://avatars.githubusercontent.com/u/1564818?v=3","gravatar_id":"","url":"https://api.github.com/users/zalando","html_url":"https://github.com/zalando","followers_url":"https://api.github.com/users/zalando/followers","following_url":"https://api.github.com/users/zalando/following{/other_user}","gists_url":"https://api.github.com/users/zalando/gists{/gist_id}","starred_url":"https://api.github.com/users/zalando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zalando/subscriptions","organizations_url":"https://api.github.com/users/zalando/orgs","repos_url":"https://api.github.com/users/zalando/repos","events_url":"https://api.github.com/users/zalando/events{/privacy}","received_events_url":"https://api.github.com/users/zalando/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zalando/PGObserver","description":"A battle-tested, flexible and comprehensive monitoring solution for your PostgreSQL databases","fork":false,"url":"https://api.github.com/repos/zalando/PGObserver","forks_url":"https://api.github.com/repos/zalando/PGObserver/forks","keys_url":"https://api.github.com/repos/zalando/PGObserver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zalando/PGObserver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zalando/PGObserver/teams","hooks_url":"https://api.github.com/repos/zalando/PGObserver/hooks","issue_events_url":"https://api.github.com/repos/zalando/PGObserver/issues/events{/number}","events_url":"https://api.github.com/repos/zalando/PGObserver/events","assignees_url":"https://api.github.com/repos/zalando/PGObserver/assignees{/user}","branches_url":"https://api.github.com/repos/zalando/PGObserver/branches{/branch}","tags_url":"https://api.github.com/repos/zalando/PGObserver/tags","blobs_url":"https://api.github.com/repos/zalando/PGObserver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zalando/PGObserver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zalando/PGObserver/git/refs{/sha}","trees_url":"https://api.github.com/repos/zalando/PGObserver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zalando/PGObserver/statuses/{sha}","languages_url":"https://api.github.com/repos/zalando/PGObserver/languages","stargazers_url":"https://api.github.com/repos/zalando/PGObserver/stargazers","contributors_url":"https://api.github.com/repos/zalando/PGObserver/contributors","subscribers_url":"https://api.github.com/repos/zalando/PGObserver/subscribers","subscription_url":"https://api.github.com/repos/zalando/PGObserver/subscription","commits_url":"https://api.github.com/repos/zalando/PGObserver/commits{/sha}","git_commits_url":"https://api.github.com/repos/zalando/PGObserver/git/commits{/sha}","comments_url":"https://api.github.com/repos/zalando/PGObserver/comments{/number}","issue_comment_url":"https://api.github.com/repos/zalando/PGObserver/issues/comments{/number}","contents_url":"https://api.github.com/repos/zalando/PGObserver/contents/{+path}","compare_url":"https://api.github.com/repos/zalando/PGObserver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zalando/PGObserver/merges","archive_url":"https://api.github.com/repos/zalando/PGObserver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zalando/PGObserver/downloads","issues_url":"https://api.github.com/repos/zalando/PGObserver/issues{/number}","pulls_url":"https://api.github.com/repos/zalando/PGObserver/pulls{/number}","milestones_url":"https://api.github.com/repos/zalando/PGObserver/milestones{/number}","notifications_url":"https://api.github.com/repos/zalando/PGObserver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zalando/PGObserver/labels{/name}","releases_url":"https://api.github.com/repos/zalando/PGObserver/releases{/id}","deployments_url":"https://api.github.com/repos/zalando/PGObserver/deployments","created_at":"2012-10-28T16:59:12Z","updated_at":"2016-06-03T08:09:35Z","pushed_at":"2016-06-14T16:36:19Z","git_url":"git://github.com/zalando/PGObserver.git","ssh_url":"git@github.com:zalando/PGObserver.git","clone_url":"https://github.com/zalando/PGObserver.git","svn_url":"https://github.com/zalando/PGObserver","homepage":"https://zalando.github.io/PGObserver/","size":5073,"stargazers_count":135,"watchers_count":135,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":34,"mirror_url":null,"open_issues_count":13,"forks":34,"open_issues":13,"watchers":135,"default_branch":"master"}},"base":{"label":"zalando:master","ref":"master","sha":"7c3e67978e1e52ef922977e6c88a6201ce0a798e","user":{"login":"zalando","id":1564818,"avatar_url":"https://avatars.githubusercontent.com/u/1564818?v=3","gravatar_id":"","url":"https://api.github.com/users/zalando","html_url":"https://github.com/zalando","followers_url":"https://api.github.com/users/zalando/followers","following_url":"https://api.github.com/users/zalando/following{/other_user}","gists_url":"https://api.github.com/users/zalando/gists{/gist_id}","starred_url":"https://api.github.com/users/zalando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zalando/subscriptions","organizations_url":"https://api.github.com/users/zalando/orgs","repos_url":"https://api.github.com/users/zalando/repos","events_url":"https://api.github.com/users/zalando/events{/privacy}","received_events_url":"https://api.github.com/users/zalando/received_events","type":"Organization","site_admin":false},"repo":{"id":6429662,"name":"PGObserver","full_name":"zalando/PGObserver","owner":{"login":"zalando","id":1564818,"avatar_url":"https://avatars.githubusercontent.com/u/1564818?v=3","gravatar_id":"","url":"https://api.github.com/users/zalando","html_url":"https://github.com/zalando","followers_url":"https://api.github.com/users/zalando/followers","following_url":"https://api.github.com/users/zalando/following{/other_user}","gists_url":"https://api.github.com/users/zalando/gists{/gist_id}","starred_url":"https://api.github.com/users/zalando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zalando/subscriptions","organizations_url":"https://api.github.com/users/zalando/orgs","repos_url":"https://api.github.com/users/zalando/repos","events_url":"https://api.github.com/users/zalando/events{/privacy}","received_events_url":"https://api.github.com/users/zalando/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zalando/PGObserver","description":"A battle-tested, flexible and comprehensive monitoring solution for your PostgreSQL databases","fork":false,"url":"https://api.github.com/repos/zalando/PGObserver","forks_url":"https://api.github.com/repos/zalando/PGObserver/forks","keys_url":"https://api.github.com/repos/zalando/PGObserver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zalando/PGObserver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zalando/PGObserver/teams","hooks_url":"https://api.github.com/repos/zalando/PGObserver/hooks","issue_events_url":"https://api.github.com/repos/zalando/PGObserver/issues/events{/number}","events_url":"https://api.github.com/repos/zalando/PGObserver/events","assignees_url":"https://api.github.com/repos/zalando/PGObserver/assignees{/user}","branches_url":"https://api.github.com/repos/zalando/PGObserver/branches{/branch}","tags_url":"https://api.github.com/repos/zalando/PGObserver/tags","blobs_url":"https://api.github.com/repos/zalando/PGObserver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zalando/PGObserver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zalando/PGObserver/git/refs{/sha}","trees_url":"https://api.github.com/repos/zalando/PGObserver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zalando/PGObserver/statuses/{sha}","languages_url":"https://api.github.com/repos/zalando/PGObserver/languages","stargazers_url":"https://api.github.com/repos/zalando/PGObserver/stargazers","contributors_url":"https://api.github.com/repos/zalando/PGObserver/contributors","subscribers_url":"https://api.github.com/repos/zalando/PGObserver/subscribers","subscription_url":"https://api.github.com/repos/zalando/PGObserver/subscription","commits_url":"https://api.github.com/repos/zalando/PGObserver/commits{/sha}","git_commits_url":"https://api.github.com/repos/zalando/PGObserver/git/commits{/sha}","comments_url":"https://api.github.com/repos/zalando/PGObserver/comments{/number}","issue_comment_url":"https://api.github.com/repos/zalando/PGObserver/issues/comments{/number}","contents_url":"https://api.github.com/repos/zalando/PGObserver/contents/{+path}","compare_url":"https://api.github.com/repos/zalando/PGObserver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zalando/PGObserver/merges","archive_url":"https://api.github.com/repos/zalando/PGObserver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zalando/PGObserver/downloads","issues_url":"https://api.github.com/repos/zalando/PGObserver/issues{/number}","pulls_url":"https://api.github.com/repos/zalando/PGObserver/pulls{/number}","milestones_url":"https://api.github.com/repos/zalando/PGObserver/milestones{/number}","notifications_url":"https://api.github.com/repos/zalando/PGObserver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zalando/PGObserver/labels{/name}","releases_url":"https://api.github.com/repos/zalando/PGObserver/releases{/id}","deployments_url":"https://api.github.com/repos/zalando/PGObserver/deployments","created_at":"2012-10-28T16:59:12Z","updated_at":"2016-06-03T08:09:35Z","pushed_at":"2016-06-14T16:36:19Z","git_url":"git://github.com/zalando/PGObserver.git","ssh_url":"git@github.com:zalando/PGObserver.git","clone_url":"https://github.com/zalando/PGObserver.git","svn_url":"https://github.com/zalando/PGObserver","homepage":"https://zalando.github.io/PGObserver/","size":5073,"stargazers_count":135,"watchers_count":135,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":34,"mirror_url":null,"open_issues_count":13,"forks":34,"open_issues":13,"watchers":135,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zalando/PGObserver/pulls/81"},"html":{"href":"https://github.com/zalando/PGObserver/pull/81"},"issue":{"href":"https://api.github.com/repos/zalando/PGObserver/issues/81"},"comments":{"href":"https://api.github.com/repos/zalando/PGObserver/issues/81/comments"},"review_comments":{"href":"https://api.github.com/repos/zalando/PGObserver/pulls/81/comments"},"review_comment":{"href":"https://api.github.com/repos/zalando/PGObserver/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zalando/PGObserver/pulls/81/commits"},"statuses":{"href":"https://api.github.com/repos/zalando/PGObserver/statuses/0231be4e97c408ac6e9a75d70a95ebb0122c6124"}}}}
{"actor":{"display_login":"avaczi"}}