Skip to content

Commit

Permalink
Fixed configs
Browse files Browse the repository at this point in the history
  • Loading branch information
Mircea Danila Dumitrescu committed Jun 25, 2014
1 parent 4bdebba commit 15c3791
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 30 deletions.
4 changes: 2 additions & 2 deletions bin/databases-config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module.exports = {
events: {
"mongo-host": "192.168.56.101",
"mongo-host": "localhost",
"mongo-port": 27017,
"mongo-database": "events",
"mongo-username": null,
"mongo-password": null,
"collectionSize": 1024 * 1024 * 1024
},
aggregations: {
"mongo-host": "192.168.56.101",
"mongo-host": "localhost",
"mongo-port": 27017,
"mongo-database": "aggregations",
"mongo-username": null,
Expand Down
2 changes: 1 addition & 1 deletion bin/generator-config.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions bin/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ var options = require("./generator-config.js"),
}
},

sendForPacketsForInterval: function (arrayOfPacketsInInterval) {
sendForPacketsForInterval: function (arrayOfPacketsInInterval, callback) {
var i,
doSetTimeout = function (i) {
setTimeout(function () {
Expand All @@ -74,12 +74,15 @@ var options = require("./generator-config.js"),
for (i = 0; i < arrayOfPacketsInInterval.length; i++) {
doSetTimeout(i);
}
setTimeout(callback, arrayOfPacketsInInterval.length * options.sampleRateInMS);
}
};

ws.on('open', function () {
console.log("connected!");
var arrayOfPacketsInInterval = packetGenerator.computePacketsPerSampleInInterval(options.packetsInInterval, samples);
packetGenerator.sendForPacketsForInterval(arrayOfPacketsInInterval);
packetGenerator.sendForPacketsForInterval(arrayOfPacketsInInterval, function () {
ws.close();
});
});

34 changes: 17 additions & 17 deletions public/js/analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,27 +97,27 @@ function Chart(config) {
.append('<svg/>'); // svg for chart
}

$("#" + this.chartAnchor + ' .control')
.append(myUtils.createElem('p'))
.append(myUtils.createElem('button', {className: 'pause'}, 'Pause')) // pause button
.append(myUtils.createElem('button', {className: 'resume'}, 'Resume')) // resume
;

$("#" + this.chartAnchor + ' button.pause')
.click(function () {
that.pause();
})
;
$("#" + this.chartAnchor + ' button.resume')
.click(function () {
that.resume();
});
if (callback) {
callback();
}
};
this.refreshAll = function () {
// - no need for now - this.dataHandler();
var control,
i,
selectElem,
optionElem;
control = $("#" + this.chartAnchor + ' .control');
control.append(myUtils.createElem('p'));

if (this.dimensions && Array.isArray(this.dimensions)) {
for (i = 0; i < this.dimensions.length; i++) {
selectElem = myUtils.createElem('select', {className: 'select', id: this.chartAnchor + "-" + this.dimensions[i].name});

selectElem.add(myUtils.createElem('option', {"value": 1}));
control.append(selectElem);
}
}

that.refreshChart();
};
this.setChartAnchor = function (chartAnchor) {
Expand Down Expand Up @@ -280,7 +280,7 @@ var chartsConfig = [
},
refreshFrequency: 10 * 1e3
}
// {
// {
// name: "T1 Events",
// chartType: "EventsChart", //can be "EventsChart" or "AggregatedChart" - meaning one or multiple dimensions
// renderingType: "xxx", //choose a style
Expand Down
15 changes: 7 additions & 8 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,19 @@ LOGSDIR=${SCRIPTDIR}/logs;

node=`which node`;
if [[ -z ${node} ]]; then
node="/usr/local/bin/nodess1"; #fallback
node="/usr/local/bin/node"; #fallback
fi

if [ ! -f "${node}" ]; then
echo "Cannot find node!"
fi


${node} ${BINDIR}/collector.js >> ${LOGSDIR}/collector.log &
${node} ${BINDIR}/aggregator.js >> ${LOGSDIR}/aggregator.log &
${node} ${BINDIR}/disperser.js >> ${LOGSDIR}/disperser.log &
${node} ${BINDIR}/webServer.js >> ${LOGSDIR}/webServer.log &
${node} ${BINDIR}/generator.js >> ${LOGSDIR}/generator.log &
${node} ${BINDIR}/collector.js 2>&1 >> ${LOGSDIR}/collector.log &
${node} ${BINDIR}/aggregator.js 2>&1 >> ${LOGSDIR}/aggregator.log &
${node} ${BINDIR}/disperser.js 2>&1 >> ${LOGSDIR}/disperser.log &
${node} ${BINDIR}/webServer.js 2>&1 >> ${LOGSDIR}/webServer.log &
sleep 10;
${node} ${BINDIR}/generator.js 2>&1 >> ${LOGSDIR}/generator.log &


tail -f ${LOGSDIR}/*

0 comments on commit 15c3791

Please sign in to comment.