{"action":"created","comment":{"url":"https://api.github.com/repos/docker/swarm/pulls/comments/65810999","id":65810999,"diff_hunk":"@@ -44,17 +44,21 @@ func StateString(state *types.ContainerState) string {\n }\n \n // FullStateString returns human-readable description of the state\n-func FullStateString(state *types.ContainerState) string {\n+func FullStateString(container *Container) string {\n+\tduration := container.Engine.DeltaDuration\n+\tstate := container.Info.State\n+\n \tstartedAt, _ := time.Parse(time.RFC3339Nano, state.StartedAt)\n \tfinishedAt, _ := time.Parse(time.RFC3339Nano, state.FinishedAt)\n+\n \tif state.Running {\n \t\tif state.Paused {\n-\t\t\treturn fmt.Sprintf(\"Up %s (Paused)\", units.HumanDuration(time.Now().UTC().Sub(startedAt)))\n+\t\t\treturn fmt.Sprintf(\"Up %s (Paused)\", units.HumanDuration(time.Now().UTC().Sub(startedAt.Add(duration))))\n \t\t}\n \t\tif state.Restarting {\n-\t\t\treturn fmt.Sprintf(\"Restarting (%d) %s ago\", state.ExitCode, units.HumanDuration(time.Now().UTC().Sub(finishedAt)))\n+\t\t\treturn fmt.Sprintf(\"Restarting (%d) %s ago\", state.ExitCode, units.HumanDuration(time.Now().UTC().Sub(finishedAt.Add(duration))))\n \t\t}\n-\t\treturn fmt.Sprintf(\"Up %s\", units.HumanDuration(time.Now().UTC().Sub(startedAt)))\n+\t\treturn fmt.Sprintf(\"Up %s\", units.HumanDuration(time.Now().UTC().Sub(startedAt.Add(duration))))","path":"cluster/container.go","position":22,"original_position":22,"commit_id":"911b87f61530601e268835738d06f61c7691b059","original_commit_id":"911b87f61530601e268835738d06f61c7691b059","user":{"login":"allencloud","id":9465626,"avatar_url":"https://avatars.githubusercontent.com/u/9465626?v=3","gravatar_id":"","url":"https://api.github.com/users/allencloud","html_url":"https://github.com/allencloud","followers_url":"https://api.github.com/users/allencloud/followers","following_url":"https://api.github.com/users/allencloud/following{/other_user}","gists_url":"https://api.github.com/users/allencloud/gists{/gist_id}","starred_url":"https://api.github.com/users/allencloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allencloud/subscriptions","organizations_url":"https://api.github.com/users/allencloud/orgs","repos_url":"https://api.github.com/users/allencloud/repos","events_url":"https://api.github.com/users/allencloud/events{/privacy}","received_events_url":"https://api.github.com/users/allencloud/received_events","type":"User","site_admin":false},"body":"Yes, it is reasonable. Today I will polish this PR.","created_at":"2016-06-05T04:00:38Z","updated_at":"2016-06-05T04:00:38Z","html_url":"https://github.com/docker/swarm/pull/2317#discussion_r65810999","pull_request_url":"https://api.github.com/repos/docker/swarm/pulls/2317","_links":{"self":{"href":"https://api.github.com/repos/docker/swarm/pulls/comments/65810999"},"html":{"href":"https://github.com/docker/swarm/pull/2317#discussion_r65810999"},"pull_request":{"href":"https://api.github.com/repos/docker/swarm/pulls/2317"}}},"pull_request":{"url":"https://api.github.com/repos/docker/swarm/pulls/2317","id":72169428,"html_url":"https://github.com/docker/swarm/pull/2317","diff_url":"https://github.com/docker/swarm/pull/2317.diff","patch_url":"https://github.com/docker/swarm/pull/2317.patch","issue_url":"https://api.github.com/repos/docker/swarm/issues/2317","number":2317,"state":"open","locked":false,"title":"consider systime's difference between swarm and engine","user":{"login":"allencloud","id":9465626,"avatar_url":"https://avatars.githubusercontent.com/u/9465626?v=3","gravatar_id":"","url":"https://api.github.com/users/allencloud","html_url":"https://github.com/allencloud","followers_url":"https://api.github.com/users/allencloud/followers","following_url":"https://api.github.com/users/allencloud/following{/other_user}","gists_url":"https://api.github.com/users/allencloud/gists{/gist_id}","starred_url":"https://api.github.com/users/allencloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allencloud/subscriptions","organizations_url":"https://api.github.com/users/allencloud/orgs","repos_url":"https://api.github.com/users/allencloud/repos","events_url":"https://api.github.com/users/allencloud/events{/privacy}","received_events_url":"https://api.github.com/users/allencloud/received_events","type":"User","site_admin":false},"body":"fixed #2310 \r\n\r\nThis PR did:\r\n1. add a field **DeltaDuration** in struct Engine;\r\n2. use `swarm systime - docker systime in info api` to fill DeltaDuration\r\n3. when calculate Status and Created time in `docker ps`, use DeltaDuration\r\n\r\nSigned-off-by: allencloud <allen.sun@daocloud.io>","created_at":"2016-06-01T12:10:37Z","updated_at":"2016-06-05T04:00:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0c805f9010918d5e212be809a0415ecc18b4aec2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/docker/swarm/pulls/2317/commits","review_comments_url":"https://api.github.com/repos/docker/swarm/pulls/2317/comments","review_comment_url":"https://api.github.com/repos/docker/swarm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/swarm/issues/2317/comments","statuses_url":"https://api.github.com/repos/docker/swarm/statuses/911b87f61530601e268835738d06f61c7691b059","head":{"label":"allencloud:consider-different-systime","ref":"consider-different-systime","sha":"911b87f61530601e268835738d06f61c7691b059","user":{"login":"allencloud","id":9465626,"avatar_url":"https://avatars.githubusercontent.com/u/9465626?v=3","gravatar_id":"","url":"https://api.github.com/users/allencloud","html_url":"https://github.com/allencloud","followers_url":"https://api.github.com/users/allencloud/followers","following_url":"https://api.github.com/users/allencloud/following{/other_user}","gists_url":"https://api.github.com/users/allencloud/gists{/gist_id}","starred_url":"https://api.github.com/users/allencloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allencloud/subscriptions","organizations_url":"https://api.github.com/users/allencloud/orgs","repos_url":"https://api.github.com/users/allencloud/repos","events_url":"https://api.github.com/users/allencloud/events{/privacy}","received_events_url":"https://api.github.com/users/allencloud/received_events","type":"User","site_admin":false},"repo":{"id":52430214,"name":"swarm","full_name":"allencloud/swarm","owner":{"login":"allencloud","id":9465626,"avatar_url":"https://avatars.githubusercontent.com/u/9465626?v=3","gravatar_id":"","url":"https://api.github.com/users/allencloud","html_url":"https://github.com/allencloud","followers_url":"https://api.github.com/users/allencloud/followers","following_url":"https://api.github.com/users/allencloud/following{/other_user}","gists_url":"https://api.github.com/users/allencloud/gists{/gist_id}","starred_url":"https://api.github.com/users/allencloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allencloud/subscriptions","organizations_url":"https://api.github.com/users/allencloud/orgs","repos_url":"https://api.github.com/users/allencloud/repos","events_url":"https://api.github.com/users/allencloud/events{/privacy}","received_events_url":"https://api.github.com/users/allencloud/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/allencloud/swarm","description":"Swarm: a Docker-native clustering system","fork":true,"url":"https://api.github.com/repos/allencloud/swarm","forks_url":"https://api.github.com/repos/allencloud/swarm/forks","keys_url":"https://api.github.com/repos/allencloud/swarm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/allencloud/swarm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/allencloud/swarm/teams","hooks_url":"https://api.github.com/repos/allencloud/swarm/hooks","issue_events_url":"https://api.github.com/repos/allencloud/swarm/issues/events{/number}","events_url":"https://api.github.com/repos/allencloud/swarm/events","assignees_url":"https://api.github.com/repos/allencloud/swarm/assignees{/user}","branches_url":"https://api.github.com/repos/allencloud/swarm/branches{/branch}","tags_url":"https://api.github.com/repos/allencloud/swarm/tags","blobs_url":"https://api.github.com/repos/allencloud/swarm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/allencloud/swarm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/allencloud/swarm/git/refs{/sha}","trees_url":"https://api.github.com/repos/allencloud/swarm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/allencloud/swarm/statuses/{sha}","languages_url":"https://api.github.com/repos/allencloud/swarm/languages","stargazers_url":"https://api.github.com/repos/allencloud/swarm/stargazers","contributors_url":"https://api.github.com/repos/allencloud/swarm/contributors","subscribers_url":"https://api.github.com/repos/allencloud/swarm/subscribers","subscription_url":"https://api.github.com/repos/allencloud/swarm/subscription","commits_url":"https://api.github.com/repos/allencloud/swarm/commits{/sha}","git_commits_url":"https://api.github.com/repos/allencloud/swarm/git/commits{/sha}","comments_url":"https://api.github.com/repos/allencloud/swarm/comments{/number}","issue_comment_url":"https://api.github.com/repos/allencloud/swarm/issues/comments{/number}","contents_url":"https://api.github.com/repos/allencloud/swarm/contents/{+path}","compare_url":"https://api.github.com/repos/allencloud/swarm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/allencloud/swarm/merges","archive_url":"https://api.github.com/repos/allencloud/swarm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/allencloud/swarm/downloads","issues_url":"https://api.github.com/repos/allencloud/swarm/issues{/number}","pulls_url":"https://api.github.com/repos/allencloud/swarm/pulls{/number}","milestones_url":"https://api.github.com/repos/allencloud/swarm/milestones{/number}","notifications_url":"https://api.github.com/repos/allencloud/swarm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/allencloud/swarm/labels{/name}","releases_url":"https://api.github.com/repos/allencloud/swarm/releases{/id}","deployments_url":"https://api.github.com/repos/allencloud/swarm/deployments","created_at":"2016-02-24T09:27:58Z","updated_at":"2016-02-24T09:27:59Z","pushed_at":"2016-06-04T16:45:52Z","git_url":"git://github.com/allencloud/swarm.git","ssh_url":"git@github.com:allencloud/swarm.git","clone_url":"https://github.com/allencloud/swarm.git","svn_url":"https://github.com/allencloud/swarm","homepage":"","size":12619,"stargazers_count":0,"watchers_count":0,"language":"Go","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":"docker:master","ref":"master","sha":"e69bb29b78a32a9acf826576a07ad4eaf38f924c","user":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"repo":{"id":19360616,"name":"swarm","full_name":"docker/swarm","owner":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/docker/swarm","description":"Swarm: a Docker-native clustering system","fork":false,"url":"https://api.github.com/repos/docker/swarm","forks_url":"https://api.github.com/repos/docker/swarm/forks","keys_url":"https://api.github.com/repos/docker/swarm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/swarm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/swarm/teams","hooks_url":"https://api.github.com/repos/docker/swarm/hooks","issue_events_url":"https://api.github.com/repos/docker/swarm/issues/events{/number}","events_url":"https://api.github.com/repos/docker/swarm/events","assignees_url":"https://api.github.com/repos/docker/swarm/assignees{/user}","branches_url":"https://api.github.com/repos/docker/swarm/branches{/branch}","tags_url":"https://api.github.com/repos/docker/swarm/tags","blobs_url":"https://api.github.com/repos/docker/swarm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/swarm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/swarm/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/swarm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/swarm/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/swarm/languages","stargazers_url":"https://api.github.com/repos/docker/swarm/stargazers","contributors_url":"https://api.github.com/repos/docker/swarm/contributors","subscribers_url":"https://api.github.com/repos/docker/swarm/subscribers","subscription_url":"https://api.github.com/repos/docker/swarm/subscription","commits_url":"https://api.github.com/repos/docker/swarm/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/swarm/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/swarm/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/swarm/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker/swarm/contents/{+path}","compare_url":"https://api.github.com/repos/docker/swarm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/swarm/merges","archive_url":"https://api.github.com/repos/docker/swarm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/swarm/downloads","issues_url":"https://api.github.com/repos/docker/swarm/issues{/number}","pulls_url":"https://api.github.com/repos/docker/swarm/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/swarm/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/swarm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/swarm/labels{/name}","releases_url":"https://api.github.com/repos/docker/swarm/releases{/id}","deployments_url":"https://api.github.com/repos/docker/swarm/deployments","created_at":"2014-05-01T23:15:17Z","updated_at":"2016-06-04T15:43:14Z","pushed_at":"2016-06-05T01:16:14Z","git_url":"git://github.com/docker/swarm.git","ssh_url":"git@github.com:docker/swarm.git","clone_url":"https://github.com/docker/swarm.git","svn_url":"https://github.com/docker/swarm","homepage":"","size":56082,"stargazers_count":3763,"watchers_count":3763,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":734,"mirror_url":null,"open_issues_count":330,"forks":734,"open_issues":330,"watchers":3763,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/swarm/pulls/2317"},"html":{"href":"https://github.com/docker/swarm/pull/2317"},"issue":{"href":"https://api.github.com/repos/docker/swarm/issues/2317"},"comments":{"href":"https://api.github.com/repos/docker/swarm/issues/2317/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/swarm/pulls/2317/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/swarm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/swarm/pulls/2317/commits"},"statuses":{"href":"https://api.github.com/repos/docker/swarm/statuses/911b87f61530601e268835738d06f61c7691b059"}}}}
{"actor":{"display_login":"allencloud"}}