clusters.js 839 B

1234567891011121314151617181920212223242526272829303132
  1. 'use strict'
  2. module.exports = function (fastify, opts, next) {
  3. fastify.get('/clusters', function (request, reply) {
  4. reply.send([
  5. {
  6. id: 'wrYGf-csNgiGdK7B_ADF7Z',
  7. name: 'fake.cluster',
  8. defaultCluster: true,
  9. status: 'online',
  10. brokerCount: 1,
  11. onlinePartitionCount: 20,
  12. topicCount: 2,
  13. bytesInPerSec: Math.ceil(Math.random() * 10_000),
  14. bytesOutPerSec: Math.ceil(Math.random() * 10_000),
  15. },
  16. {
  17. id: 'dMMQx-WRh77BKYas_g2ZTz',
  18. name: 'kafka-ui.cluster',
  19. default: false,
  20. status: 'offline',
  21. brokerCount: 0,
  22. onlinePartitionCount: 0,
  23. topicCount: 0,
  24. bytesInPerSec: Math.ceil(Math.random() * 10_000),
  25. bytesOutPerSec: Math.ceil(Math.random() * 10_000),
  26. },
  27. ]);
  28. });
  29. next();
  30. }