• Home
  • Raw
  • Download

Lines Matching refs:self

34     def log_message(self, format, *args):  # pylint: disable=redefined-builtin  argument
40 def do_cache_hit(self): argument
41 self.server.hit_times += 1
42 self.send_response(200)
44 def do_cache_miss(self): argument
45 self.server.miss_times += 1
46 self.send_response(200)
48 def do_cache_manage(self): argument
49 self.send_response(200)
50 self.server.cache_manage()
52 def do_show_statistics(self): argument
53 self.send_response(200)
54 self.server.show_statistics()
56 def do_stop_service(self): argument
57 self.send_response(200)
58 self.server.stop_service = True
62 def __init__(self, *args, **kargs): argument
63 self.hit_times = 0
64 self.miss_times = 0
65 self.stop_service = False
66 self.pycache_dir = None
67 self.pycache_config_file = None
70 def serve_forever(self, poll_interval=0.5): argument
71 while not self.stop_service:
72 self.handle_request()
73 os.unlink(self.pycache_config_file)
75 def record_pycache_config(self, pycache_dir): argument
77 self.pycache_dir = root
78 self.pycache_config_file = os.path.join(root, '.config')
80 host, port = self.server_address[:2]
83 'config_file': self.pycache_config_file,
88 with open(self.pycache_config_file, 'w') as jsonfile:
91 def cache_manage(self): argument
99 for root, _, files in os.walk(self.pycache_dir):
113 def show_statistics(self): argument
114 actions = self.hit_times + self.miss_times
118 print('pycache hit targets: {}'.format(self.hit_times))
119 print('pycache miss targets: {}'.format(self.miss_times))
120 hit_rate = float(self.hit_times) / actions * 100
121 miss_rate = float(self.miss_times) / actions * 100