better year handling when format does not contain year#4
better year handling when format does not contain year#4jsvd merged 2 commits intologstash-plugins:masterfrom
Conversation
|
Eyeballed the code and tests. Looks ok! I have not tested and I have also not done perf analysis. |
|
@purbon how can we use the new perf test suite to analyze the implications of this PR? this is a good candidate to validate our perf platform |
|
@suyograo makes complete sense, will setup an example test case for this. |
|
@jsvd I think you might need to rebase this PR 😸 |
|
@purbon done 👍 |
|
cool, will run this throw the performance gem, kinda want to see how it looks there 😺 |
|
@jsvd running test with this PR make this output in my machine: I guess there might be something fishy going on here.
|
|
Strange: Can you provide me with a seed for a failing spec run? |
|
Hi,
On Fri, Aug 7, 2015 at 3:16 PM João Duarte notifications@github.com wrote:
|
|
I check with your seed and I get the same error. :-(
On Fri, Aug 7, 2015 at 3:32 PM Pere Urbon-Bayes pere.urbon@elastic.co
|
|
on a clean clone, one test is failing on me. |
|
used @purbon's seed I have the same issue |
|
@ph interesting you see one issue, I see three. Might be we should set another variables in the config to setup the same environment for everyone. I have the feeling this is working different in three completely different machines (PT/DE/Canada).
|
|
Yeah, could be related to some |
|
Ok so making sure that we set a timezone in the test plugin instance should make this work. awesome failure ! |
|
😺 |
|
@purbon can you check that at least 2 of the 3 errors are gone now? |
|
my execution looks like this now: errors are gone for me 😸 |
|
@purbon can you teach me to run benchmarks on this pr? |
|
yeah! |
|
I was actually going to do it myself, when I encounter this errors ... but is good if I can teach you too 😄 |
|
Hi, when running the specs, I am missing something? /cheers |
|
hum..my first guess was local timezone, but I can't make it fail on others: |
|
@jsvd I tested several times and everything works, also used another machine in a different time zone. |
|
LGTM |
if the time format does not have year then: * use local year if month is the same as current one * use previous year if current month is January but event is December * use next year if current month is December but event is January * use local year otherwise
|
date filter version 2.1.0 published with this fix. |
|
This bug bit me on Logstash 1.5.x - we now have ES indices dated 2015 with 2016 data. A backport to 1.5.x is too late of course, but fixing the most popular version would have made a lot of sense. |
This is intended to keep parity of behavior between Logstash and Elasticsearch here was the original PR: logstash-plugins/logstash-filter-date#4
|
I know I'm quite late for this discussion, yet - I can't think of a case where we want result to appear in future unless event is in January, and we hit end-of-year clock skew. |
if the time format does not have year then:
fixes #3
has very little impact on formats that have year.
For year-less formats there's extra allocation overhead per event (Time.now, time parsing is no longer direct to long, has to go through 2 DateTime objects)
Performance impact for this change was not analyzed.