{"action":"created","comment":{"url":"https://api.github.com/repos/VoltDB/voltdb/pulls/comments/105566069","pull_request_review_id":26452545,"id":105566069,"diff_hunk":"@@ -38,157 +38,41 @@\n      * Record statistics of procedure execution every N invocations.\n      */\n     private int m_statsSamplingInterval = 20;\n-\n     protected void setStatsSamplingInterval(int timeCollectionInterval) {\n         m_statsSamplingInterval = timeCollectionInterval;\n     }\n \n     /**\n-     * Record statistics for each statement in the stored procedure.\n+     * Whether to return incremental results since polling or since the beginning\n      */\n-    private class ProcedureStmtStat {\n-        /**\n-         * The name of the statement.\n-         * If it's for the statistics of the whole procedure, the name will be <ALL>.\n-         */\n-        private String m_stmtName;\n-\n-        /**\n-         * Number of times this procedure has been invoked.\n-         */\n-        private long m_invocations = 0;\n-        private long m_lastInvocations = 0;\n-\n-        /**\n-         * Number of timed invocations\n-         */\n-        private long m_timedInvocations = 0;\n-        private long m_lastTimedInvocations = 0;\n-\n-        /**\n-         * Total amount of timed execution time\n-         */\n-        private long m_totalTimedExecutionTime = 0;\n-        private long m_lastTotalTimedExecutionTime = 0;\n-\n-        /**\n-         * Shortest amount of time this procedure has executed in\n-         */\n-        private long m_minExecutionTime = Long.MAX_VALUE;\n-        private long m_lastMinExecutionTime = Long.MAX_VALUE;\n-\n-        /**\n-         * Longest amount of time this procedure has executed in\n-         */\n-        private long m_maxExecutionTime = Long.MIN_VALUE;\n-        private long m_lastMaxExecutionTime = Long.MIN_VALUE;\n-\n-        /**\n-         * Time the procedure was last started\n-         * (Not used by per-fragment stats)\n-         */\n-        private long m_currentStartTime = -1;\n-\n-        /**\n-         * Count of the number of aborts (user initiated or DB initiated)\n-         */\n-        private long m_abortCount = 0;\n-        private long m_lastAbortCount = 0;\n-\n-        /**\n-         * Count of the number of errors that occured during procedure execution\n-         */\n-        private long m_failureCount = 0;\n-        private long m_lastFailureCount = 0;\n-\n-        /**\n-         * Smallest result size\n-         */\n-        private int m_minResultSize = Integer.MAX_VALUE;\n-        private int m_lastMinResultSize = Integer.MAX_VALUE;\n-\n-        /**\n-         * Largest result size\n-         */\n-        private int m_maxResultSize = Integer.MIN_VALUE;\n-        private int m_lastMaxResultSize = Integer.MIN_VALUE;\n-\n-        /**\n-         * Total result size for calculating averages\n-         */\n-        private long m_totalResultSize = 0;\n-        private long m_lastTotalResultSize = 0;\n-\n-        /**\n-         * Smallest parameter set size\n-         */\n-        private int m_minParameterSetSize = Integer.MAX_VALUE;\n-        private int m_lastMinParameterSetSize = Integer.MAX_VALUE;\n-\n-        /**\n-         * Largest parameter set size\n-         */\n-        private int m_maxParameterSetSize = Integer.MIN_VALUE;\n-        private int m_lastMaxParameterSetSize = Integer.MIN_VALUE;\n-\n-        /**\n-         * Total parameter set size for calculating averages\n-         */\n-        private long m_totalParameterSetSize = 0;\n-        private long m_lastTotalParameterSetSize = 0;\n-\n-        /**\n-         * >>> Cache uncommitted statistics <<<\n-         * SQLStmts in multi-partition stored procedures can have worker fragments and\n-         * coordinator fragments.\n-         * The worker fragments will first be sent to all the participating SP (single partition)\n-         * sites for execution.\n-         * Then we will select one SP site to execute the coordinator fragment.\n-         * Every MpTransactionState has a m_buddyHSId to indicate which SP site is selected.\n-         *\n-         * Therefore, on the SP site *m_buddyHSId*, the per-fragment statistics include the statistics\n-         * from two fragments (worker + coordinator).\n-         * On this site, the worker fragment statistics will be cached and the calculations will be postponed.\n-         * We will then do the calculation when we receive the coordinator fragment statistics.\n-         */\n-        private long m_cachedExecutionTime = 0;\n-        private int m_cachedResultSize = 0;\n-        private int m_cachedParameterSetSize = 0;\n-\n-        public ProcedureStmtStat(String stmtName) {\n-            m_stmtName = stmtName;\n-        }\n-    }\n-\n-    /**\n-     * Whether to return results in intervals since polling or since the beginning\n-     */\n-    private boolean m_interval = false;\n+    private boolean m_incremental = false;\n \n     private final String m_procName;\n     private final int m_partitionId;\n+    // Mapping from the variable name of the user-defined SQLStmts to its stats.\n+    private final Map<String, StatementStats> m_stmtStatsMap;\n+    private final StatsData m_procStatsData;\n \n-    private Map<String, ProcedureStmtStat> m_stats;\n-    private ProcedureStmtStat m_procStat;\n-\n-    /**\n-     * Constructor requires no args because it has access to the enclosing classes members.\n-     */\n     public ProcedureStatsCollector(long siteId, int partitionId, Procedure catProc,\n                                    ArrayList<String> stmtNames) {\n         super(siteId, false);\n         m_partitionId = partitionId;\n         m_procName = catProc.getClassname();\n-        // Use LinkedHashMap to have a fixed element order.\n-        m_stats = new LinkedHashMap<String, ProcedureStmtStat>();\n-        // Use one ProcedureStmtStat instance to hold the procedure-wide statistics.\n-        m_procStat = new ProcedureStmtStat(\"<ALL>\");\n+\n+        m_stmtStatsMap = new HashMap<String, StatementStats>();","path":"src/frontend/org/voltdb/ProcedureStatsCollector.java","position":null,"original_position":175,"commit_id":"65e07338397672102a854e353b5a974663816ab3","original_commit_id":"9f30eecb9d7633a2ba45fdccee35014b2ae5de2d","user":{"login":"wolffcm","id":7902964,"avatar_url":"https://avatars2.githubusercontent.com/u/7902964?v=3","gravatar_id":"","url":"https://api.github.com/users/wolffcm","html_url":"https://github.com/wolffcm","followers_url":"https://api.github.com/users/wolffcm/followers","following_url":"https://api.github.com/users/wolffcm/following{/other_user}","gists_url":"https://api.github.com/users/wolffcm/gists{/gist_id}","starred_url":"https://api.github.com/users/wolffcm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wolffcm/subscriptions","organizations_url":"https://api.github.com/users/wolffcm/orgs","repos_url":"https://api.github.com/users/wolffcm/repos","events_url":"https://api.github.com/users/wolffcm/events{/privacy}","received_events_url":"https://api.github.com/users/wolffcm/received_events","type":"User","site_admin":false},"body":"The keys in this map represent the statement name from the Java code?  Then why use `null` key entry instead of `\"<ALL>\"` for the procedure-wide entry?","created_at":"2017-03-12T19:13:44Z","updated_at":"2017-03-12T19:49:11Z","html_url":"https://github.com/VoltDB/voltdb/pull/4343#discussion_r105566069","pull_request_url":"https://api.github.com/repos/VoltDB/voltdb/pulls/4343","_links":{"self":{"href":"https://api.github.com/repos/VoltDB/voltdb/pulls/comments/105566069"},"html":{"href":"https://github.com/VoltDB/voltdb/pull/4343#discussion_r105566069"},"pull_request":{"href":"https://api.github.com/repos/VoltDB/voltdb/pulls/4343"}}},"pull_request":{"url":"https://api.github.com/repos/VoltDB/voltdb/pulls/4343","id":109973614,"html_url":"https://github.com/VoltDB/voltdb/pull/4343","diff_url":"https://github.com/VoltDB/voltdb/pull/4343.diff","patch_url":"https://github.com/VoltDB/voltdb/pull/4343.patch","issue_url":"https://api.github.com/repos/VoltDB/voltdb/issues/4343","number":4343,"state":"open","locked":false,"title":"ENG-11890 proceduredetail output","user":{"login":"yzhang1991","id":6643318,"avatar_url":"https://avatars2.githubusercontent.com/u/6643318?v=3","gravatar_id":"","url":"https://api.github.com/users/yzhang1991","html_url":"https://github.com/yzhang1991","followers_url":"https://api.github.com/users/yzhang1991/followers","following_url":"https://api.github.com/users/yzhang1991/following{/other_user}","gists_url":"https://api.github.com/users/yzhang1991/gists{/gist_id}","starred_url":"https://api.github.com/users/yzhang1991/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yzhang1991/subscriptions","organizations_url":"https://api.github.com/users/yzhang1991/orgs","repos_url":"https://api.github.com/users/yzhang1991/repos","events_url":"https://api.github.com/users/yzhang1991/events{/privacy}","received_events_url":"https://api.github.com/users/yzhang1991/received_events","type":"User","site_admin":false},"body":"I spent some time putting voltdbipc to work, there is still some work in the `TestProcedureStats`.\r\nBut I think I should sent the rest part to review first.","created_at":"2017-03-09T18:13:06Z","updated_at":"2017-03-12T19:49:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c09c436aee3e65445e2a3459dbe07f4f999ecbc9","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/VoltDB/voltdb/pulls/4343/commits","review_comments_url":"https://api.github.com/repos/VoltDB/voltdb/pulls/4343/comments","review_comment_url":"https://api.github.com/repos/VoltDB/voltdb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/VoltDB/voltdb/issues/4343/comments","statuses_url":"https://api.github.com/repos/VoltDB/voltdb/statuses/65e07338397672102a854e353b5a974663816ab3","head":{"label":"VoltDB:ENG-11890-PROCEDUREDETAIL-output","ref":"ENG-11890-PROCEDUREDETAIL-output","sha":"65e07338397672102a854e353b5a974663816ab3","user":{"login":"VoltDB","id":703910,"avatar_url":"https://avatars0.githubusercontent.com/u/703910?v=3","gravatar_id":"","url":"https://api.github.com/users/VoltDB","html_url":"https://github.com/VoltDB","followers_url":"https://api.github.com/users/VoltDB/followers","following_url":"https://api.github.com/users/VoltDB/following{/other_user}","gists_url":"https://api.github.com/users/VoltDB/gists{/gist_id}","starred_url":"https://api.github.com/users/VoltDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VoltDB/subscriptions","organizations_url":"https://api.github.com/users/VoltDB/orgs","repos_url":"https://api.github.com/users/VoltDB/repos","events_url":"https://api.github.com/users/VoltDB/events{/privacy}","received_events_url":"https://api.github.com/users/VoltDB/received_events","type":"Organization","site_admin":false},"repo":{"id":2445970,"name":"voltdb","full_name":"VoltDB/voltdb","owner":{"login":"VoltDB","id":703910,"avatar_url":"https://avatars0.githubusercontent.com/u/703910?v=3","gravatar_id":"","url":"https://api.github.com/users/VoltDB","html_url":"https://github.com/VoltDB","followers_url":"https://api.github.com/users/VoltDB/followers","following_url":"https://api.github.com/users/VoltDB/following{/other_user}","gists_url":"https://api.github.com/users/VoltDB/gists{/gist_id}","starred_url":"https://api.github.com/users/VoltDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VoltDB/subscriptions","organizations_url":"https://api.github.com/users/VoltDB/orgs","repos_url":"https://api.github.com/users/VoltDB/repos","events_url":"https://api.github.com/users/VoltDB/events{/privacy}","received_events_url":"https://api.github.com/users/VoltDB/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/VoltDB/voltdb","description":"VoltDB","fork":false,"url":"https://api.github.com/repos/VoltDB/voltdb","forks_url":"https://api.github.com/repos/VoltDB/voltdb/forks","keys_url":"https://api.github.com/repos/VoltDB/voltdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/VoltDB/voltdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/VoltDB/voltdb/teams","hooks_url":"https://api.github.com/repos/VoltDB/voltdb/hooks","issue_events_url":"https://api.github.com/repos/VoltDB/voltdb/issues/events{/number}","events_url":"https://api.github.com/repos/VoltDB/voltdb/events","assignees_url":"https://api.github.com/repos/VoltDB/voltdb/assignees{/user}","branches_url":"https://api.github.com/repos/VoltDB/voltdb/branches{/branch}","tags_url":"https://api.github.com/repos/VoltDB/voltdb/tags","blobs_url":"https://api.github.com/repos/VoltDB/voltdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/VoltDB/voltdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/VoltDB/voltdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/VoltDB/voltdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/VoltDB/voltdb/statuses/{sha}","languages_url":"https://api.github.com/repos/VoltDB/voltdb/languages","stargazers_url":"https://api.github.com/repos/VoltDB/voltdb/stargazers","contributors_url":"https://api.github.com/repos/VoltDB/voltdb/contributors","subscribers_url":"https://api.github.com/repos/VoltDB/voltdb/subscribers","subscription_url":"https://api.github.com/repos/VoltDB/voltdb/subscription","commits_url":"https://api.github.com/repos/VoltDB/voltdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/VoltDB/voltdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/VoltDB/voltdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/VoltDB/voltdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/VoltDB/voltdb/contents/{+path}","compare_url":"https://api.github.com/repos/VoltDB/voltdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/VoltDB/voltdb/merges","archive_url":"https://api.github.com/repos/VoltDB/voltdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/VoltDB/voltdb/downloads","issues_url":"https://api.github.com/repos/VoltDB/voltdb/issues{/number}","pulls_url":"https://api.github.com/repos/VoltDB/voltdb/pulls{/number}","milestones_url":"https://api.github.com/repos/VoltDB/voltdb/milestones{/number}","notifications_url":"https://api.github.com/repos/VoltDB/voltdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/VoltDB/voltdb/labels{/name}","releases_url":"https://api.github.com/repos/VoltDB/voltdb/releases{/id}","deployments_url":"https://api.github.com/repos/VoltDB/voltdb/deployments","created_at":"2011-09-23T18:46:12Z","updated_at":"2017-03-12T01:38:08Z","pushed_at":"2017-03-12T16:01:03Z","git_url":"git://github.com/VoltDB/voltdb.git","ssh_url":"git@github.com:VoltDB/voltdb.git","clone_url":"https://github.com/VoltDB/voltdb.git","svn_url":"https://github.com/VoltDB/voltdb","homepage":"http://community.voltdb.com/","size":487437,"stargazers_count":938,"watchers_count":938,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":292,"mirror_url":null,"open_issues_count":72,"forks":292,"open_issues":72,"watchers":938,"default_branch":"master"}},"base":{"label":"VoltDB:ENG-12015-PROCEDUREDETAIL-EE","ref":"ENG-12015-PROCEDUREDETAIL-EE","sha":"b43ad71321b091032c9a1d06da278698628ba02d","user":{"login":"VoltDB","id":703910,"avatar_url":"https://avatars0.githubusercontent.com/u/703910?v=3","gravatar_id":"","url":"https://api.github.com/users/VoltDB","html_url":"https://github.com/VoltDB","followers_url":"https://api.github.com/users/VoltDB/followers","following_url":"https://api.github.com/users/VoltDB/following{/other_user}","gists_url":"https://api.github.com/users/VoltDB/gists{/gist_id}","starred_url":"https://api.github.com/users/VoltDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VoltDB/subscriptions","organizations_url":"https://api.github.com/users/VoltDB/orgs","repos_url":"https://api.github.com/users/VoltDB/repos","events_url":"https://api.github.com/users/VoltDB/events{/privacy}","received_events_url":"https://api.github.com/users/VoltDB/received_events","type":"Organization","site_admin":false},"repo":{"id":2445970,"name":"voltdb","full_name":"VoltDB/voltdb","owner":{"login":"VoltDB","id":703910,"avatar_url":"https://avatars0.githubusercontent.com/u/703910?v=3","gravatar_id":"","url":"https://api.github.com/users/VoltDB","html_url":"https://github.com/VoltDB","followers_url":"https://api.github.com/users/VoltDB/followers","following_url":"https://api.github.com/users/VoltDB/following{/other_user}","gists_url":"https://api.github.com/users/VoltDB/gists{/gist_id}","starred_url":"https://api.github.com/users/VoltDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VoltDB/subscriptions","organizations_url":"https://api.github.com/users/VoltDB/orgs","repos_url":"https://api.github.com/users/VoltDB/repos","events_url":"https://api.github.com/users/VoltDB/events{/privacy}","received_events_url":"https://api.github.com/users/VoltDB/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/VoltDB/voltdb","description":"VoltDB","fork":false,"url":"https://api.github.com/repos/VoltDB/voltdb","forks_url":"https://api.github.com/repos/VoltDB/voltdb/forks","keys_url":"https://api.github.com/repos/VoltDB/voltdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/VoltDB/voltdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/VoltDB/voltdb/teams","hooks_url":"https://api.github.com/repos/VoltDB/voltdb/hooks","issue_events_url":"https://api.github.com/repos/VoltDB/voltdb/issues/events{/number}","events_url":"https://api.github.com/repos/VoltDB/voltdb/events","assignees_url":"https://api.github.com/repos/VoltDB/voltdb/assignees{/user}","branches_url":"https://api.github.com/repos/VoltDB/voltdb/branches{/branch}","tags_url":"https://api.github.com/repos/VoltDB/voltdb/tags","blobs_url":"https://api.github.com/repos/VoltDB/voltdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/VoltDB/voltdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/VoltDB/voltdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/VoltDB/voltdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/VoltDB/voltdb/statuses/{sha}","languages_url":"https://api.github.com/repos/VoltDB/voltdb/languages","stargazers_url":"https://api.github.com/repos/VoltDB/voltdb/stargazers","contributors_url":"https://api.github.com/repos/VoltDB/voltdb/contributors","subscribers_url":"https://api.github.com/repos/VoltDB/voltdb/subscribers","subscription_url":"https://api.github.com/repos/VoltDB/voltdb/subscription","commits_url":"https://api.github.com/repos/VoltDB/voltdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/VoltDB/voltdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/VoltDB/voltdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/VoltDB/voltdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/VoltDB/voltdb/contents/{+path}","compare_url":"https://api.github.com/repos/VoltDB/voltdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/VoltDB/voltdb/merges","archive_url":"https://api.github.com/repos/VoltDB/voltdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/VoltDB/voltdb/downloads","issues_url":"https://api.github.com/repos/VoltDB/voltdb/issues{/number}","pulls_url":"https://api.github.com/repos/VoltDB/voltdb/pulls{/number}","milestones_url":"https://api.github.com/repos/VoltDB/voltdb/milestones{/number}","notifications_url":"https://api.github.com/repos/VoltDB/voltdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/VoltDB/voltdb/labels{/name}","releases_url":"https://api.github.com/repos/VoltDB/voltdb/releases{/id}","deployments_url":"https://api.github.com/repos/VoltDB/voltdb/deployments","created_at":"2011-09-23T18:46:12Z","updated_at":"2017-03-12T01:38:08Z","pushed_at":"2017-03-12T16:01:03Z","git_url":"git://github.com/VoltDB/voltdb.git","ssh_url":"git@github.com:VoltDB/voltdb.git","clone_url":"https://github.com/VoltDB/voltdb.git","svn_url":"https://github.com/VoltDB/voltdb","homepage":"http://community.voltdb.com/","size":487437,"stargazers_count":938,"watchers_count":938,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":292,"mirror_url":null,"open_issues_count":72,"forks":292,"open_issues":72,"watchers":938,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/VoltDB/voltdb/pulls/4343"},"html":{"href":"https://github.com/VoltDB/voltdb/pull/4343"},"issue":{"href":"https://api.github.com/repos/VoltDB/voltdb/issues/4343"},"comments":{"href":"https://api.github.com/repos/VoltDB/voltdb/issues/4343/comments"},"review_comments":{"href":"https://api.github.com/repos/VoltDB/voltdb/pulls/4343/comments"},"review_comment":{"href":"https://api.github.com/repos/VoltDB/voltdb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/VoltDB/voltdb/pulls/4343/commits"},"statuses":{"href":"https://api.github.com/repos/VoltDB/voltdb/statuses/65e07338397672102a854e353b5a974663816ab3"}}}}
{"actor":{"display_login":"wolffcm"}}