Please note that `next_event` is a blocking call and it's expected to take 
longer since it will wait for the next event from gRPC core until timeout, 
if this happens after upgrading gRPC to a certain version, please consider 
open a GitHub issue here <https://github.com/grpc/grpc/issues/new/choose> 
(please 
also include steps to reproduce, you can also get more logs with env var: 
`GRPC_VERBOSITY=debug GRPC_TRACE=all,-timer,-timer_check`).

Best,
Xuan

On Monday, July 24, 2023 at 12:28:13 AM UTC-7 Pablo Iglesias wrote:

>
> Hello,
>
> Were you able to fix the problem? I'm getting the same error as you and 
> I'm not able to fix it.
>
> Thanks
> El miércoles, 17 de mayo de 2023 a las 23:59:56 UTC+2, Zach Reyes escribió:
>
>> Just something we can run and try to reproduce your problem :).
>>
>> On Wednesday, May 17, 2023 at 5:50:58 PM UTC-4 Adam Walters wrote:
>>
>>> Hi Zach,
>>>
>>> Sorry if this is a stupid question but what all are you looking for this 
>>> file to contain?
>>>
>>> On May 17, 2023, at 3:55 PM, 'Zach Reyes' via grpc.io <
>>> grp...@googlegroups.com> wrote:
>>>
>>> Can you please provide a full reproducible file, rather than a single 
>>> file. That we the team can benchmark.
>>>
>>>
>>>
>>> On Tuesday, May 16, 2023 at 1:55:11 PM UTC-4 Adam Walters wrote:
>>>
>>>> Hello,
>>>>
>>>> Recently my program started running extremely slow and upon further 
>>>> investigation found that this '{method 'next_event' of 
>>>> 'grpc._cython.cygrpc.SegregatedCall' objects}' was taking over 5 seconds 
>>>> per call.
>>>>
>>>> I am using all of the latest versions grpc and google-ads packages.
>>>>
>>>> Below is an example of the code that is running and the results from a 
>>>> cProfile run:
>>>> from google.ads.googleads.client import GoogleAdsClient
>>>> from google.ads.googleads.v13.services.services.google_ads_service import 
>>>> pagers
>>>> import logging
>>>>
>>>> logging.basicConfig(level=logging.INFO, format='[%(asctime)s - 
>>>> %(levelname)s] %(message).5000s')
>>>> logging.getLogger('google.ads.googleads.client').setLevel(logging.INFO)
>>>>
>>>> client = GoogleAdsClient.load_from_storage("google-ads.yaml")
>>>> google_ads_service = client.get_service("GoogleAdsService", version=
>>>> 'v13')
>>>>
>>>> class GoogleQuery:
>>>> """A class to query Google Ads API
>>>>
>>>> Attributes:
>>>> client: An initialized GoogleAdsClient instance.
>>>> mcc_id: The Google Ads MCC ID
>>>> search_accounts_query: A query to return all search accounts
>>>> display_accounts_query: A query to return all display accounts
>>>>
>>>> Methods:
>>>> get_existing_search_accounts: Returns a dictionary of existing search 
>>>> accounts
>>>> get_existing_display_accounts: Returns a dictionary of existing display 
>>>> accounts
>>>> run_gaql_query: Runs a GAQL query and returns a Pager object
>>>> """
>>>>
>>>> def __init__(self):
>>>> self.client = client
>>>> self.mcc_id = "XXXXXXXXXX"
>>>> self.search_accounts_query = """SELECT
>>>> customer_client.id,
>>>> customer_client.resource_name,
>>>> customer_client.descriptive_name,
>>>> customer_client.manager,
>>>> customer_client.applied_labels
>>>> FROM 
>>>> customer_client
>>>> WHERE
>>>> customer_client.manager = false 
>>>> AND customer_client.id IS NOT NULL 
>>>> AND customer_client.descriptive_name LIKE '%Search%'
>>>> AND customer.status = 'ENABLED'"""
>>>>
>>>> @staticmethod
>>>> def run_gaql_query(query: str, customer_id) -> pagers.SearchPager:
>>>> """runs GAQL query through Google Ads API
>>>> Args:
>>>> customer_id: customer ID being queried
>>>> query: the actual GAQL query being ran
>>>> Returns:
>>>> Returns a pagers.SearchPager response of the raw data
>>>> """
>>>> return google_ads_service.search(
>>>> customer_id=customer_id,
>>>> query=query
>>>> )
>>>>
>>>> def get_existing_search_accounts(self) -> dict:
>>>> """runs GAQL query through Google Ads API
>>>>
>>>> Returns:
>>>> Returns a dict of {internal_id, account_name}
>>>> """
>>>> response = self.run_gaql_query(self.search_accounts_query, self.mcc_id)
>>>> return {row.customer_client.descriptive_name[-8:]: 
>>>> row.customer_client.descriptive_name for row in response}
>>>>
>>>> gaql = GoogleQuery()
>>>> gaql.get_existing_search_accounts()
>>>>
>>>> # cProfile Results from above code Tue May 16 13:31:28 2023   
>>>>  output_test.pstats
>>>>
>>>>          991213 function calls (973122 primitive calls) in 10.099 
>>>> seconds
>>>>
>>>>    Ordered by: internal time
>>>>    List reduced from 6168 to 20 due to restriction <20>
>>>>
>>>>    ncalls  tottime  percall  cumtime  percall filename:lineno(function)
>>>>         1    7.398    7.398    7.401    7.401 {method 'next_event' of 
>>>> 'grpc._cython.cygrpc.SegregatedCall' objects}
>>>>
>>> -- 
>>> You received this message because you are subscribed to a topic in the 
>>> Google Groups "grpc.io" group.
>>> To unsubscribe from this topic, visit 
>>> https://groups.google.com/d/topic/grpc-io/Z6EBY2LzaGk/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to 
>>> grpc-io+u...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/grpc-io/f5df8252-554a-4363-aa35-8f0209451286n%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/grpc-io/f5df8252-554a-4363-aa35-8f0209451286n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/a2192bc5-d9ea-4bdd-82f5-0f5150117331n%40googlegroups.com.

Reply via email to