def do_latency(self, line):
        if not line:
            raise ShellException(
                "Could not understand latency request, " +
                "see 'help loglatency'")

        mods = self.parseModifiers(line)
        line = mods['line']

        tline = line[:]
        hist = ""
        start_tm = "head"
        duration = None
        slice_tm = "10"
        bucket_count = 3
        show_count = 3
        sources = []
        no_time_rounding = False
        while tline:
            word = tline.pop(0)
            if word == '-h':
                hist = tline.pop(0)
                hist = strip_string(hist)
            elif word == '-f':
                start_tm = tline.pop(0)
                start_tm = strip_string(start_tm)
            elif word == '-d':
                duration = tline.pop(0)
                duration = strip_string(duration)
            elif word == '-t':
                slice_tm = tline.pop(0)
                slice_tm = strip_string(slice_tm)
            elif word == '-e':
                show_count = tline.pop(0)
                show_count = int(strip_string(show_count))
            elif word == '-b':
                bucket_count = tline.pop(0)
                bucket_count = int(strip_string(bucket_count))
            elif word == '-n':
                try:
                    sources = [
                        int(i) for i in strip_string(
                            tline.pop(0)).split(",")]
                except:
                    sources = []
            elif word == '-o':
                no_time_rounding = True
            else:
                raise ShellException(
                    "Do not understand '%s' in '%s'" % (word, " ".join(line)))

        if hist:
            files = self.logger.get_files_by_index(
                self.grep_cluster,
                sources)

            for timestamp in sorted(files.keys()):
                latency_res = self.logger.loglatency(
                    files[timestamp],
                    hist,
                    slice_tm,
                    start_tm,
                    duration,
                    bucket_count,
                    show_count,
                    no_time_rounding)
                self.view.showLogLatency(timestamp, latency_res)
dataset/ETHPy150Open aerospike/aerospike-admin/lib/logcontroller.py/GrepFile.do_latency/original