{"action":"created","comment":{"url":"https://api.github.com/repos/DataDog/go-metro/pulls/comments/54597867","id":54597867,"diff_hunk":"@@ -74,12 +75,22 @@ func (r *Client) Report() error {\n \n \tticker := time.NewTicker(time.Duration(r.sleep) * time.Second)\n \tdone := false\n+\tvar memstats runtime.MemStats\n \tfor !done {\n \t\tselect {\n \t\tcase key := <-r.flows.Expire:\n \t\t\tr.flows.Delete(key)\n \t\t\tlog.Infof(\"Flow expired: [%s]\", key)\n \t\tcase <-ticker.C:\n+\t\t\tflush := false\n+\t\t\tnow := time.Now().Unix()\n+\n+\t\t\truntime.ReadMemStats(&memstats)\n+\t\t\tpct := float64(memstats.Alloc) / float64(memstats.Sys)","path":"reporter.go","position":23,"original_position":23,"commit_id":"e64e5e9c280f41aa33774857d90a815f6c0e7568","original_commit_id":"e64e5e9c280f41aa33774857d90a815f6c0e7568","user":{"login":"olivielpeau","id":4912500,"avatar_url":"https://avatars.githubusercontent.com/u/4912500?v=3","gravatar_id":"","url":"https://api.github.com/users/olivielpeau","html_url":"https://github.com/olivielpeau","followers_url":"https://api.github.com/users/olivielpeau/followers","following_url":"https://api.github.com/users/olivielpeau/following{/other_user}","gists_url":"https://api.github.com/users/olivielpeau/gists{/gist_id}","starred_url":"https://api.github.com/users/olivielpeau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olivielpeau/subscriptions","organizations_url":"https://api.github.com/users/olivielpeau/orgs","repos_url":"https://api.github.com/users/olivielpeau/repos","events_url":"https://api.github.com/users/olivielpeau/events{/privacy}","received_events_url":"https://api.github.com/users/olivielpeau/received_events","type":"User","site_admin":false},"body":"qq:`memstats.Sys` reflects the `bytes obtained from system` by the runtime, is it what you want to know, or would you rather use the total memory of the system?","created_at":"2016-03-01T16:58:16Z","updated_at":"2016-03-01T16:58:16Z","html_url":"https://github.com/DataDog/go-metro/pull/12#discussion_r54597867","pull_request_url":"https://api.github.com/repos/DataDog/go-metro/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/DataDog/go-metro/pulls/comments/54597867"},"html":{"href":"https://github.com/DataDog/go-metro/pull/12#discussion_r54597867"},"pull_request":{"href":"https://api.github.com/repos/DataDog/go-metro/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/DataDog/go-metro/pulls/12","id":61267768,"html_url":"https://github.com/DataDog/go-metro/pull/12","diff_url":"https://github.com/DataDog/go-metro/pull/12.diff","patch_url":"https://github.com/DataDog/go-metro/pull/12.patch","issue_url":"https://api.github.com/repos/DataDog/go-metro/issues/12","number":12,"state":"open","locked":false,"title":"[go-metro] mem fixes. Don't let bookkeeping get too big for flows.","user":{"login":"truthbk","id":448216,"avatar_url":"https://avatars.githubusercontent.com/u/448216?v=3","gravatar_id":"","url":"https://api.github.com/users/truthbk","html_url":"https://github.com/truthbk","followers_url":"https://api.github.com/users/truthbk/followers","following_url":"https://api.github.com/users/truthbk/following{/other_user}","gists_url":"https://api.github.com/users/truthbk/gists{/gist_id}","starred_url":"https://api.github.com/users/truthbk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/truthbk/subscriptions","organizations_url":"https://api.github.com/users/truthbk/orgs","repos_url":"https://api.github.com/users/truthbk/repos","events_url":"https://api.github.com/users/truthbk/events{/privacy}","received_events_url":"https://api.github.com/users/truthbk/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-03-01T16:23:56Z","updated_at":"2016-03-01T16:58:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0157af165eeada5cff12c5b89fdae42d784bb73d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/DataDog/go-metro/pulls/12/commits","review_comments_url":"https://api.github.com/repos/DataDog/go-metro/pulls/12/comments","review_comment_url":"https://api.github.com/repos/DataDog/go-metro/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DataDog/go-metro/issues/12/comments","statuses_url":"https://api.github.com/repos/DataDog/go-metro/statuses/e64e5e9c280f41aa33774857d90a815f6c0e7568","head":{"label":"DataDog:jaime/memfixes","ref":"jaime/memfixes","sha":"e64e5e9c280f41aa33774857d90a815f6c0e7568","user":{"login":"DataDog","id":365230,"avatar_url":"https://avatars.githubusercontent.com/u/365230?v=3","gravatar_id":"","url":"https://api.github.com/users/DataDog","html_url":"https://github.com/DataDog","followers_url":"https://api.github.com/users/DataDog/followers","following_url":"https://api.github.com/users/DataDog/following{/other_user}","gists_url":"https://api.github.com/users/DataDog/gists{/gist_id}","starred_url":"https://api.github.com/users/DataDog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataDog/subscriptions","organizations_url":"https://api.github.com/users/DataDog/orgs","repos_url":"https://api.github.com/users/DataDog/repos","events_url":"https://api.github.com/users/DataDog/events{/privacy}","received_events_url":"https://api.github.com/users/DataDog/received_events","type":"Organization","site_admin":false},"repo":{"id":44553959,"name":"go-metro","full_name":"DataDog/go-metro","owner":{"login":"DataDog","id":365230,"avatar_url":"https://avatars.githubusercontent.com/u/365230?v=3","gravatar_id":"","url":"https://api.github.com/users/DataDog","html_url":"https://github.com/DataDog","followers_url":"https://api.github.com/users/DataDog/followers","following_url":"https://api.github.com/users/DataDog/following{/other_user}","gists_url":"https://api.github.com/users/DataDog/gists{/gist_id}","starred_url":"https://api.github.com/users/DataDog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataDog/subscriptions","organizations_url":"https://api.github.com/users/DataDog/orgs","repos_url":"https://api.github.com/users/DataDog/repos","events_url":"https://api.github.com/users/DataDog/events{/privacy}","received_events_url":"https://api.github.com/users/DataDog/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DataDog/go-metro","description":"Passively calculate TCP RTT between hosts","fork":false,"url":"https://api.github.com/repos/DataDog/go-metro","forks_url":"https://api.github.com/repos/DataDog/go-metro/forks","keys_url":"https://api.github.com/repos/DataDog/go-metro/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DataDog/go-metro/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DataDog/go-metro/teams","hooks_url":"https://api.github.com/repos/DataDog/go-metro/hooks","issue_events_url":"https://api.github.com/repos/DataDog/go-metro/issues/events{/number}","events_url":"https://api.github.com/repos/DataDog/go-metro/events","assignees_url":"https://api.github.com/repos/DataDog/go-metro/assignees{/user}","branches_url":"https://api.github.com/repos/DataDog/go-metro/branches{/branch}","tags_url":"https://api.github.com/repos/DataDog/go-metro/tags","blobs_url":"https://api.github.com/repos/DataDog/go-metro/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DataDog/go-metro/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DataDog/go-metro/git/refs{/sha}","trees_url":"https://api.github.com/repos/DataDog/go-metro/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DataDog/go-metro/statuses/{sha}","languages_url":"https://api.github.com/repos/DataDog/go-metro/languages","stargazers_url":"https://api.github.com/repos/DataDog/go-metro/stargazers","contributors_url":"https://api.github.com/repos/DataDog/go-metro/contributors","subscribers_url":"https://api.github.com/repos/DataDog/go-metro/subscribers","subscription_url":"https://api.github.com/repos/DataDog/go-metro/subscription","commits_url":"https://api.github.com/repos/DataDog/go-metro/commits{/sha}","git_commits_url":"https://api.github.com/repos/DataDog/go-metro/git/commits{/sha}","comments_url":"https://api.github.com/repos/DataDog/go-metro/comments{/number}","issue_comment_url":"https://api.github.com/repos/DataDog/go-metro/issues/comments{/number}","contents_url":"https://api.github.com/repos/DataDog/go-metro/contents/{+path}","compare_url":"https://api.github.com/repos/DataDog/go-metro/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DataDog/go-metro/merges","archive_url":"https://api.github.com/repos/DataDog/go-metro/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DataDog/go-metro/downloads","issues_url":"https://api.github.com/repos/DataDog/go-metro/issues{/number}","pulls_url":"https://api.github.com/repos/DataDog/go-metro/pulls{/number}","milestones_url":"https://api.github.com/repos/DataDog/go-metro/milestones{/number}","notifications_url":"https://api.github.com/repos/DataDog/go-metro/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DataDog/go-metro/labels{/name}","releases_url":"https://api.github.com/repos/DataDog/go-metro/releases{/id}","deployments_url":"https://api.github.com/repos/DataDog/go-metro/deployments","created_at":"2015-10-19T18:10:01Z","updated_at":"2016-02-18T20:45:31Z","pushed_at":"2016-03-01T16:23:56Z","git_url":"git://github.com/DataDog/go-metro.git","ssh_url":"git@github.com:DataDog/go-metro.git","clone_url":"https://github.com/DataDog/go-metro.git","svn_url":"https://github.com/DataDog/go-metro","homepage":null,"size":796,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"DataDog:master","ref":"master","sha":"1e2cbebfc974586739125f3510c3e73726c31d8d","user":{"login":"DataDog","id":365230,"avatar_url":"https://avatars.githubusercontent.com/u/365230?v=3","gravatar_id":"","url":"https://api.github.com/users/DataDog","html_url":"https://github.com/DataDog","followers_url":"https://api.github.com/users/DataDog/followers","following_url":"https://api.github.com/users/DataDog/following{/other_user}","gists_url":"https://api.github.com/users/DataDog/gists{/gist_id}","starred_url":"https://api.github.com/users/DataDog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataDog/subscriptions","organizations_url":"https://api.github.com/users/DataDog/orgs","repos_url":"https://api.github.com/users/DataDog/repos","events_url":"https://api.github.com/users/DataDog/events{/privacy}","received_events_url":"https://api.github.com/users/DataDog/received_events","type":"Organization","site_admin":false},"repo":{"id":44553959,"name":"go-metro","full_name":"DataDog/go-metro","owner":{"login":"DataDog","id":365230,"avatar_url":"https://avatars.githubusercontent.com/u/365230?v=3","gravatar_id":"","url":"https://api.github.com/users/DataDog","html_url":"https://github.com/DataDog","followers_url":"https://api.github.com/users/DataDog/followers","following_url":"https://api.github.com/users/DataDog/following{/other_user}","gists_url":"https://api.github.com/users/DataDog/gists{/gist_id}","starred_url":"https://api.github.com/users/DataDog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataDog/subscriptions","organizations_url":"https://api.github.com/users/DataDog/orgs","repos_url":"https://api.github.com/users/DataDog/repos","events_url":"https://api.github.com/users/DataDog/events{/privacy}","received_events_url":"https://api.github.com/users/DataDog/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DataDog/go-metro","description":"Passively calculate TCP RTT between hosts","fork":false,"url":"https://api.github.com/repos/DataDog/go-metro","forks_url":"https://api.github.com/repos/DataDog/go-metro/forks","keys_url":"https://api.github.com/repos/DataDog/go-metro/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DataDog/go-metro/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DataDog/go-metro/teams","hooks_url":"https://api.github.com/repos/DataDog/go-metro/hooks","issue_events_url":"https://api.github.com/repos/DataDog/go-metro/issues/events{/number}","events_url":"https://api.github.com/repos/DataDog/go-metro/events","assignees_url":"https://api.github.com/repos/DataDog/go-metro/assignees{/user}","branches_url":"https://api.github.com/repos/DataDog/go-metro/branches{/branch}","tags_url":"https://api.github.com/repos/DataDog/go-metro/tags","blobs_url":"https://api.github.com/repos/DataDog/go-metro/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DataDog/go-metro/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DataDog/go-metro/git/refs{/sha}","trees_url":"https://api.github.com/repos/DataDog/go-metro/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DataDog/go-metro/statuses/{sha}","languages_url":"https://api.github.com/repos/DataDog/go-metro/languages","stargazers_url":"https://api.github.com/repos/DataDog/go-metro/stargazers","contributors_url":"https://api.github.com/repos/DataDog/go-metro/contributors","subscribers_url":"https://api.github.com/repos/DataDog/go-metro/subscribers","subscription_url":"https://api.github.com/repos/DataDog/go-metro/subscription","commits_url":"https://api.github.com/repos/DataDog/go-metro/commits{/sha}","git_commits_url":"https://api.github.com/repos/DataDog/go-metro/git/commits{/sha}","comments_url":"https://api.github.com/repos/DataDog/go-metro/comments{/number}","issue_comment_url":"https://api.github.com/repos/DataDog/go-metro/issues/comments{/number}","contents_url":"https://api.github.com/repos/DataDog/go-metro/contents/{+path}","compare_url":"https://api.github.com/repos/DataDog/go-metro/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DataDog/go-metro/merges","archive_url":"https://api.github.com/repos/DataDog/go-metro/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DataDog/go-metro/downloads","issues_url":"https://api.github.com/repos/DataDog/go-metro/issues{/number}","pulls_url":"https://api.github.com/repos/DataDog/go-metro/pulls{/number}","milestones_url":"https://api.github.com/repos/DataDog/go-metro/milestones{/number}","notifications_url":"https://api.github.com/repos/DataDog/go-metro/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DataDog/go-metro/labels{/name}","releases_url":"https://api.github.com/repos/DataDog/go-metro/releases{/id}","deployments_url":"https://api.github.com/repos/DataDog/go-metro/deployments","created_at":"2015-10-19T18:10:01Z","updated_at":"2016-02-18T20:45:31Z","pushed_at":"2016-03-01T16:23:56Z","git_url":"git://github.com/DataDog/go-metro.git","ssh_url":"git@github.com:DataDog/go-metro.git","clone_url":"https://github.com/DataDog/go-metro.git","svn_url":"https://github.com/DataDog/go-metro","homepage":null,"size":796,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DataDog/go-metro/pulls/12"},"html":{"href":"https://github.com/DataDog/go-metro/pull/12"},"issue":{"href":"https://api.github.com/repos/DataDog/go-metro/issues/12"},"comments":{"href":"https://api.github.com/repos/DataDog/go-metro/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/DataDog/go-metro/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/DataDog/go-metro/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DataDog/go-metro/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/DataDog/go-metro/statuses/e64e5e9c280f41aa33774857d90a815f6c0e7568"}}}}