Decimal Percentage Progress #146

Closed
nisaacson opened this Issue Nov 5, 2012 · 2 comments

Comments

Projects
None yet
3 participants

It would be nice to have a way to get back finer grained progress. Right now only integer percentages are supported. For long running jobs this means that there are long periods without updates even though things are happening. Adding an optional third parameter to specific the desired progress precision could fix this issue and would not break the existing api

in lib/queue/job.js on line 333

Job.prototype.progress = function(complete, total){
  if (0 == arguments.length) return this._progress;
  var n = Math.min(100, complete / total * 100 | 0);
  this.set('progress', n);
  events.emit(this.id, 'progress', n);
  return this;
};

Xavatar commented Dec 28, 2014

Hi all,

I agree, I really need a fined grained progress. This would be a useful improvement, otherwise for long running jobs (let's say 20K total frames, one frame done per second), it takes 200 frames (3.3 minutes) to get the 1st percent done.

I am using Kue but as I am not a node developer, I have no idea how to implement this feature. Anyone could help?

Cheers !

Collaborator

behrad commented Dec 29, 2014

the main point about this issue is that it is an API breaking change, however easy to implement.

@behrad behrad added the Feature label Mar 21, 2015

@behrad behrad modified the milestone: 0.9.0 Mar 21, 2015

@behrad behrad self-assigned this Mar 21, 2015

@nisaacson nisaacson closed this Mar 4, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment