package com.conveyal.r5.analyst.broker;

/**
 * Describes the status of Job.
 */
public class JobStatus {
    /** number of complete tasks */
    public int complete;

    /** number of tasks remaining */
    public int remaining;

    /** number of tasks in flight (i.e. on workers now) */
    public int inFlight;

    /** number of workers on this job */
    public int nWorkers;

    /** ID of this job */
    public String jobId;

    public JobStatus (Job job) {
        this.complete = job.getCompletedTaskCount();
        this.inFlight = job.invisibleUntil.size();
        this.remaining = job.tasksAwaitingDelivery.size();
        this.jobId = job.jobId;
    }

    /** default constructor for JSON deserialization */
    public JobStatus () { /* nothing */ }
}

@@ -377,16 +377,68 @@
 rkers;%0A%0A
+    /** The graph ID */%0A    public String graphId;%0A%0A
     /** 
@@ -709,16 +709,52 @@
 .jobId;%0A
+        this.graphId = job.graphId;%0A
     %7D%0A%0A 

add graph ID to job status, for debugging.