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

samples: limit list log in samples #227

Merged
merged 4 commits into from
Sep 8, 2020
Merged

samples: limit list log in samples #227

merged 4 commits into from
Sep 8, 2020

Conversation

chingor13
Copy link
Collaborator

Updates the logging_list_log_entries sample to limit logs fetched by timestamp. Querying over the entire log history can take minutes.

@chingor13 chingor13 requested a review from a team September 2, 2020 22:47
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Sep 2, 2020
@@ -35,7 +35,8 @@ public static void main(String... args) throws Exception {

try (Logging logging = options.getService()) {

String logFilter = "logName=projects/" + options.getProjectId() + "/logs/" + logName;
String logFilter = "logName=projects/" + options.getProjectId() + "/logs/" + logName +
" AND timestamp>=\"2020-09-01T00:00:00.000Z\"";
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note that the code to generate this timestamp string is a bit verbose, so I avoided it for this simple sample. The hard coded date should be good enough to keep the query quick enough and signal to the developer that they should include a timestamp in the query

@chingor13 chingor13 added the automerge Merge the pull request once unit tests and other checks pass. label Sep 8, 2020
@codecov
Copy link

codecov bot commented Sep 8, 2020

Codecov Report

Merging #227 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #227   +/-   ##
=========================================
  Coverage     75.37%   75.37%           
  Complexity      593      593           
=========================================
  Files            42       42           
  Lines          3712     3712           
  Branches        259      259           
=========================================
  Hits           2798     2798           
  Misses          760      760           
  Partials        154      154           

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 a4b45eb...0345abc. Read the comment docs.

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/java-logging API. automerge Merge the pull request once unit tests and other checks pass. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants