api - Google BigQuery with javascript - how to get query exe time and how much data (in size) processed by query -


i new bigquery , need more functions in biogquery + javascript can total execution time , how gb of data processed query.

how can know total exe time , processed data size in javascript api.

eg. query complete (1.6s elapsed, 35.7 gb processed)

the above example result javascript api.

the total processed bytes can response. query exeution time this. dont want run timer (to calculate time) before , after query exe.

also need intel on how see executed query history javascript api.

thanks in advance.

to determine how long job took, can compare statistics.creationtime, statistics.starttime, , statistics.endtime, depending on needs. these can accessed jobs.list or jobs.get api. these responses contain bytes processed query in statistics.query.totalbytesprocessed field.

to retrieve history of jobs (including queries, , other load, copy, or extract jobs may have run) can call jobs.list api.

specifically in js, if have query response containing jobreference, can run following retrieve full job details using jobs.get method , log them console. logged response should contain fields linked above.

var projectid = response['jobreference']['projectid']; var jobid = response['jobreference']['jobid']; var path = 'https://clients6.google.com/bigquery/v2/projects/' + projectid + '/jobs/' + jobid; var request = {'path': path, 'method': 'get'}; gapi.client.request(request).execute(function(response) { console.log(response) }); 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -