brokerMetrics.js 721 B

12345678910111213141516171819202122232425
  1. const randomBrokerMetrics = () => ({
  2. bytesInPerSec: Math.ceil(Math.random() * 10000),
  3. brokerCount: 1,
  4. zooKeeperStatus: 1,
  5. activeControllers: 1,
  6. uncleanLeaderElectionCount: 0,
  7. networkPoolUsage: Math.random() * 0.01,
  8. requestPoolUsage: Math.random() * 0.01,
  9. onlinePartitionCount: Math.ceil(Math.random() * 100),
  10. underReplicatedPartitionCount: Math.ceil(Math.random() * 10),
  11. offlinePartitionCount: Math.ceil(Math.random() * 10),
  12. diskUsage: [
  13. {
  14. brokerId: 1,
  15. segmentSize: Math.ceil(Math.random() * 1_000_000_000),
  16. },
  17. ],
  18. diskUsageDistribution: 'even',
  19. });
  20. module.exports = {
  21. 'wrYGf-csNgiGdK7B_ADF7Z': randomBrokerMetrics(),
  22. 'dMMQx-WRh77BKYas_g2ZTz': randomBrokerMetrics(),
  23. };