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

logger.list_entries optimization using equals and docs update #1848

Merged
merged 2 commits into from
Jun 10, 2016

Conversation

waprin
Copy link
Contributor

@waprin waprin commented Jun 9, 2016

Two changes here:

logger.list_entries() was using just the logger name rather than the fully qualified name, you can see an example on the docs that from v1 to v2 the change from log to logName also changed to expect fully qualified name.

The query was also using the colon operator, which is a "has" operator. Problem 1 is that this is a slower query because it's not indexed, problem 2 is that I'm pretty sure there's a bug because it's not working.

Second set of changes is the docs, just some random small discrepancies between them and the actual API. The biggest discrepancy was in the Sink constructor, the samples all use keyword arguments and special names for different sink types, the actual code seems to take these all as general positional arguments.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jun 9, 2016
@dhermes dhermes assigned dhermes and tseaver and unassigned dhermes Jun 9, 2016
@dhermes
Copy link
Contributor

dhermes commented Jun 9, 2016

I suppose I should let @tseaver take the lead here

>>> sink = client.sink(
... "robots-pubsub",
... filter='log:apache-access AND textPayload:robot')
>>> sink.pubsub_topic = 'projects/my-project/topics/my-topic'
... 'log:apache-access AND textPayload:robot',

This comment was marked as spam.

This comment was marked as spam.

logName in the v2 API expects the fully
qualified name. The colon operator is “contains”
so it works since the fully qualified name 
contains itself, but it is not indexed and can be
 extremely slow.
@waprin waprin changed the title logger.list_entries bugfix and docs update logger.list_entries optimization using equals and docs update Jun 9, 2016
@waprin
Copy link
Contributor Author

waprin commented Jun 9, 2016

Ok, addressed all review comments, changed commit messages/PR name to reflect that logging changes are optimizations rather then bugfixes,assuming Travis passes it's ready for another pass.

@tseaver tseaver merged commit f0c82ba into googleapis:master Jun 10, 2016
@tseaver
Copy link
Contributor

tseaver commented Jun 10, 2016

@waprin Thanks for the research, as well as the patch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants