Application Framework Reference

Splunk API

getDoneProgress()

Job progress is calculated as:

doneProgress = (latestTime - cursorTime) / (latestTime - earliestTime)

The getDoneProgress() method gets a value representing the percentage of job completion, for the current job.

Synopsis

progress = getDoneProgress()

Return Value

Float

Job progress from 0.0 to 1.0, representing zero percent to 100 percent complete.

Example

var context = this.getContext();
var search = context.get('search');
var cursorTime = search.job.getCursorTime();
var jobProgress = Math.round(search.job.getDoneProgress() * 100);
console.log (sprintf(_('Job is %s%% complete'), jobProgress)); 

See Also

isDone()
getCursorTime()