Skip to content

Commit

Permalink
Update IPv6baseUrl to run the latency test
Browse files Browse the repository at this point in the history
  • Loading branch information
preddy017c committed Oct 27, 2016
1 parent 98b0a93 commit b6d49f3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
3 changes: 2 additions & 1 deletion config/aws/awsSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ var AWS = {};
AWS = require('aws-sdk');
AWS.config.credentials = new AWS.SharedIniFileCredentials({profile: 'default'});

//change the endpoint and the profile to point to your account
//this is the default profile we have locally to access dynamodb
//to set up one and install dynamodb locally look at the README.md
AWS.config.update({
region: 'us-east-1',
endpoint: 'http://localhost:8000'
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ app.get('/testServer', function (req, res) {
data.Items.map(function (val) {
testServer.push({
IPv4Address: val.IPv4Address.S +':8080',
IPv6Address: val.IPv6Address.S +':8080',
IPv6Address: '[' + val.IPv6Address.S + ']:' + '8080',
Location: val.Location.S,
Sitename: val.Sitename.S,
Fqdn: val.Hostname.S
Expand Down
4 changes: 2 additions & 2 deletions public/lib/latencyBasedRouting.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
for (var i = 0; i < data.length; i++) {
serverInfo = data[i];
var serverData = {
'IPv4': serverInfo.IPv4Address,
'IPv6': serverInfo.IPv6Address,
'IPv4Address': serverInfo.IPv4Address,
'IPv6Address': serverInfo.IPv6Address,
'Fqdn': serverInfo.Fqdn,
'latencyResult': []
};
Expand Down
11 changes: 5 additions & 6 deletions public/speed-testJS.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,20 +131,19 @@
xhr.send(null);
}

function callbackComplete(result) {
function latencyBasedRoutingOnComplete(result) {
//TODO update the base urls for websockets if you want to perform the latency test via websockets
testPlan.baseUrlIPv4 = result.IPv4;
testPlan.baseUrlIPv6 = result.IPv6;
console.log(result);
testPlan.baseUrlIPv4 = result.IPv4Address;
testPlan.baseUrlIPv6 = result.IPv6Address;
}

function callbackError(result) {
function latencyBasedRoutingOnError(result) {
console.log(result);
}

function latencyBasedRouting() {
// pass in the client location instead of the hard coded value
var latencyBasedRouting = new window.latencyBasedRouting('NJ', callbackComplete, callbackError);
var latencyBasedRouting = new window.latencyBasedRouting('NJ', latencyBasedRoutingOnComplete, latencyBasedRoutingOnError);
latencyBasedRouting.getNearestServer();
}

Expand Down

0 comments on commit b6d49f3

Please sign in to comment.