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

perf!: getEntries filters 24 hour timestamp by default #955

Merged
merged 8 commits into from Dec 1, 2020
Merged

Conversation

0xSage
Copy link
Contributor

@0xSage 0xSage commented Nov 24, 2020

Fixes #924

This fix/feat is applied across client libraries in Go, Python, Java and Node, e.g.
googleapis/google-cloud-go#3120
googleapis/python-logging#73

@0xSage 0xSage requested review from a team as code owners November 24, 2020 22:33
@0xSage 0xSage self-assigned this Nov 24, 2020
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Nov 24, 2020
@product-auto-label product-auto-label bot added the api: logging Issues related to the googleapis/nodejs-logging API. label Nov 24, 2020
@0xSage 0xSage added the priority: p2 Moderately-important priority. Fix may not be included in next release. label Nov 24, 2020
@codecov
Copy link

codecov bot commented Nov 24, 2020

Codecov Report

Merging #955 (42bc8d2) into master (1fa8cd3) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #955   +/-   ##
=======================================
  Coverage   98.38%   98.39%           
=======================================
  Files          18       18           
  Lines       12977    12985    +8     
  Branches      412      414    +2     
=======================================
+ Hits        12768    12776    +8     
  Misses        207      207           
  Partials        2        2           
Impacted Files Coverage Δ
src/index.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1fa8cd3...42bc8d2. Read the comment docs.

@0xSage 0xSage changed the title feat!: getEntries filters 24 hour timestamp by default perf!: getEntries filters 24 hour timestamp by default Nov 25, 2020
bcoe
bcoe previously requested changes Nov 30, 2020
Copy link
Contributor

@bcoe bcoe left a comment

Choose a reason for hiding this comment

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

Unless this is changing the API surface, I'd avoid indicating that it's a breaking change with !, as this will result in a major version bump.

@0xSage 0xSage changed the title perf!: getEntries filters 24 hour timestamp by default perf: getEntries filters 24 hour timestamp by default Nov 30, 2020
@0xSage 0xSage changed the title perf: getEntries filters 24 hour timestamp by default perf!: getEntries filters 24 hour timestamp by default Nov 30, 2020
@0xSage 0xSage requested a review from bcoe December 1, 2020 03:58
@0xSage
Copy link
Contributor Author

0xSage commented Dec 1, 2020

@bcoe possible to resolve the change request so this one can be merged as well?

// By default, sort entries by descending timestamp
let reqOpts = extend({orderBy: 'timestamp desc'}, options);

// By default, filter entries to last 24 hours only
Copy link
Contributor

Choose a reason for hiding this comment

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

What was the previous behavior?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Previously, it would get as many entries as possible until a max threshold was reached. It took about 10 minutes. The default behavior across CLI is actually to filter by 24 hours, as well as what's recommended in documentation.
We were getting a lot of support tickets across different language repos on this.
This fix reduces query time to a few seconds.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good, I just wanted to get that information to determine if it's a breaking change, which it sounds like it is. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great question, this actually got a lot of debate. After some back and forth in the chats, we decided to mark it as breaking. and bundle it with another breaking fix that just got merged last night

Copy link
Contributor

Choose a reason for hiding this comment

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

Great, thanks!

@0xSage 0xSage merged commit 3d63d5f into master Dec 1, 2020
@stephenplusplus stephenplusplus deleted the fix924 branch December 1, 2020 21:20
@release-please release-please bot mentioned this pull request Dec 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: logging Issues related to the googleapis/nodejs-logging API. cla: yes This human has signed the Contributor License Agreement. priority: p2 Moderately-important priority. Fix may not be included in next release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

listlogs: listLogs and listLogEntries should filter by last 24 hours by default
3 participants