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
Default CW Metrics timezone changed to UTC (#2106) #2394
Conversation
c7n/output.py
Outdated
@@ -61,6 +61,12 @@ def __init__(self, ctx, namespace=DEFAULT_NAMESPACE): | |||
self.namespace = namespace | |||
self.buf = [] | |||
|
|||
def get_timestamp(self): | |||
if os.getenv("C7N_METRICS_TZ", '').upper() in ('TRUE', ''): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we comment that this is a backwards compatibility flag, and reference the original issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the pr
tests/test_metric_tz.py
Outdated
|
||
self.assertEqual(gts.minute,t1.minute) | ||
|
||
os.environ["C7N_METRICS_TZ"] = 'TRUE' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just call change_environment(C7N_METRICS_TZ='TRUE') for environment changes.
tests/test_metric_tz.py
Outdated
|
||
t1 = datetime.datetime.now() | ||
|
||
os.unsetenv("C7N_METRICS_TZ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't need to do this, since change_environment will reset post test.
tests/test_metric_tz.py
Outdated
|
||
mo = MetricsOutput(None) | ||
c7nmetric = os.getenv("C7N_METRICS_TZ") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generally stylistically we don't blank new line for each line of code, its more about logical grouping in terms of when we blank newline for readability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks!
Please Merge.