Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Termination time format #21

Closed
asobti opened this issue Nov 9, 2017 · 3 comments
Closed

Fix Termination time format #21

asobti opened this issue Nov 9, 2017 · 3 comments

Comments

@asobti
Copy link
Owner

asobti commented Nov 9, 2017

Currently, termination time is logged to microseconds granularity along with monotonic clock reading.

I1109 13:40:56.471721      11 schedule.go:28] 	********** Today's schedule **********
I1109 13:40:56.471749      11 schedule.go:32] 	Deployment		Termination time
I1109 13:40:56.471752      11 schedule.go:33] 	----------		----------------
I1109 13:40:56.471757      11 schedule.go:35] 	hello-world		2017-11-09 13:41:28.4717057 -0800 PST m=+62.093720077

See https://golang.org/pkg/time/#Time.String

Suggested fix:

The returned string is meant for debugging; for a stable serialized representation, use t.MarshalText, t.MarshalBinary, or t.Format with an explicit format string.

@Aergonus
Copy link
Collaborator

Aergonus commented Dec 26, 2017

Do you mean to format it without the granularity?
glog.V(4).Infof("\t%s\t\t\t%s\n", chaos.Deployment().Name(), chaos.KillAt().Format("01/02/2006 15:04:05 -0700 MST"))

@Aergonus
Copy link
Collaborator

Aergonus commented Jan 1, 2018

Just formatting will output UTC all the time. There's some inconsistencies with how time is printed in the code. In some places, time.In(config.Timezone()) is used while in other places it uses the system local time which usually defaults to UTC.

This also means issue #23 is valid since termination times are not printed in the configured timezone.

Happy New Years!

Aergonus added a commit to Aergonus/kube-monkey that referenced this issue Jan 2, 2018
standardized variables to loc
added timezone for debugging printing
specified format printout for schedule
addresses asobti#21 and asobti#23
@Aergonus Aergonus mentioned this issue Jan 2, 2018
@Aergonus
Copy link
Collaborator

I think this issue is resolved!

@asobti asobti closed this as completed Jan 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants