iotaledger / sandbox

14 stars 11 forks source link

Feature: add ETA to job status #4

Open todofixthis opened 7 years ago

todofixthis commented 7 years ago

Currently, sandbox clients poll for job status every n seconds (where n is usually a hard-coded value).

It would be really cool if the sandbox node was able to estimate how long a job should take based on the command complexity and system load, and include this information in the response payload.

E.g.,

{
  // Job estimated to complete in 16 seconds.
  "eta":        16,

  "id":         "70fef55d-6933-49fb-ae17-ec5d02bc9117",
  "status":     "RUNNING",
  "createdAt":  1483574581,
  "startedAt":  1483574589,
  "finishedAt": None,
  "command":    "attachToTangle",

  "attachToTangleRequest": {
    "command": "attachToTangle",
    // ...
  }
}

This would help reduce a bit of load on the sandbox node, and it would allow clients to display a progress bar / estimated completion time to users.