Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// How many rows per update?
var UPDATE_SIZE = 50;
// Update every N milliseconds
var TICK_RATE = 20;
// Size limit of the server-side table
var TABLE_SIZE = 10000;
var SECURITIES = ["AAPL.N", "AMZN.N", "QQQ.N", "NVDA.N", "TSLA.N", "FB.N", "MSFT.N", "TLT.N", "XIV.N", "YY.N", "CSCO.N", "GOOGL.N", "PCLN.N"];
var CLIENTS = ["Homer", "Marge", "Bart", "Lisa", "Maggie", "Moe", "Lenny", "Carl", "Krusty"];
var __CACHE__ = [];
perspective.initialize_profile_thread();
/*******************************************************************************
*
* Slow mode (new rows generated on the fly)
*/
function choose(choices) {
return choices[Math.floor(Math.random() * choices.length)];
}
function newRows(total_rows = UPDATE_SIZE) {
var rows = [];
for (var x = 0; x < total_rows; x++) {
rows.push({
name: choose(SECURITIES),
client: choose(CLIENTS),