MCPcopy Create free account
hub / github.com/EvoMap/evolver / recordComplete

Method recordComplete

src/proxy/task/monitor.js:77–90  ·  view source on GitHub ↗
(taskId, startedAt)

Source from the content-addressed store, hash-verified

75 }
76
77 recordComplete(taskId, startedAt) {
78 this._stats.tasks_completed++;
79 this._stats.last_complete_at = Date.now();
80 if (startedAt) {
81 const duration = Date.now() - startedAt;
82 this._stats._completion_times.push(duration);
83 if (this._stats._completion_times.length > 100) {
84 this._stats._completion_times.shift();
85 }
86 const sum = this._stats._completion_times.reduce((a, b) => a + b, 0);
87 this._stats.avg_completion_ms = Math.round(sum / this._stats._completion_times.length);
88 }
89 this.store.setState('task_monitor_stats', JSON.stringify(this.getMetrics()));
90 }
91
92 recordFailed(taskId) {
93 this._stats.tasks_failed++;

Callers 2

buildRoutesFunction · 0.80

Calls 2

getMetricsMethod · 0.95
setStateMethod · 0.80

Tested by

no test coverage detected