| 59 | } |
| 60 | |
| 61 | public get(): Omit<IBrowserlessStats, 'cpu' | 'memory'> { |
| 62 | const currentStat = { |
| 63 | error: this.error, |
| 64 | maxConcurrent: this.concurrent, |
| 65 | queued: this.queued, |
| 66 | rejected: this.rejected, |
| 67 | running: this.running, |
| 68 | sessionTimes: this.sessionTimes, |
| 69 | successful: this.successful, |
| 70 | timedout: this.timedout, |
| 71 | unauthorized: this.unauthorized, |
| 72 | unhealthy: this.unhealthy, |
| 73 | }; |
| 74 | |
| 75 | return { |
| 76 | ...currentStat, |
| 77 | ...this.calculateStats(currentStat.sessionTimes), |
| 78 | date: Date.now(), |
| 79 | }; |
| 80 | } |
| 81 | |
| 82 | public reset() { |
| 83 | this.successful = 0; |