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

[ML] Fix formatting of values for time of day or week anomalies #32134

Merged

Conversation

peteharverson
Copy link
Contributor

@peteharverson peteharverson commented Feb 27, 2019

Summary

Fixes the formatting of actual and typical values in the anomalies table for time_of_day and time_of_week detectors.

Fixes two issues:

  1. Times are formatted in 24 hour format where before 12 hour format was incorrectly being used
  2. Dates / times are formatted taking into account that the anomaly values are the offset in seconds from the UTC start of the day / week.

The values are formatted by using the timestamp of the anomaly, working in UTC, then get the start of the day / week in UTC, add on the offset value in seconds, and finally format in HH:mm or ddd HH:mm format using the configured Kibana timezone.

Before (anomaly time is 22:00, but actual in table is shown as 11:02 - one hour out and 12 hour format)
image

After (anomaly time is 22:00, and actual correctly displayed as 22:02)
image

Checklist

For maintainers

Fixes #32023

@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui

Copy link
Member

@jgowdyelastic jgowdyelastic left a comment

Choose a reason for hiding this comment

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

LGTM

@elasticmachine
Copy link
Contributor

💔 Build Failed

@peteharverson
Copy link
Contributor Author

retest

Copy link
Contributor

@walterra walterra left a comment

Choose a reason for hiding this comment

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

LGTM

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@alvarezmelissa87 alvarezmelissa87 left a comment

Choose a reason for hiding this comment

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

Bit late on this but LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ML] Anomalies table shows wrong actual and typical values for time_of_day/week detectors
6 participants