Compare commits
No commits in common. "6e5361e085de0b3c210789cc1b991c14c27b248d" and "0a9975425cad0a356ebed97d5f9c8af475926267" have entirely different histories.
6e5361e085
...
0a9975425c
@ -16,25 +16,19 @@ accept_untrusted_certs = true
|
||||
|
||||
[settings]
|
||||
max_fails = 3
|
||||
send_group_monitoring_before_each_call = 'true'
|
||||
gps_report_interval = 1000 # The interval in which the GPS is sent
|
||||
send_voice = true
|
||||
send_gps = true
|
||||
send_group_monitoring_before_each_call = false
|
||||
gps_report_interval = 10000 # The interval in which the GPS is sent
|
||||
gps_lat_start_point = 46.217802
|
||||
gps_lng_start_point = 24.776126
|
||||
delay_between_clients = 300
|
||||
testing_duration = 40 # seconds
|
||||
testing_duration = 600 # seconds
|
||||
|
||||
|
||||
[[assets]]
|
||||
asset_id = 63
|
||||
group_id = 1
|
||||
generate_voice = true
|
||||
generate_gps = true
|
||||
|
||||
[[assets]]
|
||||
asset_id = 64
|
||||
group_id = 1
|
||||
generate_voice = false
|
||||
generate_gps = true
|
||||
[assets]
|
||||
ids = [
|
||||
5488
|
||||
]
|
||||
|
||||
[sounds]
|
||||
tracks = ['1.mp3','2.mp3','3.mp3','4.mp3','5.mp3','6.mp3','7.mp3','8.mp3','9.mp3','10.mp3','11.mp3','12.mp3','13.mp3','14.mp3','15.mp3','16.mp3','17.mp3','18.mp3','19.mp3']
|
||||
|
3
index.js
3
index.js
@ -15,9 +15,6 @@ let configs = {
|
||||
elogs: config.get('elogs'),
|
||||
}
|
||||
|
||||
console.log('configs', configs)
|
||||
|
||||
// Start simulation.
|
||||
console.log('Starting simulation...');
|
||||
|
||||
var simulator = new Simulator(configs);
|
||||
|
1207
src/asset.js
1207
src/asset.js
File diff suppressed because it is too large
Load Diff
@ -12,6 +12,7 @@ const OpusEncoder = require('node-opus').OpusEncoder;
|
||||
class Mumble {
|
||||
|
||||
constructor(id, configs, connectedCallback) {
|
||||
console.log('------', configs)
|
||||
this.id = id;
|
||||
this.configs = configs;
|
||||
let mumble = configs.mumble;
|
||||
@ -103,7 +104,7 @@ class Mumble {
|
||||
.on('reconnect', function (n, delay) {
|
||||
// n = current number of reconnect
|
||||
// delay = delay used before reconnect
|
||||
// console.log('------ Server reconnect...');
|
||||
console.log('------ Server reconnect...');
|
||||
// utils.writeErrorLog(`ERROR_MUMBLE_RECONNECT`);
|
||||
// utils.exitWriteErrorLog(`ERROR_MUMBLE_RECONNECT`);
|
||||
})
|
||||
|
@ -12,12 +12,12 @@ class Simulator {
|
||||
this.configs = configs;
|
||||
this.token;
|
||||
|
||||
this.assets = configs.assets;
|
||||
this.assetIds = this.assets.map(asset => asset.asset_id);
|
||||
// Read assets ids from configs
|
||||
this.assetIds = configs.assets.ids;
|
||||
|
||||
this.apiEndpoint = this.configs.api.use_secure ? 'https' : 'http';
|
||||
this.apiEndpoint += '://' + this.configs.api.host + (this.configs.api.port ? (':' + this.configs.api.port) : '');
|
||||
|
||||
|
||||
async.waterfall([
|
||||
this._manageLogs.bind(this),
|
||||
this._unregisterAsstes.bind(this),
|
||||
@ -36,17 +36,16 @@ class Simulator {
|
||||
_start() {
|
||||
const settings = this.configs.settings;
|
||||
|
||||
// this.assetIds.forEach((id, i) => {
|
||||
this.assets.forEach((asset, i) => {
|
||||
this.assetIds.forEach((id, i) => {
|
||||
let delay_between_clients = 500;
|
||||
if(settings.hasOwnProperty('delay_between_clients')) {
|
||||
delay_between_clients = parseInt(settings.delay_between_clients, 10);
|
||||
}
|
||||
console.log('asset_id', asset.asset_id, i * delay_between_clients+'ms')
|
||||
console.log('id', id, i * delay_between_clients+'ms')
|
||||
|
||||
delay_between_clients = this._getRandomInt(delay_between_clients);
|
||||
setTimeout(() => {
|
||||
new Asset(asset, this.configs, this.token);
|
||||
new Asset(id, this.configs, this.token);
|
||||
// console.log('id, this.configs, this.token', id, this.configs, this.token)
|
||||
}, i * delay_between_clients);
|
||||
})
|
||||
@ -75,7 +74,6 @@ class Simulator {
|
||||
}
|
||||
|
||||
_unregisterAsstes(callback) {
|
||||
|
||||
let url = this.apiEndpoint + '/audio/un-register/[' + this.assetIds + ']/';
|
||||
Request.post(
|
||||
url,
|
||||
|
Loading…
x
Reference in New Issue
Block a user