def thread_4(): c.log_bmark("Server thread spawned") c.log_start("Logging in", bookmark=True) sleep(0.1) c.log_start("Search database") sleep(0.3) c.log_endok("Search database") c.log_start("Initialise session for 'laura'") sleep(0.3) c.log_endok("Initialise session for 'laura'") c.log_start("Render") sleep(0.1) c.log_endok("Render") c.log_endok("Logging in") sleep(0.2) c.log_start("Repeat login", bookmark=True) sleep(0.2) c.log_ender("Repeat login") sleep(0.2) c.log_start("Read article", bookmark=True) sleep(0.05) c.log_start("Search database") sleep(0.3) c.log_endok("Search database") c.log_start("Render") sleep(0.1) c.log_endok("Render") sleep(0.05) c.log_endok("Read article")
def thread_3(): c.log_bmark("Server thread spawned") sleep(0.2) c.log_start("Read article", bookmark=True) sleep(0.05) c.log_start("Search database") sleep(0.3) c.log_endok("Search database") c.log_start("Render") sleep(0.1) c.log_endok("Render") sleep(0.05) c.log_endok("Read article") sleep(0.4) c.log_start("Post comment", bookmark=True) sleep(0.05) c.log_start("Create") sleep(0.3) c.log_endok("Create") c.log_start("Render") sleep(0.1) c.log_endok("Render") sleep(0.05) c.log_endok("Post comment")
def thread_2(): c.log_bmark("Server thread spawned") sleep(0.7) c.log_start("User profile", bookmark=True) sleep(0.1) c.log_start("Search database") sleep(0.3) c.log_endok("Search database") c.log_start("Render") sleep(0.1) c.log_endok("Render") c.log_endok("Logging in")
def __call__(self, environ, start_response): name = environ.get("PATH_INFO", "") + "?" + environ.get("QUERY_STRING", "") active = not name.startswith("/static/") if active: ctx.set_log(self.log_url) ctx.set_profile(True) ctx.log_bmark(name) response = self.app(environ, start_response) if active: ctx.set_profile(False) return response
def __call__(self, environ, start_response): name = environ.get("PATH_INFO", "") + "?" + environ.get( "QUERY_STRING", "") active = not name.startswith("/static/") if active: ctx.set_log(self.log_url) ctx.set_profile(True) ctx.log_bmark(name) response = self.app(environ, start_response) if active: ctx.set_profile(False) return response
def thread(): c.log_bmark("Server thread spawned") for n in range(0, 4): time.sleep(random.random() * 0.5) c.log_start("Processing Video", bookmark=True) c.log_start("Reading file") time.sleep(1 + random.random() * 2.0) c.log_endok("") with lock: c.log_start("Adding to archive") time.sleep(1 + random.random() * 2.0) c.log_endok("") c.log_endok("")
def test_log_bmark(self): c.log_bmark("boooookmark")