// --------------------------------------------------------------------------- // Customizable parameters: // How frequently in ms to run tests //var RUN_TEST_EVERY = (60 * 5 * 1000); var RUN_TEST_EVERY = 1000; // Maximum test duration in milliseconds (must be less than RUN_TEST_EVERY) var TEST_DURATION = (60 * 1000); // Where should I contact to register and query a list of other nodes? var SERVER_HOST = '127.0.0.1'; var SERVER_PORT = 18080; // Which port should agents use for their HTTP? var AGENT_PORT = 18888; // Payload size in bytes var PAYLOAD_SIZE = 4096; // --------------------------------------------------------------------------- var ipaddr = require('ipaddr.js'); var os = require('os'); var http = require('http'); var async = require('async'); var express = require('express'); var app = express(); // Find our ZeroTier-assigned RFC4193 IPv6 address var thisAgentId = null; var interfaces = os.networkInterfaces(); if (!interfaces) { console.error('FATAL: os.networkInterfaces() failed.'); process.exit(1); } for(var ifname in interfaces) { var ifaddrs = interfaces[ifname]; if (Array.isArray(ifaddrs)) { for(var i=0;i