mirror of
https://github.com/weaveworks/scope.git
synced 2026-08-18 11:56:39 +00:00
Merge pull request #1933 from weaveworks/1928-increase-timestamp-precision
Increase timestamp precision
This commit is contained in:
@@ -30,7 +30,7 @@ const XS_LABEL = {
|
||||
const COLUMN_WIDTHS = {
|
||||
count: CW.XS,
|
||||
container: CW.XS,
|
||||
docker_container_created: CW.XL,
|
||||
docker_container_created: CW.XXL,
|
||||
docker_container_restart_count: CW.M,
|
||||
docker_container_state_human: CW.XXL,
|
||||
docker_container_uptime: '85px',
|
||||
|
||||
@@ -372,7 +372,7 @@ func (c *container) env() map[string]string {
|
||||
func (c *container) getBaseNode() report.Node {
|
||||
result := report.MakeNodeWith(report.MakeContainerNodeID(c.ID()), map[string]string{
|
||||
ContainerID: c.ID(),
|
||||
ContainerCreated: c.container.Created.Format(time.RFC822),
|
||||
ContainerCreated: c.container.Created.Format(time.RFC3339Nano),
|
||||
ContainerCommand: c.container.Path + " " + strings.Join(c.container.Args, " "),
|
||||
ImageID: c.Image(),
|
||||
ContainerHostname: c.Hostname(),
|
||||
|
||||
@@ -70,7 +70,7 @@ func TestContainer(t *testing.T) {
|
||||
}
|
||||
want := report.MakeNodeWith("ping;<container>", map[string]string{
|
||||
"docker_container_command": " ",
|
||||
"docker_container_created": "01 Jan 01 00:00 UTC",
|
||||
"docker_container_created": "0001-01-01T00:00:00Z",
|
||||
"docker_container_id": "ping",
|
||||
"docker_container_name": "pong",
|
||||
"docker_image_id": "baz",
|
||||
|
||||
@@ -43,7 +43,7 @@ func (m meta) Namespace() string {
|
||||
}
|
||||
|
||||
func (m meta) Created() string {
|
||||
return m.ObjectMeta.CreationTimestamp.Format(time.RFC822)
|
||||
return m.ObjectMeta.CreationTimestamp.Format(time.RFC3339Nano)
|
||||
}
|
||||
|
||||
func (m meta) Labels() map[string]string {
|
||||
|
||||
@@ -202,7 +202,7 @@ func TestReporter(t *testing.T) {
|
||||
{pod2ID, serviceID, map[string]string{
|
||||
kubernetes.Name: "pong-b",
|
||||
kubernetes.Namespace: "ping",
|
||||
kubernetes.Created: pod1.Created(),
|
||||
kubernetes.Created: pod2.Created(),
|
||||
}},
|
||||
} {
|
||||
node, ok := rpt.Pod.Nodes[pod.id]
|
||||
@@ -231,7 +231,7 @@ func TestReporter(t *testing.T) {
|
||||
for k, want := range map[string]string{
|
||||
kubernetes.Name: "pongservice",
|
||||
kubernetes.Namespace: "ping",
|
||||
kubernetes.Created: pod1.Created(),
|
||||
kubernetes.Created: service1.Created(),
|
||||
} {
|
||||
if have, ok := node.Latest.Lookup(k); !ok || have != want {
|
||||
t.Errorf("Expected service %s latest %q: %q, got %q", serviceID, k, want, have)
|
||||
|
||||
Reference in New Issue
Block a user