Lines Matching refs:self
128 def _intern_stack(self, frame_id: int, prefix_id: Optional[int]) -> int:
132 stack_id = self.stackMap.get(key)
135 stack_id = len(self.stackTable)
136 self.stackTable.append(Stack(prefix_id=prefix_id, frame_id=frame_id))
137 self.stackMap[key] = stack_id
140 def _intern_string(self, string: str) -> int:
142 string_id = self.stringMap.get(string)
145 string_id = len(self.stringTable)
146 self.stringTable.append(string)
147 self.stringMap[string] = string_id
150 def _intern_frame(self, frame_str: str) -> int:
152 frame_id = self.frameMap.get(frame_str)
155 frame_id = len(self.frameTable)
156 self.frameMap[frame_str] = frame_id
157 string_id = self._intern_string(frame_str)
164 self.frameTable.append(Frame(
177 def _add_sample(self, comm: str, stack: List[str], time_ms: Milliseconds) -> None:
186 if self.comm != comm:
187 self.comm = comm
189 prefix_stack_id = reduce(lambda prefix_id, frame: self._intern_stack
190 (self._intern_frame(frame), prefix_id), stack, None)
192 self.samples.append(Sample(stack_id=prefix_stack_id,
196 def _to_json_dict(self) -> Dict:
204 "tid": self.tid,
205 "pid": self.pid,
206 "name": self.comm,
227 "data": self.samples
243 "data": self.frameTable,
252 "data": self.stackTable,
254 "stringTable": self.stringTable,
351 def end_headers (self):
352 self.send_header('Access-Control-Allow-Origin', 'https://profiler.firefox.com')
353 SimpleHTTPRequestHandler.end_headers(self)