The core code is as follows.More details such as full request and response 
logs, and request-id for high latency API requests will be provided to you 
as soon as possible.
Regards
_______________________________________________________________________
def adwords_data_device_cost_new(site, customer_id, ga_service):
    ...
    query = "..."
    response = ga_service.search_stream(
            customer_id=customer_id, query=query)
    ....
    return data

def thread_func(site, customer_id):
    customer_data = adwords_data_device_cost_new(site,
                                                 customer_id, ga_service)
    customer_data = pd.DataFrame(customer_data)
    return customer_data

L1 = []

with ThreadPoolExecutor(10) as pool:
        for customer_id in campaign_dict.keys():
            all_task.append(pool.submit(thread_func, site=site, 
customer_id=customer_id))
    for future in as_completed(all_task):
        customer_data = future.result()
        if not customer_data.empty:
            L1.append(customer_data)
On Monday, 4 July 2022 at 23:51:56 UTC+8 adsapi wrote:

> Hi Jing,
>
> Thanks for reaching out to the Google Ads API Forum.
>
> Could you elaborate more when you say that you are using python 
> multithreading to execute the search_stream method?
>
> Since you’re experiencing high latency sometimes, could you provide us 
> with the complete *request* 
> <https://urldefense.com/v3/__https://developers.google.com/google-ads/api/docs/concepts/field-service*request__;Iw!!N96JrnIq8IfO5w!2JYv5_xj58m-aAxo0QWrLrQzY8EjNyYTDxPtamMWiTlTL3U99heBU88Rx7P8QElG$>
>  
> and *response* 
> <https://urldefense.com/v3/__https://developers.google.com/google-ads/api/docs/concepts/field-service*response__;Iw!!N96JrnIq8IfO5w!2JYv5_xj58m-aAxo0QWrLrQzY8EjNyYTDxPtamMWiTlTL3U99heBU88RxxP3GeoD$>
>  
> logs, with the *request-id* 
> <https://urldefense.com/v3/__https://developers.google.com/google-ads/api/docs/concepts/call-structure*request-id__;Iw!!N96JrnIq8IfO5w!2JYv5_xj58m-aAxo0QWrLrQzY8EjNyYTDxPtamMWiTlTL3U99heBU88RxwIlKt6n$>
>  
> for the API requests where we can see the high latency, so that our team 
> can investigate further? You can enable logging, which you may do so by 
> navigating to the *Client libraries > Your client library (select Python) 
> > Logging* documentation, which you can access from this link 
> <https://developers.google.com/google-ads/api/docs/client-libs>. Kindly 
> send the requested details via reply privately to author option.
>
> Regards,
> [image: Google Logo] 
> Yasar 
> Google Ads API Team 
>   
>
> ref:_00D1U1174p._5004Q2cFyij:ref
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/b878f443-2a33-4f1e-b9dc-d20e6d05cdffn%40googlegroups.com.
  • hi... Jing CHEN
    • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
      • ... Jing CHEN
        • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum

Reply via email to