Revision c56ec146

b/lib/jqueue.py
107 107
    self.ops = [_QueuedOpCode(op) for op in ops]
108 108
    self.run_op_index = -1
109 109
    self.log_serial = 0
110
    self.received_timestamp = TimeStampNow()
111
    self.start_timestamp = None
112
    self.end_timestamp = None
110 113

  
111 114
    # Condition to wait for changes
112 115
    self.change = threading.Condition(self.queue._lock)
......
117 120
    obj.queue = queue
118 121
    obj.id = state["id"]
119 122
    obj.run_op_index = state["run_op_index"]
123
    obj.received_timestamp = state.get("received_timestamp", None)
124
    obj.start_timestamp = state.get("start_timestamp", None)
125
    obj.end_timestamp = state.get("end_timestamp", None)
120 126

  
121 127
    obj.ops = []
122 128
    obj.log_serial = 0
......
136 142
      "id": self.id,
137 143
      "ops": [op.Serialize() for op in self.ops],
138 144
      "run_op_index": self.run_op_index,
145
      "start_timestamp": self.start_timestamp,
146
      "end_timestamp": self.end_timestamp,
147
      "received_timestamp": self.received_timestamp,
139 148
      }
140 149

  
141 150
  def CalcStatus(self):
......
203 212
              op.status = constants.OP_STATUS_RUNNING
204 213
              op.result = None
205 214
              op.start_timestamp = TimeStampNow()
215
              if idx == 0: # first opcode
216
                job.start_timestamp = op.start_timestamp
206 217
              queue.UpdateJobUnlocked(job)
207 218

  
208 219
              input_opcode = op.input
......
271 282
      try:
272 283
        try:
273 284
          job.run_op_idx = -1
285
          job.end_timestamp = TimeStampNow()
274 286
          queue.UpdateJobUnlocked(job)
275 287
        finally:
276 288
          job_id = job.id
......
698 710
        row.append([op.status for op in job.ops])
699 711
      elif fname == "oplog":
700 712
        row.append([op.log for op in job.ops])
713
      elif fname == "opstart":
714
        row.append([op.start_timestamp for op in job.ops])
715
      elif fname == "opend":
716
        row.append([op.end_timestamp for op in job.ops])
717
      elif fname == "received_ts":
718
        row.append(job.received_timestamp)
719
      elif fname == "start_ts":
720
        row.append(job.start_timestamp)
721
      elif fname == "end_ts":
722
        row.append(job.end_timestamp)
701 723
      elif fname == "summary":
702 724
        row.append([op.input.Summary() for op in job.ops])
703 725
      else:

Also available in: Unified diff