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

Default CW Metrics timezone changed to UTC (#2106) #2394

Merged
merged 3 commits into from May 14, 2018

Conversation

vmuraven
Copy link
Contributor

Please Merge.

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', ''):
Copy link
Collaborator

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.

Copy link
Collaborator

@kapilt kapilt left a 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


self.assertEqual(gts.minute,t1.minute)

os.environ["C7N_METRICS_TZ"] = 'TRUE'
Copy link
Collaborator

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.


t1 = datetime.datetime.now()

os.unsetenv("C7N_METRICS_TZ")
Copy link
Collaborator

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.


mo = MetricsOutput(None)
c7nmetric = os.getenv("C7N_METRICS_TZ")

Copy link
Collaborator

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.

Copy link
Collaborator

@kapilt kapilt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks!

@kapilt kapilt merged commit 3e5853d into cloud-custodian:master May 14, 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

Successfully merging this pull request may close these issues.

None yet

2 participants