stats.js 600 B

1234567891011121314151617181920212223242526272829303132
  1. 'use strict'
  2. const {
  3. kConnected,
  4. kPending,
  5. kRunning,
  6. kSize,
  7. kFree,
  8. kQueued
  9. } = require('../core/symbols')
  10. class ClientStats {
  11. constructor (client) {
  12. this.connected = client[kConnected]
  13. this.pending = client[kPending]
  14. this.running = client[kRunning]
  15. this.size = client[kSize]
  16. }
  17. }
  18. class PoolStats {
  19. constructor (pool) {
  20. this.connected = pool[kConnected]
  21. this.free = pool[kFree]
  22. this.pending = pool[kPending]
  23. this.queued = pool[kQueued]
  24. this.running = pool[kRunning]
  25. this.size = pool[kSize]
  26. }
  27. }
  28. module.exports = { ClientStats, PoolStats }