cont3xt/integration.js
// Calculate rolling average over at most 100 items
Calculate rolling average over at most 100 items
Calculate rolling average over at most 100 items
function updateTime (stats, istats, diff, prefix) {
  const lookup = Math.min(stats[prefix + 'Lookup'], 100);
  stats[prefix + 'RecentAvgMS'] = (stats[prefix + 'RecentAvgMS'] * (lookup - 1) + diff) / lookup;
  const ilookup = Math.min(stats[prefix + 'Lookup'], 100);
  istats[prefix + 'RecentAvgMS'] = (istats[prefix + 'RecentAvgMS'] * (ilookup - 1) + diff) / ilookup;
}
function updateTime ( stats , istats , diff , prefix ) { const lookup = Math . min ( stats [ prefix + 'Lookup' ] , 100 ) ; stats [ prefix + 'RecentAvgMS' ] = ( stats [ prefix + 'RecentAvgMS' ] * ( lookup - 1 ) + diff ) / lookup ; const ilookup = Math . min ( stats [ prefix + 'Lookup' ] , 100 ) ; istats [ prefix + 'RecentAvgMS' ] = ( istats [ prefix + 'RecentAvgMS' ] * ( ilookup - 1 ) + diff ) / ilookup ; }
Calculate rolling average over at most 100 items
Calculate rolling average over at most 100 items