コード例 #1
0
    def do_POST(self):
        if self.path == "/record":
            FlameProfiler.clearProfileData()
            FlameProfiler.startRecordingProfileData()
            self.send_response(200)
            self.send_header("Content-type", "text/json")
            self.send_header("Content-Length", 0)
            self.end_headers()

        elif self.path == "/stop":
            FlameProfiler.stopRecordingProfileData()
            self.send_response(200)
            self.send_header("Content-type", "text/json")
            self.send_header("Content-Length", 0)
            self.end_headers()
コード例 #2
0
 def run(self):
     FlameProfiler.clearProfileData()
     server_address = ('', PORT)
     self._httpd = HTTPServer(server_address, BFGHandler)
     webbrowser.open("http://localhost:" + str(PORT))
     self._httpd.serve_forever()