MCPcopy Index your code
hub / github.com/aws/aws-cli / _wait_and_collect_mem

Function _wait_and_collect_mem

awscli/testutils.py:788–809  ·  view source on GitHub ↗
(process)

Source from the content-addressed store, hash-verified

786
787
788def _wait_and_collect_mem(process):
789 # We only know how to collect memory on mac/linux.
790 if platform.system() == 'Darwin':
791 get_memory = _get_memory_with_ps
792 elif platform.system() == 'Linux':
793 get_memory = _get_memory_with_ps
794 else:
795 raise ValueError(
796 "Can't collect memory for process on platform %s."
797 % platform.system()
798 )
799 memory = []
800 while process.poll() is None:
801 try:
802 current = get_memory(process.pid)
803 except ProcessTerminatedError:
804 # It's possible the process terminated between .poll()
805 # and get_memory().
806 break
807 memory.append(current)
808 stdout, stderr = process.communicate()
809 return stdout, stderr, memory
810
811
812def _get_memory_with_ps(pid):

Callers 1

awsFunction · 0.85

Calls 1

communicateMethod · 0.45

Tested by

no test coverage detected