* Calculates memory difference between two snapshots
(fromIndex, toIndex)
| 48 | * Calculates memory difference between two snapshots |
| 49 | */ |
| 50 | diff (fromIndex, toIndex) { |
| 51 | const from = this.snapshots[fromIndex]; |
| 52 | const to = this.snapshots[toIndex]; |
| 53 | |
| 54 | return { |
| 55 | rss: to.rss - from.rss, |
| 56 | heapTotal: to.heapTotal - from.heapTotal, |
| 57 | heapUsed: to.heapUsed - from.heapUsed, |
| 58 | external: to.external - from.external, |
| 59 | arrayBuffers: to.arrayBuffers - from.arrayBuffers |
| 60 | }; |
| 61 | } |
| 62 | |
| 63 | /** |
| 64 | * Formats bytes to human readable format using IEC standard |
no outgoing calls
no test coverage detected