GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — How to retrieve 'totalBytesBilled' · Issue #3706 · googleapis/google-cloud-python

How to retrieve 'totalBytesBilled' #3706

New issue
Copy link
New issue
Copy link
Closed
Closed
How to retrieve 'totalBytesBilled'#3706
Copy link
Assignees
tseaver
Labels
api: bigqueryIssues related to the BigQuery API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Description

@sschatts
sschatts
opened on Jul 31, 2017
Issue body actions
  1. OS type and version: Mac OS Sierra
  2. Python version and virtual environment information python --version: Python 2.7.13
  3. google-cloud-python version pip show google-cloud, pip show google-<service> or pip freeze: google-cloud-bigquery==0.25.0 and google-cloud-core==0.25.0

Issue: Trying to monitor costs of queries on BigQuery by accessing the 'totalBytesBilled' field which is available through the HTTP API (jobs[].statistics.query.totalBytesBilled, https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/list). Is there a way to get this statistic through the Python Client? I've found you can access this through job._properties and was curious if there is a public API to access this.

Thank you!

Activity

  1. tseaver
    added
    api: bigqueryIssues related to the BigQuery API.
    type: questionRequest for information or clarification. Not an issue.
    type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
    and removed
    type: questionRequest for information or clarification. Not an issue.
    on Jul 31, 2017
  2. tseaver commented on Jul 31, 2017

    @tseaver
    tseaver
    on Jul 31, 2017
    Contributor
    More actions

    @sschatts Thanks for the question: it looks like that feature got smuggled into the V2 API after our implementation (there are other new query statistics, too!).

    @tswast Can you confirm?

  3. tseaver commented on Jul 31, 2017

    @tseaver
    tseaver
    on Jul 31, 2017
    Contributor
    More actions

    To my eye, it appears that all the query--specific statistics fields are unmapped, as well as extract.destinationUriFileCounts.

  4. tseaver commented on Jul 31, 2017

    @tseaver
    tseaver
    on Jul 31, 2017
    Contributor
    More actions
    • query-specific staticstics support should be added to job.QueryJob, but might also need to be plumbed through to query.QueryResults.
    • The extract.destinationUriFileCounts statistic should be added to job.ExtractTableToStorageJob.
  5. tseaver commented on Aug 2, 2017

    @tseaver
    tseaver
    on Aug 2, 2017
    Contributor
    More actions

    query-specific statistics:

    • query_plan (maps "queryPlan"; return as list of dict)
    • total_bytes_processed (maps "totalBytesProcessed"; int)
    • total_bytes_billed (maps "totalBytesBilled": int)
    • billing_tier (maps "billingTier": int)
    • cache_hit (maps "cacheHit": bool)
    • referenced_tables (maps "referencedTables"; return list of Table instances?)
    • schema (maps "schema"; return list of SchemaField`)
    • num_dml_affected_rows (maps "numDmlAffectedRows": int)
    • undeclared_query_paramters (maps "undeclaredQueryParameters"; return list of dict?)
    • statement_type (maps `"statementType"; str)
  6. lukesneeringer
    assigned
    tseaver
    on Aug 7, 2017
  7. lukesneeringer
    added
    status: in review
    priority: p2Moderately-important priority. Fix may not be included in next release.
    and removed
    priority: p2Moderately-important priority. Fix may not be included in next release.
    on Aug 7, 2017
  8. tseaver commented on Oct 18, 2017

    @tseaver
    tseaver
    on Oct 18, 2017
    Contributor
    More actions

    Via #3800.

  9. tseaver
    closed this as completedon Oct 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @tseaver
    tseaver

Labels

api: bigqueryIssues related to the BigQuery API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.