{"action":"created","comment":{"url":"https://api.github.com/repos/OCA/server-tools/pulls/comments/80598376","pull_request_review_id":1645990,"id":80598376,"diff_hunk":"@@ -0,0 +1,208 @@\n+# -*- coding: utf-8 -*-\n+##############################################################################\n+#\n+#    Author: Alexandre Fayolle\n+#    Copyright 2014 Camptocamp SA\n+#\n+#    This program is free software: you can redistribute it and/or modify\n+#    it under the terms of the GNU Affero General Public License as\n+#    published by the Free Software Foundation, either version 3 of the\n+#    License, or (at your option) any later version.\n+#\n+#    This program is distributed in the hope that it will be useful,\n+#    but WITHOUT ANY WARRANTY; without even the implied warranty of\n+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+#    GNU Affero General Public License for more details.\n+#\n+#    You should have received a copy of the GNU Affero General Public License\n+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n+#\n+##############################################################################\n+import logging\n+import datetime\n+\n+from openerp import models, fields, api\n+from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT\n+\n+\n+_logger = logging.getLogger(__name__)\n+\n+\n+class ModelRowCount(models.Model):\n+    _name = 'server.monitor.model.row.count'\n+\n+    name = fields.Char('Table name', readonly=True)\n+    count = fields.Bigint('row count', readonly=True)\n+    measure_id = fields.Many2one('server.monitor.database',\n+                                 string='Measure',\n+                                 ondelete='cascade',\n+                                 readonly=True)\n+    timestamp = fields.Datetime(related='measure_id.name',\n+                                string='timestamp',\n+                                type='datetime',\n+                                store=True)\n+    _order = 'timestamp DESC, count DESC'\n+\n+\n+class ModelTableSize(models.Model):\n+    _name = 'server.monitor.model.table.size'\n+\n+    name = fields.Char('Table name', readonly=True)\n+    size = fields.Bigint('Size (bytes)', readonly=True)\n+    hsize = fields.Char('Size', readonly=True)\n+    measure_id = fields.Many2one('server.monitor.database',\n+                                 string='Measure',\n+                                 ondelete='cascade', readonly=True)\n+    timestamp = fields.Datetime(related='measure_id.name',\n+                                string='timestamp',\n+                                store=True)\n+\n+    _order = 'timestamp DESC, size DESC'\n+\n+\n+class ModelTableActivityRead(models.Model):\n+    _name = 'server.monitor.model.table.activity.read'\n+    name = fields.Char('Table name')\n+    disk_reads = fields.Bigint('Disk reads (heap blocks)', readonly=True)\n+    cache_reads = fields.Bigint('Cache reads', readonly=True)\n+    total_reads = fields.Bigint('Total reads', readonly=True)\n+    measure_id = fields.Many2one('server.monitor.database',\n+                                 string='Measure',\n+                                 ondelete='cascade', readonly=True)\n+    timestamp = fields.Datetime(related='measure_id.name',\n+                                string='timestamp',\n+                                store=True)\n+\n+    _order = 'timestamp DESC, total_reads DESC'\n+\n+\n+class ModelTableActivityUpdate(models.Model):\n+    _name = 'server.monitor.model.table.activity.update'\n+\n+    name = fields.Char('Table name', readonly=True)\n+    seq_scan = fields.Bigint('Seq scans', readonly=True)\n+    idx_scan = fields.Bigint('Idx scans', readonly=True)\n+    lines_read_total = fields.Bigint('Tot lines read', readonly=True)\n+    num_insert = fields.Bigint('Inserts', readonly=True)\n+    num_update = fields.Bigint('Updates', readonly=True)\n+    num_delete = fields.Bigint('Deletes', readonly=True)\n+    measure_id = fields.Many2one('server.monitor.database',\n+                                 string='Measure',\n+                                 ondelete='cascade',\n+                                 readonly=True)\n+    timestamp = fields.Datetime(related='measure_id.name',\n+                                string='timestamp',","path":"server_monitoring/models/server_monitor_database.py","position":41,"original_position":94,"commit_id":"bac892aa183f9b152efdb0e08de4d58ebc9e2fb7","original_commit_id":"bac892aa183f9b152efdb0e08de4d58ebc9e2fb7","user":{"login":"elicoidal","id":7600613,"avatar_url":"https://avatars.githubusercontent.com/u/7600613?v=3","gravatar_id":"","url":"https://api.github.com/users/elicoidal","html_url":"https://github.com/elicoidal","followers_url":"https://api.github.com/users/elicoidal/followers","following_url":"https://api.github.com/users/elicoidal/following{/other_user}","gists_url":"https://api.github.com/users/elicoidal/gists{/gist_id}","starred_url":"https://api.github.com/users/elicoidal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elicoidal/subscriptions","organizations_url":"https://api.github.com/users/elicoidal/orgs","repos_url":"https://api.github.com/users/elicoidal/repos","events_url":"https://api.github.com/users/elicoidal/events{/privacy}","received_events_url":"https://api.github.com/users/elicoidal/received_events","type":"User","site_admin":false},"body":"Timestamp","created_at":"2016-09-26T23:52:44Z","updated_at":"2016-09-26T23:58:31Z","html_url":"https://github.com/OCA/server-tools/pull/265#discussion_r80598376","pull_request_url":"https://api.github.com/repos/OCA/server-tools/pulls/265","_links":{"self":{"href":"https://api.github.com/repos/OCA/server-tools/pulls/comments/80598376"},"html":{"href":"https://github.com/OCA/server-tools/pull/265#discussion_r80598376"},"pull_request":{"href":"https://api.github.com/repos/OCA/server-tools/pulls/265"}}},"pull_request":{"url":"https://api.github.com/repos/OCA/server-tools/pulls/265","id":46268464,"html_url":"https://github.com/OCA/server-tools/pull/265","diff_url":"https://github.com/OCA/server-tools/pull/265.diff","patch_url":"https://github.com/OCA/server-tools/pull/265.patch","issue_url":"https://api.github.com/repos/OCA/server-tools/issues/265","number":265,"state":"open","locked":false,"title":"[8.0] port server_monitoring","user":{"login":"gurneyalex","id":2032807,"avatar_url":"https://avatars.githubusercontent.com/u/2032807?v=3","gravatar_id":"","url":"https://api.github.com/users/gurneyalex","html_url":"https://github.com/gurneyalex","followers_url":"https://api.github.com/users/gurneyalex/followers","following_url":"https://api.github.com/users/gurneyalex/following{/other_user}","gists_url":"https://api.github.com/users/gurneyalex/gists{/gist_id}","starred_url":"https://api.github.com/users/gurneyalex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gurneyalex/subscriptions","organizations_url":"https://api.github.com/users/gurneyalex/orgs","repos_url":"https://api.github.com/users/gurneyalex/repos","events_url":"https://api.github.com/users/gurneyalex/events{/privacy}","received_events_url":"https://api.github.com/users/gurneyalex/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-29T12:07:00Z","updated_at":"2016-09-26T23:58:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c884dc159d6052dd11664f54bb1285ddc9096145","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/OCA/server-tools/milestones/3","html_url":"https://github.com/OCA/server-tools/milestones/8.0","labels_url":"https://api.github.com/repos/OCA/server-tools/milestones/3/labels","id":983662,"number":3,"title":"8.0","description":"","creator":{"login":"max3903","id":939952,"avatar_url":"https://avatars.githubusercontent.com/u/939952?v=3","gravatar_id":"","url":"https://api.github.com/users/max3903","html_url":"https://github.com/max3903","followers_url":"https://api.github.com/users/max3903/followers","following_url":"https://api.github.com/users/max3903/following{/other_user}","gists_url":"https://api.github.com/users/max3903/gists{/gist_id}","starred_url":"https://api.github.com/users/max3903/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/max3903/subscriptions","organizations_url":"https://api.github.com/users/max3903/orgs","repos_url":"https://api.github.com/users/max3903/repos","events_url":"https://api.github.com/users/max3903/events{/privacy}","received_events_url":"https://api.github.com/users/max3903/received_events","type":"User","site_admin":false},"open_issues":44,"closed_issues":82,"state":"open","created_at":"2015-02-17T21:52:00Z","updated_at":"2016-09-26T21:36:29Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/OCA/server-tools/pulls/265/commits","review_comments_url":"https://api.github.com/repos/OCA/server-tools/pulls/265/comments","review_comment_url":"https://api.github.com/repos/OCA/server-tools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OCA/server-tools/issues/265/comments","statuses_url":"https://api.github.com/repos/OCA/server-tools/statuses/bac892aa183f9b152efdb0e08de4d58ebc9e2fb7","head":{"label":"gurneyalex:8.0-monitoring","ref":"8.0-monitoring","sha":"bac892aa183f9b152efdb0e08de4d58ebc9e2fb7","user":{"login":"gurneyalex","id":2032807,"avatar_url":"https://avatars.githubusercontent.com/u/2032807?v=3","gravatar_id":"","url":"https://api.github.com/users/gurneyalex","html_url":"https://github.com/gurneyalex","followers_url":"https://api.github.com/users/gurneyalex/followers","following_url":"https://api.github.com/users/gurneyalex/following{/other_user}","gists_url":"https://api.github.com/users/gurneyalex/gists{/gist_id}","starred_url":"https://api.github.com/users/gurneyalex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gurneyalex/subscriptions","organizations_url":"https://api.github.com/users/gurneyalex/orgs","repos_url":"https://api.github.com/users/gurneyalex/repos","events_url":"https://api.github.com/users/gurneyalex/events{/privacy}","received_events_url":"https://api.github.com/users/gurneyalex/received_events","type":"User","site_admin":false},"repo":{"id":22906375,"name":"server-tools","full_name":"gurneyalex/server-tools","owner":{"login":"gurneyalex","id":2032807,"avatar_url":"https://avatars.githubusercontent.com/u/2032807?v=3","gravatar_id":"","url":"https://api.github.com/users/gurneyalex","html_url":"https://github.com/gurneyalex","followers_url":"https://api.github.com/users/gurneyalex/followers","following_url":"https://api.github.com/users/gurneyalex/following{/other_user}","gists_url":"https://api.github.com/users/gurneyalex/gists{/gist_id}","starred_url":"https://api.github.com/users/gurneyalex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gurneyalex/subscriptions","organizations_url":"https://api.github.com/users/gurneyalex/orgs","repos_url":"https://api.github.com/users/gurneyalex/repos","events_url":"https://api.github.com/users/gurneyalex/events{/privacy}","received_events_url":"https://api.github.com/users/gurneyalex/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gurneyalex/server-tools","description":"","fork":true,"url":"https://api.github.com/repos/gurneyalex/server-tools","forks_url":"https://api.github.com/repos/gurneyalex/server-tools/forks","keys_url":"https://api.github.com/repos/gurneyalex/server-tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gurneyalex/server-tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gurneyalex/server-tools/teams","hooks_url":"https://api.github.com/repos/gurneyalex/server-tools/hooks","issue_events_url":"https://api.github.com/repos/gurneyalex/server-tools/issues/events{/number}","events_url":"https://api.github.com/repos/gurneyalex/server-tools/events","assignees_url":"https://api.github.com/repos/gurneyalex/server-tools/assignees{/user}","branches_url":"https://api.github.com/repos/gurneyalex/server-tools/branches{/branch}","tags_url":"https://api.github.com/repos/gurneyalex/server-tools/tags","blobs_url":"https://api.github.com/repos/gurneyalex/server-tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gurneyalex/server-tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gurneyalex/server-tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/gurneyalex/server-tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gurneyalex/server-tools/statuses/{sha}","languages_url":"https://api.github.com/repos/gurneyalex/server-tools/languages","stargazers_url":"https://api.github.com/repos/gurneyalex/server-tools/stargazers","contributors_url":"https://api.github.com/repos/gurneyalex/server-tools/contributors","subscribers_url":"https://api.github.com/repos/gurneyalex/server-tools/subscribers","subscription_url":"https://api.github.com/repos/gurneyalex/server-tools/subscription","commits_url":"https://api.github.com/repos/gurneyalex/server-tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/gurneyalex/server-tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/gurneyalex/server-tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/gurneyalex/server-tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/gurneyalex/server-tools/contents/{+path}","compare_url":"https://api.github.com/repos/gurneyalex/server-tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gurneyalex/server-tools/merges","archive_url":"https://api.github.com/repos/gurneyalex/server-tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gurneyalex/server-tools/downloads","issues_url":"https://api.github.com/repos/gurneyalex/server-tools/issues{/number}","pulls_url":"https://api.github.com/repos/gurneyalex/server-tools/pulls{/number}","milestones_url":"https://api.github.com/repos/gurneyalex/server-tools/milestones{/number}","notifications_url":"https://api.github.com/repos/gurneyalex/server-tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gurneyalex/server-tools/labels{/name}","releases_url":"https://api.github.com/repos/gurneyalex/server-tools/releases{/id}","deployments_url":"https://api.github.com/repos/gurneyalex/server-tools/deployments","created_at":"2014-08-13T07:16:34Z","updated_at":"2014-08-13T07:17:06Z","pushed_at":"2016-09-20T15:03:08Z","git_url":"git://github.com/gurneyalex/server-tools.git","ssh_url":"git@github.com:gurneyalex/server-tools.git","clone_url":"https://github.com/gurneyalex/server-tools.git","svn_url":"https://github.com/gurneyalex/server-tools","homepage":null,"size":5818,"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":"OCA:8.0","ref":"8.0","sha":"3558676fff9aa128b16586088d392fb654a76194","user":{"login":"OCA","id":7600578,"avatar_url":"https://avatars.githubusercontent.com/u/7600578?v=3","gravatar_id":"","url":"https://api.github.com/users/OCA","html_url":"https://github.com/OCA","followers_url":"https://api.github.com/users/OCA/followers","following_url":"https://api.github.com/users/OCA/following{/other_user}","gists_url":"https://api.github.com/users/OCA/gists{/gist_id}","starred_url":"https://api.github.com/users/OCA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OCA/subscriptions","organizations_url":"https://api.github.com/users/OCA/orgs","repos_url":"https://api.github.com/users/OCA/repos","events_url":"https://api.github.com/users/OCA/events{/privacy}","received_events_url":"https://api.github.com/users/OCA/received_events","type":"Organization","site_admin":false},"repo":{"id":20896532,"name":"server-tools","full_name":"OCA/server-tools","owner":{"login":"OCA","id":7600578,"avatar_url":"https://avatars.githubusercontent.com/u/7600578?v=3","gravatar_id":"","url":"https://api.github.com/users/OCA","html_url":"https://github.com/OCA","followers_url":"https://api.github.com/users/OCA/followers","following_url":"https://api.github.com/users/OCA/following{/other_user}","gists_url":"https://api.github.com/users/OCA/gists{/gist_id}","starred_url":"https://api.github.com/users/OCA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OCA/subscriptions","organizations_url":"https://api.github.com/users/OCA/orgs","repos_url":"https://api.github.com/users/OCA/repos","events_url":"https://api.github.com/users/OCA/events{/privacy}","received_events_url":"https://api.github.com/users/OCA/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OCA/server-tools","description":"Tools for Odoo Administrators to improve some technical features on Odoo.","fork":false,"url":"https://api.github.com/repos/OCA/server-tools","forks_url":"https://api.github.com/repos/OCA/server-tools/forks","keys_url":"https://api.github.com/repos/OCA/server-tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OCA/server-tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OCA/server-tools/teams","hooks_url":"https://api.github.com/repos/OCA/server-tools/hooks","issue_events_url":"https://api.github.com/repos/OCA/server-tools/issues/events{/number}","events_url":"https://api.github.com/repos/OCA/server-tools/events","assignees_url":"https://api.github.com/repos/OCA/server-tools/assignees{/user}","branches_url":"https://api.github.com/repos/OCA/server-tools/branches{/branch}","tags_url":"https://api.github.com/repos/OCA/server-tools/tags","blobs_url":"https://api.github.com/repos/OCA/server-tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OCA/server-tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OCA/server-tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/OCA/server-tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OCA/server-tools/statuses/{sha}","languages_url":"https://api.github.com/repos/OCA/server-tools/languages","stargazers_url":"https://api.github.com/repos/OCA/server-tools/stargazers","contributors_url":"https://api.github.com/repos/OCA/server-tools/contributors","subscribers_url":"https://api.github.com/repos/OCA/server-tools/subscribers","subscription_url":"https://api.github.com/repos/OCA/server-tools/subscription","commits_url":"https://api.github.com/repos/OCA/server-tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/OCA/server-tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/OCA/server-tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/OCA/server-tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/OCA/server-tools/contents/{+path}","compare_url":"https://api.github.com/repos/OCA/server-tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OCA/server-tools/merges","archive_url":"https://api.github.com/repos/OCA/server-tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OCA/server-tools/downloads","issues_url":"https://api.github.com/repos/OCA/server-tools/issues{/number}","pulls_url":"https://api.github.com/repos/OCA/server-tools/pulls{/number}","milestones_url":"https://api.github.com/repos/OCA/server-tools/milestones{/number}","notifications_url":"https://api.github.com/repos/OCA/server-tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OCA/server-tools/labels{/name}","releases_url":"https://api.github.com/repos/OCA/server-tools/releases{/id}","deployments_url":"https://api.github.com/repos/OCA/server-tools/deployments","created_at":"2014-06-16T18:52:44Z","updated_at":"2016-09-24T12:25:07Z","pushed_at":"2016-09-26T19:34:03Z","git_url":"git://github.com/OCA/server-tools.git","ssh_url":"git@github.com:OCA/server-tools.git","clone_url":"https://github.com/OCA/server-tools.git","svn_url":"https://github.com/OCA/server-tools","homepage":"https://odoo-community.org/project/tools-maintainers-30","size":15089,"stargazers_count":129,"watchers_count":129,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":372,"mirror_url":null,"open_issues_count":131,"forks":372,"open_issues":131,"watchers":129,"default_branch":"9.0"}},"_links":{"self":{"href":"https://api.github.com/repos/OCA/server-tools/pulls/265"},"html":{"href":"https://github.com/OCA/server-tools/pull/265"},"issue":{"href":"https://api.github.com/repos/OCA/server-tools/issues/265"},"comments":{"href":"https://api.github.com/repos/OCA/server-tools/issues/265/comments"},"review_comments":{"href":"https://api.github.com/repos/OCA/server-tools/pulls/265/comments"},"review_comment":{"href":"https://api.github.com/repos/OCA/server-tools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OCA/server-tools/pulls/265/commits"},"statuses":{"href":"https://api.github.com/repos/OCA/server-tools/statuses/bac892aa183f9b152efdb0e08de4d58ebc9e2fb7"}}}}
{"actor":{"display_login":"elicoidal"}}