lib/zabbix.js
function itemsForCounter(flushInterval, host, key, value) {
  const avg = value / (flushInterval / 1000); // calculate "per second" rate

  return [
    {
      host,
      key: `${key}[total]`,
      value,
    },
    {
      host,
      key: `${key}[avg]`,
      value: avg,
    },
  ];
}
function itemsForCounter(flushInterval, host, key, value) {
  const avg = value / (flushInterval / 1000); // calculate "per second" rate

  return [
    {
      host,
      key: `${key}[total]`,
      value,
    },
    {
      host,
      key: `${key}[avg]`,
      value: avg,
    },
  ];
}
function itemsForCounter ( flushInterval , host , key , value ) { const avg = value / ( flushInterval / 1000 ) ; // calculate "per second" rate return [ { host , key : ` ${ key } ` , value , } , { host , key : ` ${ key } ` , value : avg , } , ] ; }
Generate items for a counter.
@param {number} flushInterval How long stats were collected, for calculating average.
@param {string} host Hostname in Zabbix.
@param {string} key Item key in Zabbix.
@param {number} value Total collected during interval.
@returns {array} Array of {host, key, value} objects.
Generate items for a counter .