{"action":"created","comment":{"url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/pulls/comments/40309208","id":40309208,"diff_hunk":"@@ -0,0 +1,142 @@\n+##\n+# Sample Workers scaling algorithm.\n+module WorkersScaling\n+  class SampleAlgorithm < Algorithm\n+\n+    ##\n+    # Tolerance used in #time_constraint_check\n+    # Defines maximal allowed difference in seconds\n+    # between planned and predicted finish time\n+    TOLERANCE = 60\n+\n+    ##\n+    # Arguments:\n+    # * instance of Experiment\n+    # * id of User starting Algorithm\n+    # * dictionary mapping infrastructure name to maximal Workers amount\n+    # * desired time of end of Experiment\n+    # Creates instances of ExperimentResourcesInterface and ExperimentStatistics\n+    def initialize(experiment, user_id, inf_limits, planned_finish_time)\n+      @experiment = experiment\n+      @resources_interface = ExperimentResourcesInterface.new @experiment.id, user_id\n+      @experiment_statistics = ExperimentStatistics.new @experiment, @resources_interface\n+      @infrastructure_limits = inf_limits\n+      @planned_finish_time = planned_finish_time\n+    end\n+\n+    def modify_limits(inf_limits)\n+      @infrastructure_limits = inf_limits\n+    end\n+\n+    def initial_deployment\n+      LOGGER.debug 'Initial deployment'","path":"app/models/workers_scaling/sample_algorithm.rb","position":32,"original_position":32,"commit_id":"af5acd083e8feaf8fd4e058cbcb6de7f494e643d","original_commit_id":"af5acd083e8feaf8fd4e058cbcb6de7f494e643d","user":{"login":"kliput","id":1345438,"avatar_url":"https://avatars.githubusercontent.com/u/1345438?v=3","gravatar_id":"","url":"https://api.github.com/users/kliput","html_url":"https://github.com/kliput","followers_url":"https://api.github.com/users/kliput/followers","following_url":"https://api.github.com/users/kliput/following{/other_user}","gists_url":"https://api.github.com/users/kliput/gists{/gist_id}","starred_url":"https://api.github.com/users/kliput/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kliput/subscriptions","organizations_url":"https://api.github.com/users/kliput/orgs","repos_url":"https://api.github.com/users/kliput/repos","events_url":"https://api.github.com/users/kliput/events{/privacy}","received_events_url":"https://api.github.com/users/kliput/received_events","type":"User","site_admin":false},"body":"Drobić ograniczenie liczby init workerów do rozmiaru eksperymentu.","created_at":"2015-09-24T11:35:16Z","updated_at":"2015-09-24T11:35:16Z","html_url":"https://github.com/Scalarm/scalarm_experiment_manager/pull/115#discussion_r40309208","pull_request_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/pulls/115","_links":{"self":{"href":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/pulls/comments/40309208"},"html":{"href":"https://github.com/Scalarm/scalarm_experiment_manager/pull/115#discussion_r40309208"},"pull_request":{"href":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/pulls/115"}}},"pull_request":{"url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/pulls/115","id":45772214,"html_url":"https://github.com/Scalarm/scalarm_experiment_manager/pull/115","diff_url":"https://github.com/Scalarm/scalarm_experiment_manager/pull/115.diff","patch_url":"https://github.com/Scalarm/scalarm_experiment_manager/pull/115.patch","issue_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/issues/115","number":115,"state":"open","locked":false,"title":"WSS-18","user":{"login":"mpaciore","id":3855041,"avatar_url":"https://avatars.githubusercontent.com/u/3855041?v=3","gravatar_id":"","url":"https://api.github.com/users/mpaciore","html_url":"https://github.com/mpaciore","followers_url":"https://api.github.com/users/mpaciore/followers","following_url":"https://api.github.com/users/mpaciore/following{/other_user}","gists_url":"https://api.github.com/users/mpaciore/gists{/gist_id}","starred_url":"https://api.github.com/users/mpaciore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpaciore/subscriptions","organizations_url":"https://api.github.com/users/mpaciore/orgs","repos_url":"https://api.github.com/users/mpaciore/repos","events_url":"https://api.github.com/users/mpaciore/events{/privacy}","received_events_url":"https://api.github.com/users/mpaciore/received_events","type":"User","site_admin":false},"body":"Do dyskusji","created_at":"2015-09-23T12:19:52Z","updated_at":"2015-09-24T11:35:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"24fdb3ffb5e28aad81afeaf2e5df5cd3bed21fcb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/pulls/115/commits","review_comments_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/pulls/115/comments","review_comment_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/issues/115/comments","statuses_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/statuses/af5acd083e8feaf8fd4e058cbcb6de7f494e643d","head":{"label":"Scalarm:WSS-18","ref":"WSS-18","sha":"af5acd083e8feaf8fd4e058cbcb6de7f494e643d","user":{"login":"Scalarm","id":4244361,"avatar_url":"https://avatars.githubusercontent.com/u/4244361?v=3","gravatar_id":"","url":"https://api.github.com/users/Scalarm","html_url":"https://github.com/Scalarm","followers_url":"https://api.github.com/users/Scalarm/followers","following_url":"https://api.github.com/users/Scalarm/following{/other_user}","gists_url":"https://api.github.com/users/Scalarm/gists{/gist_id}","starred_url":"https://api.github.com/users/Scalarm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Scalarm/subscriptions","organizations_url":"https://api.github.com/users/Scalarm/orgs","repos_url":"https://api.github.com/users/Scalarm/repos","events_url":"https://api.github.com/users/Scalarm/events{/privacy}","received_events_url":"https://api.github.com/users/Scalarm/received_events","type":"Organization","site_admin":false},"repo":{"id":7915145,"name":"scalarm_experiment_manager","full_name":"Scalarm/scalarm_experiment_manager","owner":{"login":"Scalarm","id":4244361,"avatar_url":"https://avatars.githubusercontent.com/u/4244361?v=3","gravatar_id":"","url":"https://api.github.com/users/Scalarm","html_url":"https://github.com/Scalarm","followers_url":"https://api.github.com/users/Scalarm/followers","following_url":"https://api.github.com/users/Scalarm/following{/other_user}","gists_url":"https://api.github.com/users/Scalarm/gists{/gist_id}","starred_url":"https://api.github.com/users/Scalarm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Scalarm/subscriptions","organizations_url":"https://api.github.com/users/Scalarm/orgs","repos_url":"https://api.github.com/users/Scalarm/repos","events_url":"https://api.github.com/users/Scalarm/events{/privacy}","received_events_url":"https://api.github.com/users/Scalarm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Scalarm/scalarm_experiment_manager","description":"Scalarm Experiment Manager is the main component of the Scalarm platform for data farming.","fork":false,"url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager","forks_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/forks","keys_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/teams","hooks_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/hooks","issue_events_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/issues/events{/number}","events_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/events","assignees_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/assignees{/user}","branches_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/branches{/branch}","tags_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/tags","blobs_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/git/refs{/sha}","trees_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/statuses/{sha}","languages_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/languages","stargazers_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/stargazers","contributors_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/contributors","subscribers_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/subscribers","subscription_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/subscription","commits_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/commits{/sha}","git_commits_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/git/commits{/sha}","comments_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/comments{/number}","issue_comment_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/issues/comments{/number}","contents_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/contents/{+path}","compare_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/merges","archive_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/downloads","issues_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/issues{/number}","pulls_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/pulls{/number}","milestones_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/milestones{/number}","notifications_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/labels{/name}","releases_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/releases{/id}","created_at":"2013-01-30T13:34:10Z","updated_at":"2015-04-20T15:56:04Z","pushed_at":"2015-09-24T07:52:49Z","git_url":"git://github.com/Scalarm/scalarm_experiment_manager.git","ssh_url":"git@github.com:Scalarm/scalarm_experiment_manager.git","clone_url":"https://github.com/Scalarm/scalarm_experiment_manager.git","svn_url":"https://github.com/Scalarm/scalarm_experiment_manager","homepage":null,"size":41854,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":1,"default_branch":"master"}},"base":{"label":"Scalarm:WSS-master","ref":"WSS-master","sha":"108d4d6e8d8377ed2b63d523d48c3bc664b3d924","user":{"login":"Scalarm","id":4244361,"avatar_url":"https://avatars.githubusercontent.com/u/4244361?v=3","gravatar_id":"","url":"https://api.github.com/users/Scalarm","html_url":"https://github.com/Scalarm","followers_url":"https://api.github.com/users/Scalarm/followers","following_url":"https://api.github.com/users/Scalarm/following{/other_user}","gists_url":"https://api.github.com/users/Scalarm/gists{/gist_id}","starred_url":"https://api.github.com/users/Scalarm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Scalarm/subscriptions","organizations_url":"https://api.github.com/users/Scalarm/orgs","repos_url":"https://api.github.com/users/Scalarm/repos","events_url":"https://api.github.com/users/Scalarm/events{/privacy}","received_events_url":"https://api.github.com/users/Scalarm/received_events","type":"Organization","site_admin":false},"repo":{"id":7915145,"name":"scalarm_experiment_manager","full_name":"Scalarm/scalarm_experiment_manager","owner":{"login":"Scalarm","id":4244361,"avatar_url":"https://avatars.githubusercontent.com/u/4244361?v=3","gravatar_id":"","url":"https://api.github.com/users/Scalarm","html_url":"https://github.com/Scalarm","followers_url":"https://api.github.com/users/Scalarm/followers","following_url":"https://api.github.com/users/Scalarm/following{/other_user}","gists_url":"https://api.github.com/users/Scalarm/gists{/gist_id}","starred_url":"https://api.github.com/users/Scalarm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Scalarm/subscriptions","organizations_url":"https://api.github.com/users/Scalarm/orgs","repos_url":"https://api.github.com/users/Scalarm/repos","events_url":"https://api.github.com/users/Scalarm/events{/privacy}","received_events_url":"https://api.github.com/users/Scalarm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Scalarm/scalarm_experiment_manager","description":"Scalarm Experiment Manager is the main component of the Scalarm platform for data farming.","fork":false,"url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager","forks_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/forks","keys_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/teams","hooks_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/hooks","issue_events_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/issues/events{/number}","events_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/events","assignees_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/assignees{/user}","branches_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/branches{/branch}","tags_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/tags","blobs_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/git/refs{/sha}","trees_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/statuses/{sha}","languages_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/languages","stargazers_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/stargazers","contributors_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/contributors","subscribers_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/subscribers","subscription_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/subscription","commits_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/commits{/sha}","git_commits_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/git/commits{/sha}","comments_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/comments{/number}","issue_comment_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/issues/comments{/number}","contents_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/contents/{+path}","compare_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/merges","archive_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/downloads","issues_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/issues{/number}","pulls_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/pulls{/number}","milestones_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/milestones{/number}","notifications_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/labels{/name}","releases_url":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/releases{/id}","created_at":"2013-01-30T13:34:10Z","updated_at":"2015-04-20T15:56:04Z","pushed_at":"2015-09-24T07:52:49Z","git_url":"git://github.com/Scalarm/scalarm_experiment_manager.git","ssh_url":"git@github.com:Scalarm/scalarm_experiment_manager.git","clone_url":"https://github.com/Scalarm/scalarm_experiment_manager.git","svn_url":"https://github.com/Scalarm/scalarm_experiment_manager","homepage":null,"size":41854,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/pulls/115"},"html":{"href":"https://github.com/Scalarm/scalarm_experiment_manager/pull/115"},"issue":{"href":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/issues/115"},"comments":{"href":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/issues/115/comments"},"review_comments":{"href":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/pulls/115/comments"},"review_comment":{"href":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/pulls/115/commits"},"statuses":{"href":"https://api.github.com/repos/Scalarm/scalarm_experiment_manager/statuses/af5acd083e8feaf8fd4e058cbcb6de7f494e643d"}}}}