{"action":"created","comment":{"url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/pulls/comments/23876723","id":23876723,"diff_hunk":"@@ -0,0 +1,142 @@\n+import sys\n+import time\n+import multiprocessing\n+\n+from monascaclient import client\n+from monascaclient import ksclient\n+\n+import warnings\n+def no_warnings(message, category, filename, lineno):\n+    pass\n+warnings.showwarning = no_warnings\n+\n+num_processes = 10\n+num_requests = 10\n+num_metrics = 10\n+\n+# specify if the test should remove the generated alarms\n+cleanup_after_test = False\n+\n+keystone = {\n+        'username':'mini-mon',\n+        'password':'password',\n+        'project':'test',\n+        'auth_url':'http://10.22.156.11:35357/v3'\n+    }\n+\n+urls = [\n+    'https://mon-ae1test-monasca01.useast.hpcloud.net:8080/v2.0',\n+    'https://mon-ae1test-monasca02.useast.hpcloud.net:8080/v2.0',\n+    'https://mon-ae1test-monasca03.useast.hpcloud.net:8080/v2.0',\n+]\n+\n+metric_name = 'alarm_perf'\n+metric_dimension = 'dim1'\n+\n+alarm_def_name = 'alarm_perf_test'\n+alarm_def_expression = '{} > 0'.format(metric_name)\n+\n+def cleanup(monasca_client, name):\n+    for definition in monasca_client.alarm_definitions.list():\n+        if definition['name'] == name:\n+            monasca_client.alarm_definitions.delete(**{'alarm_id':definition['id']})","path":"monasca_perf/alarm_perf.py","position":42,"original_position":42,"commit_id":"195a3a7b3e761a51fd9882849fc6261367859930","original_commit_id":"195a3a7b3e761a51fd9882849fc6261367859930","user":{"login":"tkuhlman","id":150020,"avatar_url":"https://avatars.githubusercontent.com/u/150020?v=3","gravatar_id":"","url":"https://api.github.com/users/tkuhlman","html_url":"https://github.com/tkuhlman","followers_url":"https://api.github.com/users/tkuhlman/followers","following_url":"https://api.github.com/users/tkuhlman/following{/other_user}","gists_url":"https://api.github.com/users/tkuhlman/gists{/gist_id}","starred_url":"https://api.github.com/users/tkuhlman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkuhlman/subscriptions","organizations_url":"https://api.github.com/users/tkuhlman/orgs","repos_url":"https://api.github.com/users/tkuhlman/repos","events_url":"https://api.github.com/users/tkuhlman/events{/privacy}","received_events_url":"https://api.github.com/users/tkuhlman/received_events","type":"User","site_admin":false},"body":"Why the ** syntax, you could just do (alarm_id = definition['id']) right?\r\nSame below.","created_at":"2015-01-30T22:16:23Z","updated_at":"2015-01-30T22:16:23Z","html_url":"https://github.com/hpcloud-mon/monasca-perf/pull/1#discussion_r23876723","pull_request_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/hpcloud-mon/monasca-perf/pulls/comments/23876723"},"html":{"href":"https://github.com/hpcloud-mon/monasca-perf/pull/1#discussion_r23876723"},"pull_request":{"href":"https://api.github.com/repos/hpcloud-mon/monasca-perf/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/pulls/1","id":28373978,"html_url":"https://github.com/hpcloud-mon/monasca-perf/pull/1","diff_url":"https://github.com/hpcloud-mon/monasca-perf/pull/1.diff","patch_url":"https://github.com/hpcloud-mon/monasca-perf/pull/1.patch","issue_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/issues/1","number":1,"state":"open","locked":false,"title":"Added script to create abritrary amounts of alarms","user":{"login":"rbrndt","id":10423706,"avatar_url":"https://avatars.githubusercontent.com/u/10423706?v=3","gravatar_id":"","url":"https://api.github.com/users/rbrndt","html_url":"https://github.com/rbrndt","followers_url":"https://api.github.com/users/rbrndt/followers","following_url":"https://api.github.com/users/rbrndt/following{/other_user}","gists_url":"https://api.github.com/users/rbrndt/gists{/gist_id}","starred_url":"https://api.github.com/users/rbrndt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbrndt/subscriptions","organizations_url":"https://api.github.com/users/rbrndt/orgs","repos_url":"https://api.github.com/users/rbrndt/repos","events_url":"https://api.github.com/users/rbrndt/events{/privacy}","received_events_url":"https://api.github.com/users/rbrndt/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-01-30T16:33:50Z","updated_at":"2015-01-30T22:16:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b2355d61d406957bcd847dcee3da3da625c85e1a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/pulls/1/commits","review_comments_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/pulls/1/comments","review_comment_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/pulls/comments/{number}","comments_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/issues/1/comments","statuses_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/statuses/195a3a7b3e761a51fd9882849fc6261367859930","head":{"label":"rbrndt:master","ref":"master","sha":"195a3a7b3e761a51fd9882849fc6261367859930","user":{"login":"rbrndt","id":10423706,"avatar_url":"https://avatars.githubusercontent.com/u/10423706?v=3","gravatar_id":"","url":"https://api.github.com/users/rbrndt","html_url":"https://github.com/rbrndt","followers_url":"https://api.github.com/users/rbrndt/followers","following_url":"https://api.github.com/users/rbrndt/following{/other_user}","gists_url":"https://api.github.com/users/rbrndt/gists{/gist_id}","starred_url":"https://api.github.com/users/rbrndt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbrndt/subscriptions","organizations_url":"https://api.github.com/users/rbrndt/orgs","repos_url":"https://api.github.com/users/rbrndt/repos","events_url":"https://api.github.com/users/rbrndt/events{/privacy}","received_events_url":"https://api.github.com/users/rbrndt/received_events","type":"User","site_admin":false},"repo":{"id":30080254,"name":"monasca-perf","full_name":"rbrndt/monasca-perf","owner":{"login":"rbrndt","id":10423706,"avatar_url":"https://avatars.githubusercontent.com/u/10423706?v=3","gravatar_id":"","url":"https://api.github.com/users/rbrndt","html_url":"https://github.com/rbrndt","followers_url":"https://api.github.com/users/rbrndt/followers","following_url":"https://api.github.com/users/rbrndt/following{/other_user}","gists_url":"https://api.github.com/users/rbrndt/gists{/gist_id}","starred_url":"https://api.github.com/users/rbrndt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbrndt/subscriptions","organizations_url":"https://api.github.com/users/rbrndt/orgs","repos_url":"https://api.github.com/users/rbrndt/repos","events_url":"https://api.github.com/users/rbrndt/events{/privacy}","received_events_url":"https://api.github.com/users/rbrndt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rbrndt/monasca-perf","description":"a few performance testing tools","fork":true,"url":"https://api.github.com/repos/rbrndt/monasca-perf","forks_url":"https://api.github.com/repos/rbrndt/monasca-perf/forks","keys_url":"https://api.github.com/repos/rbrndt/monasca-perf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rbrndt/monasca-perf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rbrndt/monasca-perf/teams","hooks_url":"https://api.github.com/repos/rbrndt/monasca-perf/hooks","issue_events_url":"https://api.github.com/repos/rbrndt/monasca-perf/issues/events{/number}","events_url":"https://api.github.com/repos/rbrndt/monasca-perf/events","assignees_url":"https://api.github.com/repos/rbrndt/monasca-perf/assignees{/user}","branches_url":"https://api.github.com/repos/rbrndt/monasca-perf/branches{/branch}","tags_url":"https://api.github.com/repos/rbrndt/monasca-perf/tags","blobs_url":"https://api.github.com/repos/rbrndt/monasca-perf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rbrndt/monasca-perf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rbrndt/monasca-perf/git/refs{/sha}","trees_url":"https://api.github.com/repos/rbrndt/monasca-perf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rbrndt/monasca-perf/statuses/{sha}","languages_url":"https://api.github.com/repos/rbrndt/monasca-perf/languages","stargazers_url":"https://api.github.com/repos/rbrndt/monasca-perf/stargazers","contributors_url":"https://api.github.com/repos/rbrndt/monasca-perf/contributors","subscribers_url":"https://api.github.com/repos/rbrndt/monasca-perf/subscribers","subscription_url":"https://api.github.com/repos/rbrndt/monasca-perf/subscription","commits_url":"https://api.github.com/repos/rbrndt/monasca-perf/commits{/sha}","git_commits_url":"https://api.github.com/repos/rbrndt/monasca-perf/git/commits{/sha}","comments_url":"https://api.github.com/repos/rbrndt/monasca-perf/comments{/number}","issue_comment_url":"https://api.github.com/repos/rbrndt/monasca-perf/issues/comments/{number}","contents_url":"https://api.github.com/repos/rbrndt/monasca-perf/contents/{+path}","compare_url":"https://api.github.com/repos/rbrndt/monasca-perf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rbrndt/monasca-perf/merges","archive_url":"https://api.github.com/repos/rbrndt/monasca-perf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rbrndt/monasca-perf/downloads","issues_url":"https://api.github.com/repos/rbrndt/monasca-perf/issues{/number}","pulls_url":"https://api.github.com/repos/rbrndt/monasca-perf/pulls{/number}","milestones_url":"https://api.github.com/repos/rbrndt/monasca-perf/milestones{/number}","notifications_url":"https://api.github.com/repos/rbrndt/monasca-perf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rbrndt/monasca-perf/labels{/name}","releases_url":"https://api.github.com/repos/rbrndt/monasca-perf/releases{/id}","created_at":"2015-01-30T16:24:18Z","updated_at":"2015-01-30T16:32:07Z","pushed_at":"2015-01-30T16:32:07Z","git_url":"git://github.com/rbrndt/monasca-perf.git","ssh_url":"git@github.com:rbrndt/monasca-perf.git","clone_url":"https://github.com/rbrndt/monasca-perf.git","svn_url":"https://github.com/rbrndt/monasca-perf","homepage":null,"size":284,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"hpcloud-mon:master","ref":"master","sha":"4e021cc9dfebb5f4cb089b784bf7a98684024f08","user":{"login":"hpcloud-mon","id":7534935,"avatar_url":"https://avatars.githubusercontent.com/u/7534935?v=3","gravatar_id":"","url":"https://api.github.com/users/hpcloud-mon","html_url":"https://github.com/hpcloud-mon","followers_url":"https://api.github.com/users/hpcloud-mon/followers","following_url":"https://api.github.com/users/hpcloud-mon/following{/other_user}","gists_url":"https://api.github.com/users/hpcloud-mon/gists{/gist_id}","starred_url":"https://api.github.com/users/hpcloud-mon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hpcloud-mon/subscriptions","organizations_url":"https://api.github.com/users/hpcloud-mon/orgs","repos_url":"https://api.github.com/users/hpcloud-mon/repos","events_url":"https://api.github.com/users/hpcloud-mon/events{/privacy}","received_events_url":"https://api.github.com/users/hpcloud-mon/received_events","type":"Organization","site_admin":false},"repo":{"id":25888613,"name":"monasca-perf","full_name":"hpcloud-mon/monasca-perf","owner":{"login":"hpcloud-mon","id":7534935,"avatar_url":"https://avatars.githubusercontent.com/u/7534935?v=3","gravatar_id":"","url":"https://api.github.com/users/hpcloud-mon","html_url":"https://github.com/hpcloud-mon","followers_url":"https://api.github.com/users/hpcloud-mon/followers","following_url":"https://api.github.com/users/hpcloud-mon/following{/other_user}","gists_url":"https://api.github.com/users/hpcloud-mon/gists{/gist_id}","starred_url":"https://api.github.com/users/hpcloud-mon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hpcloud-mon/subscriptions","organizations_url":"https://api.github.com/users/hpcloud-mon/orgs","repos_url":"https://api.github.com/users/hpcloud-mon/repos","events_url":"https://api.github.com/users/hpcloud-mon/events{/privacy}","received_events_url":"https://api.github.com/users/hpcloud-mon/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hpcloud-mon/monasca-perf","description":"a few performance testing tools","fork":false,"url":"https://api.github.com/repos/hpcloud-mon/monasca-perf","forks_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/forks","keys_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/teams","hooks_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/hooks","issue_events_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/issues/events{/number}","events_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/events","assignees_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/assignees{/user}","branches_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/branches{/branch}","tags_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/tags","blobs_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/git/refs{/sha}","trees_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/statuses/{sha}","languages_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/languages","stargazers_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/stargazers","contributors_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/contributors","subscribers_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/subscribers","subscription_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/subscription","commits_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/commits{/sha}","git_commits_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/git/commits{/sha}","comments_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/comments{/number}","issue_comment_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/issues/comments/{number}","contents_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/contents/{+path}","compare_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/merges","archive_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/downloads","issues_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/issues{/number}","pulls_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/pulls{/number}","milestones_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/milestones{/number}","notifications_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/labels{/name}","releases_url":"https://api.github.com/repos/hpcloud-mon/monasca-perf/releases{/id}","created_at":"2014-10-28T20:27:12Z","updated_at":"2015-01-22T23:52:28Z","pushed_at":"2015-01-22T23:52:28Z","git_url":"git://github.com/hpcloud-mon/monasca-perf.git","ssh_url":"git@github.com:hpcloud-mon/monasca-perf.git","clone_url":"https://github.com/hpcloud-mon/monasca-perf.git","svn_url":"https://github.com/hpcloud-mon/monasca-perf","homepage":null,"size":284,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hpcloud-mon/monasca-perf/pulls/1"},"html":{"href":"https://github.com/hpcloud-mon/monasca-perf/pull/1"},"issue":{"href":"https://api.github.com/repos/hpcloud-mon/monasca-perf/issues/1"},"comments":{"href":"https://api.github.com/repos/hpcloud-mon/monasca-perf/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/hpcloud-mon/monasca-perf/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/hpcloud-mon/monasca-perf/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/hpcloud-mon/monasca-perf/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/hpcloud-mon/monasca-perf/statuses/195a3a7b3e761a51fd9882849fc6261367859930"}}}}