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

Added Downsample normalize on week month and year #548

Closed
wants to merge 2 commits into from

Conversation

vito-marcode
Copy link

downsample normalize on week, month and year on non-UTC times using Java Calendar.
It needs additional refinements, but it works, the resulting timestamp will be rounded off at the beginning of the week (7days), month (31days) or year (365days).

downsample normalize on week, month and year on non-UTC times using Java Calendar.
It needs additional refinements, but it works, the resulting timestamp will be rounded off at the beginning of the week (7days), month (31days) or year (365days).
@manolama
Copy link
Member

Cool, thanks for taking a stab at this! Could you do a couple of things:

  • Point it at the Next branch please and work off that?
  • Add a configuration flag like "tsd.query.downsample.use_calendar" that would enable this feature or use the current default for backwards compatibility? Some folks may depend on the current behavior.
  • Add a per-query flag that would override the above
  • Add daily support (some timezones are off by 30 minutes, etc [including North Korea now])
  • Sign the contributors agreement

}

/** Returns timestamp aligned at the first day of month. */
private long toFirstDayOfMonth(long timestamp) {
Copy link
Member

Choose a reason for hiding this comment

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

Move these to the DateTime class as we may want to share them

@mxk1235
Copy link
Contributor

mxk1235 commented Dec 12, 2015

this is super useful. is this going to make it into 2.2?

@cpdevoto
Copy link
Contributor

This pull request is incomplete. I have issued a new pull request (#657) which builds on the work initiated by @moarcaccio, but which also addresses all of the enhancements requested by @manolama, and resolves a few defects with the original pull request.

@manolama
Copy link
Member

Merged @cpdevoto's in 5012f7d

@manolama manolama closed this Mar 13, 2016
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.

4 participants