MCPcopy Create free account
hub / github.com/1jehuang/jcode / poll

Method poll

scripts/profile_spawn.py:206–229  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

204 self.n = 0
205
206 def poll(self) -> bool:
207 s = sample_proc(self.pid)
208 if s is None:
209 return False
210 self.n += 1
211 self.end = time.perf_counter()
212 if self.first is None:
213 self.first = s
214 self.last = s
215 if s.rss_bytes:
216 self.peak_rss = max(self.peak_rss, s.rss_bytes)
217 if s.peak_rss_bytes:
218 self.peak_rss = max(self.peak_rss, s.peak_rss_bytes)
219 if s.rss_anon_bytes:
220 self.peak_rss_anon = max(self.peak_rss_anon, s.rss_anon_bytes)
221 if s.pss_bytes:
222 self.peak_pss = max(self.peak_pss, s.pss_bytes)
223 if s.swap_bytes:
224 self.peak_swap = max(self.peak_swap, s.swap_bytes)
225 if s.threads:
226 self.peak_threads = max(self.peak_threads, s.threads)
227 if s.fds:
228 self.peak_fds = max(self.peak_fds, s.fds)
229 return True
230
231 def finalize(self) -> ResourceProfile:
232 p = ResourceProfile()

Callers 15

profile_server_spawnFunction · 0.95
profile_client_spawnFunction · 0.95
profile_single_spawnFunction · 0.45
handle_signalFunction · 0.45
_pumpMethod · 0.45
aliveMethod · 0.45
terminate_processFunction · 0.45
run_attemptFunction · 0.45
start_serverFunction · 0.45
run_burstFunction · 0.45
_pumpMethod · 0.45
aliveMethod · 0.45

Calls 1

sample_procFunction · 0.85

Tested by 2

handle_signalFunction · 0.36
setUpClassMethod · 0.36