mirror of
				https://github.com/ohwgiles/laminar.git
				synced 2025-06-13 12:54:29 +00:00 
			
		
		
		
	calculate all duration in the client
This cleans up some inconsistency where sometimes 'completed-started' happened on the client side and sometimes on the server. Also should fix the 'cumulative time' issue mentioned in #8
This commit is contained in:
		
							parent
							
								
									7a7c5bc5aa
								
							
						
					
					
						commit
						116dfaa3d0
					
				| @ -177,7 +177,6 @@ void Laminar::sendStatus(LaminarClient* client) { | ||||
|             j.set("queued", started-queued); | ||||
|             j.set("started", started); | ||||
|             j.set("completed", completed); | ||||
|             j.set("duration", completed-started); | ||||
|             j.set("result", to_string(RunState(result))); | ||||
|             j.set("reason", reason); | ||||
|         }); | ||||
| @ -203,7 +202,7 @@ void Laminar::sendStatus(LaminarClient* client) { | ||||
|         .fetch<int,time_t,time_t,int,str>([&](int build,time_t started,time_t completed,int result,str reason){ | ||||
|             j.StartObject(); | ||||
|             j.set("number", build) | ||||
|              .set("duration", completed - started) | ||||
|              .set("completed", completed) | ||||
|              .set("started", started) | ||||
|              .set("result", to_string(RunState(result))) | ||||
|              .set("reason", reason) | ||||
| @ -268,8 +267,8 @@ void Laminar::sendStatus(LaminarClient* client) { | ||||
|             j.set("name", name) | ||||
|              .set("number", build) | ||||
|              .set("node", node) | ||||
|              .set("duration", completed - started) | ||||
|              .set("started", started) | ||||
|              .set("completed", completed) | ||||
|              .set("result", to_string(RunState(result))) | ||||
|              .EndObject(); | ||||
|         }); | ||||
| @ -706,7 +705,6 @@ void Laminar::runFinished(Run * r) { | ||||
|             .set("number", r->build) | ||||
|             .set("queued", r->startedAt - r->queuedAt) | ||||
|             .set("completed", completedAt) | ||||
|             .set("duration", completedAt - r->startedAt) | ||||
|             .set("started", r->startedAt) | ||||
|             .set("result", to_string(r->result)) | ||||
|             .set("reason", r->reason()); | ||||
|  | ||||
| @ -54,7 +54,7 @@ | ||||
|       </td> | ||||
|      </tr> | ||||
|      <tr v-for="job in jobsRecent"> | ||||
|       <td><span v-html="runIcon(job.result)"></span> <router-link :to="'/jobs/'+job.name">{{job.name}}</router-link> <router-link :to="'/jobs/'+job.name+'/'+job.number">#{{job.number}}</router-link><br><small>Took {{job.duration}}s at {{formatDate(job.started)}}</small></td> | ||||
|       <td><span v-html="runIcon(job.result)"></span> <router-link :to="'/jobs/'+job.name">{{job.name}}</router-link> <router-link :to="'/jobs/'+job.name+'/'+job.number">#{{job.number}}</router-link><br><small>Took {{formatDuration(job.started, job.completed)}} at {{formatDate(job.started)}}</small></td> | ||||
|      </tr> | ||||
|     </table> | ||||
|    </div> | ||||
|  | ||||
| @ -330,7 +330,7 @@ var Job = function() { | ||||
|             fillColor: "darkseagreen", | ||||
|             strokeColor: "forestgreen", | ||||
|             data: msg.recent.map(function(e) { | ||||
|               return e.duration; | ||||
|               return e.completed - e.started; | ||||
|             }).reverse() | ||||
|           }] | ||||
|         }, { | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user