If we are in a progress scope, and no log messages have been
        shown, write out another '.
174171
def show_progress(self):
        """'"""
        if self.in_progress_hanging:
            sys.stdout.write('.')
            sys.stdout.flush()
1251144
def _on_work_finished(self, results):
        
        messages = []
        for msg in results:
            msg = CheckerMessage(*msg)
            if msg.line >= self.editor.blockCount():
                msg.line = self.editor.blockCount() - 1
            block = self.editor.document().findBlockByNumber(msg.line)
            msg.block = block
            messages.append(msg)
        self.add_messages(messages)
855077
private void checkInProgressWork() {
        inProgressWorkQueue.addAll(db().getAllInprogressTasks());
        StatusTrail st = null;        
        while ((st = inProgressWorkQueue.removeFirst()) != null) {
            if (st.getTaskId() == null) {
                 log.info("Found task with null taskId {}.", st);
                 st.setStatus(JobStatus.not_done).setAttemptsDone(0).setGivenUp(0);
                 db().updateStatusTrail(st);
                 log.info("Marked the status as not done to ensure it is resubmitted {}", st);
                 continue;
            }
            switch(druidDriver.pollIndexerTaskStatus(st.getTaskId())) {
                case SUCCESS:
                    newWorkQueue.remove(st);// Make sure.
                    st.setStatus(JobStatus.done);
                    st.setAttemptsDone(st.getAttemptsDone() + 1);// This will also set givenUp.
                    db().updateStatusTrail(st);
                    log.info("Task {} succeeded.", st);                    
                    break;
                case FAILED:
                    newWorkQueue.remove(st);// Make sure.
                    st.setStatus(JobStatus.not_done);
                    st.setAttemptsDone(st.getAttemptsDone() + 1);// This will also set givenUp.
                    db().updateStatusTrail(st);
                    log.info("Task {} failed.", st);
                    break;
                case RUNNING:
                    log.info("Task {} in progress.", st);
                    break;
                case UNKNOWN:
                    log.info("Task {} status unknown.", st);
                    break;
            }            
        }
    }
605921
def log_progress(
    iterable,
    logger,
    batch_size=10000,
    progress_message="Processing... ({})",
    done_message="Done! (Total: {})",
):
    
    i = 0
    for x in iterable:
        yield x
        i += 1
        if not i % batch_size:
            logger.info(progress_message.format(i))
    logger.info(done_message.format(i))
772793
def progress(self, p):
        '''
        
        '''
        self.task_stack[-1] = self.task_stack[-1]._replace(progress=p)
        self.progress_report()
162024
def wait_until_queue_empty(self, channels, report=True, clear_end=True):
        
        state = {'message': ''}

        self.logger.debug("wait_until_queue_empty: report=%s %s"
                          % (str(report), str([channel+':'+str(len(self.queues[channel])) for channel in channels]), ))
        queues = []
        for channel in channels:
            queues += self.queues[channel][:]

        def print_progress():
            if report:
                self.logger.debug("all_empty=%s" % (str(all_empty),))

                sys.__stderr__.write('\b' * len(state['message']))
                sys.__stderr__.write("\033[K")

                state['message'] = "%.2f kB/s // %.2fkB of %.2fkB // %.2f%%" \
                          % (self.bytes_speed / 1024, self.bytes_sent / 1024, self.bytes_total / 1024,
                            (self.bytes_sent / self.bytes_total * 100) if self.bytes_total else 0)

                sys.__stderr__.write(state['message'])
                sys.__stderr__.flush()

        while True:
            all_empty = all(m['_sent'] for m in queues)

            print_progress()

            if all_empty:
                break

            time.sleep(0.2)

        print_progress()

        if report and clear_end:
            sys.__stderr__.write('\b' * len(state['message']))
            sys.__stderr__.write("\033[K")
            sys.__stderr__.flush()
1347483
private void completeWrite(Write write) {
        Timer t = write.complete();
        if (t != null) {
            this.metrics.bookKeeperWriteCompleted(write.data.getLength(), t.getElapsed());
        }
    }
925563
public void progressFinished() {
        if (!batchMode && log.isInfoEnabled()) {
            imageLines.remove();
            print(ansi().reset().toString());
            if (!useAnsi) {
                println("");
            }
        }
    }
1022997
def log_line(watch, metric, condition, result)
      status =
      if self.trigger?(metric, result)
        "[trigger]"
      else
        "[ok]"
      end

      messages = []

      # Log info if available.
      if condition.info
        Array(condition.info).each do |condition_info|
          messages << "#{watch.name} #{status} #{condition_info} (#{condition.base_name})"
          applog(watch, :info, messages.last)
        end
      else
        messages << "#{watch.name} #{status} (#{condition.base_name})"
        applog(watch, :info, messages.last)
      end

      # Log.
      debug_message = watch.name + ' ' + condition.base_name + " [#{result}] " + self.dest_desc(metric, condition)
      applog(watch, :debug, debug_message)

      messages
    end
1215026
def progress_callback(self, action, node, elapsed_time=None):
        
        if action == 'load_start':
            self.stdout.write('Loading fixture {}.{}...'.format(*node),
                              ending='')
            self.stdout.flush()
        elif action == 'load_success':
            message = 'SUCCESS'
            if elapsed_time:
                message += ' ({:.03} seconds) '.format(elapsed_time)

            self.stdout.write(message)
578515
def update(self, progress=0):
        
        self.progress += (progress or 1)
        if self.visible:
            if self.progress % self._mod == 1 or\
               self.progress == self.size - 1:
                print(self.format_bar(), end="\r")
            if self.progress == (self.size):
                self.finish()
438026
def check_complete(task, out_queue):
    
    logger.debug("Checking if %s is complete", task)
    try:
        is_complete = task.complete()
    except Exception:
        is_complete = TracebackWrapper(traceback.format_exc())
    out_queue.put((task, is_complete))
374952
private String write(String logDir) throws IOException, ExecutionException, InterruptedException {
        final File file = new File(logDir, "trace_" + System.currentTimeMillis() + ".json.gz");
        if (file.exists()) {
            throw new IOException("Trace file " + file.getAbsolutePath() + " already exists");
        }
        if (!file.getParentFile().canWrite() || !file.getParentFile().canExecute()) {
            throw new IOException("Trace file " + file.getAbsolutePath() + " is not writable");
        }

        SettableFuture<Future<?>> f = SettableFuture.create();
        m_work.offer(() -> f.set(dumpEvents(file)));
        final Future<?> writeFuture = f.get();
        if (writeFuture != null) {
            writeFuture.get(); // Wait for the write to finish without blocking new events
            return file.getAbsolutePath();
        } else {
            // A write is already in progress, ignore this request
            return null;
        }
    }
330783
def write(self, args):  # pylint: disable=no-self-use
        
        ShellProgressView.done = False
        message = args.get('message', '')
        percent = args.get('percent', None)
        if percent:
            ShellProgressView.progress_bar = _format_value(message, percent)
            if int(percent) == 1:
                ShellProgressView.progress_bar = None

        ShellProgressView.progress = message
967559
def report_progress(stream=None):
    
    if stream is None:
        stream = sys.stderr
    for reporter in _reporters:
        reporter(stream)
370518
def start_new_log(self):
        ''''''
        filename = self.new_log_filepath()

        self.block_cnt = 0
        self.logfile = open(filename, 'w+b')
        print("DFLogger: logging started (%s)" % (filename))
        self.prev_cnt = 0
        self.download = 0
        self.prev_download = 0
        self.last_idle_status_printed_time = time.time()
        self.last_status_time = time.time()
        self.missing_blocks = {}
        self.acking_blocks = {}
        self.blocks_to_ack_and_nack = []
        self.missing_found = 0
        self.abandoned = 0
353782
def _LogProgressUpdateIfReasonable(self):
    """"""
    next_log_time = (
        self._time_of_last_status_log +
        self.SECONDS_BETWEEN_STATUS_LOG_MESSAGES)
    current_time = time.time()
    if current_time < next_log_time:
      return
    completion_time = time.ctime(current_time + self.EstimateTimeRemaining())
    log_message = (
        '{0:s} hash analysis plugin running. {1:d} hashes in queue, '
        'estimated completion time {2:s}.'.format(
            self.NAME, self.hash_queue.qsize(), completion_time))
    logger.info(log_message)
    self._time_of_last_status_log = current_time