def set_options()

in mutornadomon/external_interfaces/http_endpoints.py [0:0]


    def set_options(self):
        valid_sortby = ['calls', 'cumulative', 'cumtime', 'file', 'filename',
                        'module', 'ncalls', 'pcalls', 'line', 'name', 'nfl',
                        'stdname', 'time', 'tottime']

        sortby = 'time'
        profile_time = 2.0
        wait_time = 0.0

        # Dictates how the profile data is sorted
        if 'sortby' in self.request.arguments:
            sortby = self.request.arguments['sortby'][0]

            if sortby not in valid_sortby:
                sortby = 'time'

        # profiletime(msec) indicates for how long each of the profiling is
        # done
        if 'profiletime' in self.request.arguments:
            profile_time = float(self.request.arguments['profiletime'][0])/1000

        # waittime(msec) indicates how long to wait between profiling
        if 'waittime' in self.request.arguments:
            wait_time = float(self.request.arguments['waittime'][0])/1000
            self.write("Profiling will be done for every " +
                       str(wait_time * 1000) + " msec\n")

        return sortby, profile_time, wait_time