How to use count_pending_activity_tasks method in localstack

Best Python code snippet using localstack_python

layer2.py

Source:layer2.py Github

copy

Full Screen

...118 119 exe_objects.append(WorkflowExecution(**exe_args))120 return exe_objects121 @wraps(Layer1.count_pending_activity_tasks)122 def count_pending_activity_tasks(self, task_list):123 """CountPendingActivityTasks."""124 return self._swf.count_pending_activity_tasks(self.name, task_list)125 @wraps(Layer1.count_pending_decision_tasks)126 def count_pending_decision_tasks(self, task_list):127 """CountPendingDecisionTasks."""128 return self._swf.count_pending_decision_tasks(self.name, task_list)129 130class Actor(SWFBase):131 task_list = None132 last_tasktoken = None133 domain = None134 def run(self):135 """To be overloaded by subclasses."""136 raise NotImplementedError()137class ActivityWorker(Actor):138 """Base class for SimpleWorkflow activity workers."""...

Full Screen

Full Screen

Monitor.py

Source:Monitor.py Github

copy

Full Screen

...32 self.logger = logger33 self.cw = cloudwatch.connect_to_region( config.cloudwatch_region )34 def print_queue_depths( self ):35 for stage in sorted( VPW.keys() ):36 print "%s (%s) had %s outstanding tasks." % ( stage, VPW[stage]['task_list'] + config.VPWSuffix + config.UniqueTaskList, self.count_pending_activity_tasks( VPW[stage]['task_list'] + config.VPWSuffix + config.UniqueTaskList )['count'] )37 def update_cloudwatch( self ):38 for stage in sorted( VPW.keys() ):39 self.cw.put_metric_data( config.swf_domain, 40 config.swf_queue_metric, 41 self.count_pending_activity_tasks( VPW[stage]['task_list'] + config.VPWSuffix + config.UniqueTaskList )['count'],42 unit = 'Count',43 dimensions = { 'Stage' : stage,44 'Deployment' : config.VPWSuffix45 }46 )47 48 def set_queue_depth_for_scaling(self):49 trans_name = self.task_list_name('Transcode', VPW, config)50 faced_name = self.task_list_name('FaceDetect', VPW, config)51 activity_name = self.task_list_name( 'ActivityDetect', VPW, config )52 dec_name = self.decider_task_list_name(config)53 ntrans = self.count_pending_activity_tasks(trans_name)['count']54 nfaced = self.count_pending_activity_tasks(faced_name)['count']55 nactivity = self.count_pending_activity_tasks( activity_name )['count']56 ndec = self.count_pending_decision_tasks(dec_name)['count']57 mx = max(nactivity, ndec, ntrans, nfaced)58 dom = config.swf_domain59 self.cw.put_metric_data(dom, 'queue_depth_for_scaling', mx, dimensions = { 'Deployment' : config.VPWSuffix })60 def task_list_name(self, type, settings, conf):61 CheckerUtils.validate_string(type)62 CheckerUtils.validate_dict_nonempty(settings)63 CheckerUtils.validate_object(conf)64 base = settings[type]['task_list']65 suf = conf.VPWSuffix66 id = conf.UniqueTaskList67 return base + suf + id68 69 def decider_task_list_name(self, conf):...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run localstack automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful