Create a sub-progress for the given amount of work (this amount is added to the total amount to be done).
167509
public WorkProgress createTaskProgress(long amount, String text) {
		this.amount += amount;
		SubWorkProgress task = new SubWorkProgress(this, amount, amount, text);
		synchronized (tasks) {
			tasks.add(task);
			if (jp != null) jp.addToJoinDoNotCancel(task.getSynch());
		}
		return task;
	}
549873
def progress(rest):
	""
	if rest:
		left, right, amount = [piece.strip() for piece in rest.split('|')]
		ticks = min(int(round(float(amount) / 10)), 10)
		bar = "=" * ticks
		return "%s [%-10s] %s" % (left, bar, right)
812295
def increment(self, amount=1, output=True):
    
    self._current += amount
    if output:
      # NOTE: This algorithm averages out the time it has taken to get to the current / total to
      #       determine how much time is left. So this is best used with jobs that have steps whose
      #       run time is roughly the same.

      now = datetime.now()
      elapsed_time = now - self._started_at
      expected_finish = self._started_at + elapsed_time * (1 / (self._current / self._total))
      remaining_time = expected_finish - now

      if self._format_time_remaining:
        remaining_time_str = self._format_time_remaining(remaining_time)
      else:
        remaining_time_str = str(remaining_time)

      tab_count = self._message.count("\t")
      sys.stdout.write("\r" + "\t" * tab_count + " " * (len(self._message) - tab_count))

      if isinstance(self._format, str):
        self._message = self._format.format(self._current, self._total, remaining_time_str)
      else:
        self._message = self._format(self._current, self._total, remaining_time_str)

      sys.stdout.write("\r" + self._message)
      sys.stdout.flush()
1370697
def _create_in_progress(self):
        
        instance = self.service.service.get_instance(self.service.name)
        if (instance['last_operation']['state'] == 'in progress' and
           instance['last_operation']['type'] == 'create'):
               return True

        return False
778755
def progress_updater(size, total):
    """"""
    current_task.update_state(
        state=state('PROGRESS'),
        meta=dict(size=size, total=total)
    )
1106193
protected synchronized void postTaskExecution() {
		if (stopped) {
			// Stopped, so don't count the task(s) as done.
			// (worker threads call this method even if the task was not really executed.)
			return;
		}
		tasksDoneCount++;
		int percentageComplete = tasksDoneCount * 100 / tasksTotalCount;

		// Compute the progress and notify the listeners
		this.notifyListenersSpiderProgress(percentageComplete, tasksDoneCount, tasksTotalCount - tasksDoneCount);

		// Check for ending conditions
		if (tasksDoneCount == tasksTotalCount && initialized) {
			this.complete();
		}
	}
917779
private void updateTaskProgress() {
        m_taskRecord.setProperty(TaskRecord.PROP_EXECUTOR, m_hostID);
        m_taskRecord.setProperty(TaskRecord.PROP_PROGRESS, m_progressMessage);
        m_taskRecord.setProperty(TaskRecord.PROP_PROGRESS_TIME, Long.toString(m_lastProgressTimestamp));
        TaskManagerService.instance().updateTaskStatus(m_tenant, m_taskRecord, false);
    }
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()
576371
def increment(self, amount=1):
        
        self._primaryProgressBar.setValue(self.value() + amount)
        QApplication.instance().processEvents()
687049
public void doneOnSubTasksDone() {
		if (jp != null) return;
		synchronized (tasks) {
			jp = new JoinPoint<>();
			for (SubTask task : tasks) jp.addToJoinDoNotCancel(task.getProgress().getSynch());
		}
		jp.listenInline(new Runnable() {
			@Override
			public void run() {
				if (jp.hasError()) error(jp.getError());
				else done();
			}
		});
		jp.start();
	}
594451
private void updateWork(Task parentTask)
   {
      if (parentTask.hasChildTasks())
      {
         ProjectProperties properties = m_project.getProjectProperties();

         Duration actualWork = null;
         Duration baselineWork = null;
         Duration remainingWork = null;
         Duration work = null;

         for (Task task : parentTask.getChildTasks())
         {
            updateWork(task);

            actualWork = Duration.add(actualWork, task.getActualWork(), properties);
            baselineWork = Duration.add(baselineWork, task.getBaselineWork(), properties);
            remainingWork = Duration.add(remainingWork, task.getRemainingWork(), properties);
            work = Duration.add(work, task.getWork(), properties);
         }

         parentTask.setActualWork(actualWork);
         parentTask.setBaselineWork(baselineWork);
         parentTask.setRemainingWork(remainingWork);
         parentTask.setWork(work);
      }
   }
978889
def _receive_signal(self, progress_subscript):
        

        self.progress = self._estimate_progress()
        self.updateProgress.emit(int(self.progress))
1209534
function writeProgress(id, total, completed) {
    var percent = Math.round(10 * (100 * completed) / total) / 10;
    if(id == lastProgressId) {
        readline.cursorTo(process.stdout, 0);
        readline.clearLine(process.stdout, 0);
    } else {
        lastProgressId = id;
        process.stdout.write('\n');
    }
    var progressTitles = {
        projects: 'Indexing Projects',
        chunks: 'Indexing Chunks',
        ta: 'Indexing translationAcademy',
        resources: 'Indexing Resources',
        container: 'Downloading Containers',
        catalog: 'Indexing Catalogs',
        langnames: 'Indexing Target Languages',
        'temp-langnames': 'Indexing Temporary Target Languages',
        'approved-temp-langnames': 'Indexing Approved Temporary Target Languages',
        'new-language-questions': 'Indexing Questionnaire'
    };
    process.stdout.write((progressTitles[id] || id) + ' [' + total + '] ' + percent + '%');
}
862375
def progress_task(name=None, t=INFO, max_value=100, *args, **kwargs):
    
    return task(name=name, t=t, init_progress=True, max_value=max_value,
                *args, **kwargs)
1363866
def add_subtask(self, task, params={}, **options): 
        
        path = "/tasks/%s/subtasks" % (task)
        return self.client.post(path, params, **options)
955037
def run_progress
      if counts_set? && total_count > 0
        sum = output.values_at(:success_count, :cancelled_count, :failed_count).reduce(:+)
        sum.to_f / total_count
      else
        0.1
      end
    end
1082178
def _subtask_result(self, idx, value):
        """"""
        self._results[idx] = value
        if len(self._results) == self._num_tasks:
            self.set_result([
                self._results[i]
                for i in range(self._num_tasks)
            ])