{"action":"created","comment":{"url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/pulls/comments/63568353","id":63568353,"diff_hunk":"@@ -0,0 +1,649 @@\n+import os\n+import re\n+import json\n+import logging\n+import math\n+\n+from avocado import Test\n+from avocado import main\n+from avocado.utils import archive\n+from avocado.utils import process\n+from avocado.utils import build\n+from avocado.utils import distro\n+from avocado.utils.software_manager import SoftwareManager\n+\n+\n+_LABELS = ['file_size', 'record_size', 'write', 'rewrite', 'read', 'reread',\n+           'randread', 'randwrite', 'bkwdread', 'recordrewrite', 'strideread',\n+           'fwrite', 'frewrite', 'fread', 'freread']\n+\n+\n+def unique(list):\n+    \"\"\"\n+    Return a list of the elements in list, but without duplicates.\n+\n+    :param list: List with values.\n+    :return: List with non duplicate elements.\n+    \"\"\"\n+    n = len(list)\n+    if n == 0:\n+        return []\n+    u = {}\n+    try:\n+        for x in list:\n+            u[x] = 1\n+    except TypeError:\n+        return None\n+    else:\n+        return u.keys()\n+\n+\n+def geometric_mean(values):\n+    \"\"\"\n+    Evaluates the geometric mean for a list of numeric values.\n+\n+    :param values: List with values.\n+    :return: Single value representing the geometric mean for the list values.\n+    @see: http://en.wikipedia.org/wiki/Geometric_mean\n+    \"\"\"\n+    try:\n+        values = [int(value) for value in values]\n+    except ValueError:\n+        return None\n+    product = 1\n+    n = len(values)\n+    if n == 0:\n+        return None\n+    return math.exp(sum([math.log(x) for x in values]) / n)\n+\n+\n+def compare_matrices(matrix1, matrix2, treshold=0.05):\n+    \"\"\"\n+    Compare 2 matrices nxm and return a matrix nxm with comparison data\n+\n+    :param matrix1: Reference Matrix with numeric data\n+    :param matrix2: Matrix that will be compared\n+    :param treshold: Any difference bigger than this percent treshold will be\n+            reported.\n+    \"\"\"\n+    improvements = 0\n+    regressions = 0\n+    same = 0\n+    comparison_matrix = []\n+\n+    new_matrix = []\n+    for line1, line2 in zip(matrix1, matrix2):\n+        new_line = []\n+        for element1, element2 in zip(line1, line2):\n+            ratio = float(element2) / float(element1)\n+            if ratio < (1 - treshold):\n+                regressions += 1\n+                new_line.append((100 * ratio - 1) - 100)\n+            elif ratio > (1 + treshold):\n+                improvements += 1\n+                new_line.append(\"+\" + str((100 * ratio - 1) - 100))\n+            else:\n+                same + 1\n+                if line1.index(element1) == 0:\n+                    new_line.append(element1)\n+                else:\n+                    new_line.append(\".\")\n+        new_matrix.append(new_line)\n+\n+    total = improvements + regressions + same\n+\n+    return (new_matrix, improvements, regressions, total)\n+\n+\n+class IOzoneAnalyzer(object):\n+\n+    \"\"\"\n+    Postprocessing module for IOzone. It is capable to pick results from an\n+    IOzone run, calculate the geometric mean for all throughput results for\n+    a given file size or record size, and then generate a series of 2D and 3D\n+    graphs. The graph generation functionality depends on gnuplot, and if it\n+    is not present, functionality degrates gracefully.\n+\n+    @copyright: Red Hat 2010","path":"io/disk/iozone.py","position":107,"original_position":107,"commit_id":"80239b007d05edf4c784165ed739ae10011b7d7b","original_commit_id":"80239b007d05edf4c784165ed739ae10011b7d7b","user":{"login":"ldoktor","id":1074021,"avatar_url":"https://avatars.githubusercontent.com/u/1074021?v=3","gravatar_id":"","url":"https://api.github.com/users/ldoktor","html_url":"https://github.com/ldoktor","followers_url":"https://api.github.com/users/ldoktor/followers","following_url":"https://api.github.com/users/ldoktor/following{/other_user}","gists_url":"https://api.github.com/users/ldoktor/gists{/gist_id}","starred_url":"https://api.github.com/users/ldoktor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ldoktor/subscriptions","organizations_url":"https://api.github.com/users/ldoktor/orgs","repos_url":"https://api.github.com/users/ldoktor/repos","events_url":"https://api.github.com/users/ldoktor/events{/privacy}","received_events_url":"https://api.github.com/users/ldoktor/received_events","type":"User","site_admin":false},"body":"Anyway it's not suppose to be here, it should be on top of the file, see the `software_manager.py` example.","created_at":"2016-05-17T17:37:57Z","updated_at":"2016-05-17T17:37:57Z","html_url":"https://github.com/avocado-framework/avocado-misc-tests/pull/22#discussion_r63568353","pull_request_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/pulls/22","_links":{"self":{"href":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/pulls/comments/63568353"},"html":{"href":"https://github.com/avocado-framework/avocado-misc-tests/pull/22#discussion_r63568353"},"pull_request":{"href":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/pulls/22"}}},"pull_request":{"url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/pulls/22","id":69781208,"html_url":"https://github.com/avocado-framework/avocado-misc-tests/pull/22","diff_url":"https://github.com/avocado-framework/avocado-misc-tests/pull/22.diff","patch_url":"https://github.com/avocado-framework/avocado-misc-tests/pull/22.patch","issue_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/issues/22","number":22,"state":"open","locked":false,"title":"IOZone Test for avocado","user":{"login":"harish-24","id":17269437,"avatar_url":"https://avatars.githubusercontent.com/u/17269437?v=3","gravatar_id":"","url":"https://api.github.com/users/harish-24","html_url":"https://github.com/harish-24","followers_url":"https://api.github.com/users/harish-24/followers","following_url":"https://api.github.com/users/harish-24/following{/other_user}","gists_url":"https://api.github.com/users/harish-24/gists{/gist_id}","starred_url":"https://api.github.com/users/harish-24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harish-24/subscriptions","organizations_url":"https://api.github.com/users/harish-24/orgs","repos_url":"https://api.github.com/users/harish-24/repos","events_url":"https://api.github.com/users/harish-24/events{/privacy}","received_events_url":"https://api.github.com/users/harish-24/received_events","type":"User","site_admin":false},"body":"Ported IOZone test from autotest-client-tests to avocado-misc-tests","created_at":"2016-05-12T05:26:08Z","updated_at":"2016-05-17T17:37:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d7ec1665b647a69cc271664d9a7084a130185752","assignee":{"login":"ldoktor","id":1074021,"avatar_url":"https://avatars.githubusercontent.com/u/1074021?v=3","gravatar_id":"","url":"https://api.github.com/users/ldoktor","html_url":"https://github.com/ldoktor","followers_url":"https://api.github.com/users/ldoktor/followers","following_url":"https://api.github.com/users/ldoktor/following{/other_user}","gists_url":"https://api.github.com/users/ldoktor/gists{/gist_id}","starred_url":"https://api.github.com/users/ldoktor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ldoktor/subscriptions","organizations_url":"https://api.github.com/users/ldoktor/orgs","repos_url":"https://api.github.com/users/ldoktor/repos","events_url":"https://api.github.com/users/ldoktor/events{/privacy}","received_events_url":"https://api.github.com/users/ldoktor/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/pulls/22/commits","review_comments_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/pulls/22/comments","review_comment_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/pulls/comments{/number}","comments_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/issues/22/comments","statuses_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/statuses/80239b007d05edf4c784165ed739ae10011b7d7b","head":{"label":"harish-24:iozone_test","ref":"iozone_test","sha":"80239b007d05edf4c784165ed739ae10011b7d7b","user":{"login":"harish-24","id":17269437,"avatar_url":"https://avatars.githubusercontent.com/u/17269437?v=3","gravatar_id":"","url":"https://api.github.com/users/harish-24","html_url":"https://github.com/harish-24","followers_url":"https://api.github.com/users/harish-24/followers","following_url":"https://api.github.com/users/harish-24/following{/other_user}","gists_url":"https://api.github.com/users/harish-24/gists{/gist_id}","starred_url":"https://api.github.com/users/harish-24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harish-24/subscriptions","organizations_url":"https://api.github.com/users/harish-24/orgs","repos_url":"https://api.github.com/users/harish-24/repos","events_url":"https://api.github.com/users/harish-24/events{/privacy}","received_events_url":"https://api.github.com/users/harish-24/received_events","type":"User","site_admin":false},"repo":{"id":56316783,"name":"avocado-misc-tests","full_name":"harish-24/avocado-misc-tests","owner":{"login":"harish-24","id":17269437,"avatar_url":"https://avatars.githubusercontent.com/u/17269437?v=3","gravatar_id":"","url":"https://api.github.com/users/harish-24","html_url":"https://github.com/harish-24","followers_url":"https://api.github.com/users/harish-24/followers","following_url":"https://api.github.com/users/harish-24/following{/other_user}","gists_url":"https://api.github.com/users/harish-24/gists{/gist_id}","starred_url":"https://api.github.com/users/harish-24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harish-24/subscriptions","organizations_url":"https://api.github.com/users/harish-24/orgs","repos_url":"https://api.github.com/users/harish-24/repos","events_url":"https://api.github.com/users/harish-24/events{/privacy}","received_events_url":"https://api.github.com/users/harish-24/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/harish-24/avocado-misc-tests","description":"Avocado tests repository","fork":true,"url":"https://api.github.com/repos/harish-24/avocado-misc-tests","forks_url":"https://api.github.com/repos/harish-24/avocado-misc-tests/forks","keys_url":"https://api.github.com/repos/harish-24/avocado-misc-tests/keys{/key_id}","collaborators_url":"https://api.github.com/repos/harish-24/avocado-misc-tests/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/harish-24/avocado-misc-tests/teams","hooks_url":"https://api.github.com/repos/harish-24/avocado-misc-tests/hooks","issue_events_url":"https://api.github.com/repos/harish-24/avocado-misc-tests/issues/events{/number}","events_url":"https://api.github.com/repos/harish-24/avocado-misc-tests/events","assignees_url":"https://api.github.com/repos/harish-24/avocado-misc-tests/assignees{/user}","branches_url":"https://api.github.com/repos/harish-24/avocado-misc-tests/branches{/branch}","tags_url":"https://api.github.com/repos/harish-24/avocado-misc-tests/tags","blobs_url":"https://api.github.com/repos/harish-24/avocado-misc-tests/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/harish-24/avocado-misc-tests/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/harish-24/avocado-misc-tests/git/refs{/sha}","trees_url":"https://api.github.com/repos/harish-24/avocado-misc-tests/git/trees{/sha}","statuses_url":"https://api.github.com/repos/harish-24/avocado-misc-tests/statuses/{sha}","languages_url":"https://api.github.com/repos/harish-24/avocado-misc-tests/languages","stargazers_url":"https://api.github.com/repos/harish-24/avocado-misc-tests/stargazers","contributors_url":"https://api.github.com/repos/harish-24/avocado-misc-tests/contributors","subscribers_url":"https://api.github.com/repos/harish-24/avocado-misc-tests/subscribers","subscription_url":"https://api.github.com/repos/harish-24/avocado-misc-tests/subscription","commits_url":"https://api.github.com/repos/harish-24/avocado-misc-tests/commits{/sha}","git_commits_url":"https://api.github.com/repos/harish-24/avocado-misc-tests/git/commits{/sha}","comments_url":"https://api.github.com/repos/harish-24/avocado-misc-tests/comments{/number}","issue_comment_url":"https://api.github.com/repos/harish-24/avocado-misc-tests/issues/comments{/number}","contents_url":"https://api.github.com/repos/harish-24/avocado-misc-tests/contents/{+path}","compare_url":"https://api.github.com/repos/harish-24/avocado-misc-tests/compare/{base}...{head}","merges_url":"https://api.github.com/repos/harish-24/avocado-misc-tests/merges","archive_url":"https://api.github.com/repos/harish-24/avocado-misc-tests/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/harish-24/avocado-misc-tests/downloads","issues_url":"https://api.github.com/repos/harish-24/avocado-misc-tests/issues{/number}","pulls_url":"https://api.github.com/repos/harish-24/avocado-misc-tests/pulls{/number}","milestones_url":"https://api.github.com/repos/harish-24/avocado-misc-tests/milestones{/number}","notifications_url":"https://api.github.com/repos/harish-24/avocado-misc-tests/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/harish-24/avocado-misc-tests/labels{/name}","releases_url":"https://api.github.com/repos/harish-24/avocado-misc-tests/releases{/id}","deployments_url":"https://api.github.com/repos/harish-24/avocado-misc-tests/deployments","created_at":"2016-04-15T11:58:17Z","updated_at":"2016-04-15T11:58:18Z","pushed_at":"2016-05-12T05:24:28Z","git_url":"git://github.com/harish-24/avocado-misc-tests.git","ssh_url":"git@github.com:harish-24/avocado-misc-tests.git","clone_url":"https://github.com/harish-24/avocado-misc-tests.git","svn_url":"https://github.com/harish-24/avocado-misc-tests","homepage":null,"size":1333,"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":"avocado-framework:master","ref":"master","sha":"df1ad54bf6ac0e84de13950e110ec0c4a6385fb8","user":{"login":"avocado-framework","id":7245719,"avatar_url":"https://avatars.githubusercontent.com/u/7245719?v=3","gravatar_id":"","url":"https://api.github.com/users/avocado-framework","html_url":"https://github.com/avocado-framework","followers_url":"https://api.github.com/users/avocado-framework/followers","following_url":"https://api.github.com/users/avocado-framework/following{/other_user}","gists_url":"https://api.github.com/users/avocado-framework/gists{/gist_id}","starred_url":"https://api.github.com/users/avocado-framework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avocado-framework/subscriptions","organizations_url":"https://api.github.com/users/avocado-framework/orgs","repos_url":"https://api.github.com/users/avocado-framework/repos","events_url":"https://api.github.com/users/avocado-framework/events{/privacy}","received_events_url":"https://api.github.com/users/avocado-framework/received_events","type":"Organization","site_admin":false},"repo":{"id":49900980,"name":"avocado-misc-tests","full_name":"avocado-framework/avocado-misc-tests","owner":{"login":"avocado-framework","id":7245719,"avatar_url":"https://avatars.githubusercontent.com/u/7245719?v=3","gravatar_id":"","url":"https://api.github.com/users/avocado-framework","html_url":"https://github.com/avocado-framework","followers_url":"https://api.github.com/users/avocado-framework/followers","following_url":"https://api.github.com/users/avocado-framework/following{/other_user}","gists_url":"https://api.github.com/users/avocado-framework/gists{/gist_id}","starred_url":"https://api.github.com/users/avocado-framework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avocado-framework/subscriptions","organizations_url":"https://api.github.com/users/avocado-framework/orgs","repos_url":"https://api.github.com/users/avocado-framework/repos","events_url":"https://api.github.com/users/avocado-framework/events{/privacy}","received_events_url":"https://api.github.com/users/avocado-framework/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/avocado-framework/avocado-misc-tests","description":"Avocado tests repository","fork":false,"url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests","forks_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/forks","keys_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/keys{/key_id}","collaborators_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/teams","hooks_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/hooks","issue_events_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/issues/events{/number}","events_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/events","assignees_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/assignees{/user}","branches_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/branches{/branch}","tags_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/tags","blobs_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/git/refs{/sha}","trees_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/git/trees{/sha}","statuses_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/statuses/{sha}","languages_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/languages","stargazers_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/stargazers","contributors_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/contributors","subscribers_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/subscribers","subscription_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/subscription","commits_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/commits{/sha}","git_commits_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/git/commits{/sha}","comments_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/comments{/number}","issue_comment_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/issues/comments{/number}","contents_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/contents/{+path}","compare_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/compare/{base}...{head}","merges_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/merges","archive_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/downloads","issues_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/issues{/number}","pulls_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/pulls{/number}","milestones_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/milestones{/number}","notifications_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/labels{/name}","releases_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/releases{/id}","deployments_url":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/deployments","created_at":"2016-01-18T19:48:34Z","updated_at":"2016-05-06T05:41:50Z","pushed_at":"2016-05-16T14:00:00Z","git_url":"git://github.com/avocado-framework/avocado-misc-tests.git","ssh_url":"git@github.com:avocado-framework/avocado-misc-tests.git","clone_url":"https://github.com/avocado-framework/avocado-misc-tests.git","svn_url":"https://github.com/avocado-framework/avocado-misc-tests","homepage":null,"size":1343,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":7,"forks":12,"open_issues":7,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/pulls/22"},"html":{"href":"https://github.com/avocado-framework/avocado-misc-tests/pull/22"},"issue":{"href":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/issues/22"},"comments":{"href":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/avocado-framework/avocado-misc-tests/statuses/80239b007d05edf4c784165ed739ae10011b7d7b"}}}}