Merge pull request #1933 from weaveworks/1928-increase-timestamp-precision

Increase timestamp precision
This commit is contained in:
Alfonso Acosta
2016-10-20 14:01:39 +02:00
committed by GitHub
5 changed files with 6 additions and 6 deletions
@@ -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',
+1 -1
View File
@@ -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(),
+1 -1
View File
@@ -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",
+1 -1
View File
@@ -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 {
+2 -2
View File
@@ -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)