UNPKG

judoscale-node-core

Version:

Core dependencies for NodeJS adapters for the JudoScale autoscaling add-on for Heroku

28 lines (21 loc) 598 B
const Config = require('./config') const Reporter = require('./reporter') class Judoscale { static adapters = [] constructor(options) { this.config = new Config(options) // Expose config to the collectors for (const adapter of Judoscale.adapters) { adapter.collector.config = { ...this.config, ...adapter.collector.config } } new Reporter().start(this.config, Judoscale.adapters) } static registerAdapter(identifier, collector, meta = {}) { Judoscale.adapters.push({ identifier, collector, meta, }) } } module.exports = Judoscale