src/comm/rate-control/adaptiveRate.js
/**
     * Initialise the rate controller with a passed msg object
     * - Only require the desired TPS from the standard msg options
     * @param {JSON} msg the initialisation message
     */
Initialise the rate controller with a passed msg object
- Only require the desired TPS from the standard msg options
@param {JSON} msg the initialisation message
Initialise the rate controller with a passed msg object - Only require the desired TPS from the standard msg options @param { JSON } msg the initialisation message
init(msg) {
        const tps = this.options.initial_tps;
        const tpsPerClient = msg.totalClients ? (tps / msg.totalClients) : tps;
        this.cur_tps = tpsPerClient;
        this.min_backlog_txn = msg.totalClients ? 
                                this.options.min_backlog_txn / msg.totalClients:
                                this.options.min_backlog_txn;
        this.max_backlog_txn = msg.totalClients ? 
                                this.options.max_backlog_txn / msg.totalClients:
                                this.options.max_backlog_txn;
        this.adaptive_rate = this.options.adaptive_rate ? 
                             this.options.adaptive_rate: 0.9;
        this.max_tps = this.options.max_tps ? this.options.max_tps / msg.totalClients : 0;
        this.total_sleep_time = 0;
        this.last_idx = 0;
    }
init ( msg ) { const tps = this . options . initial_tps ; const tpsPerClient = msg . totalClients ? ( tps / msg . totalClients ) : tps ; this . cur_tps = tpsPerClient ; this . min_backlog_txn = msg . totalClients ? this . options . min_backlog_txn / msg . totalClients : this . options . min_backlog_txn ; this . max_backlog_txn = msg . totalClients ? this . options . max_backlog_txn / msg . totalClients : this . options . max_backlog_txn ; this . adaptive_rate = this . options . adaptive_rate ? this . options . adaptive_rate : 0.9 ; this . max_tps = this . options . max_tps ? this . options . max_tps / msg . totalClients : 0 ; this . total_sleep_time = 0 ; this . last_idx = 0 ; }
Initialise the rate controller with a passed msg object
 - Only require the desired TPS from the standard msg options
 @param {JSON} msg the initialisation message
Initialise the rate controller with a passed msg object - Only require the desired TPS from the standard msg options @param { JSON } msg the initialisation message