This repository has been archived by the owner on Aug 21, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* moving a page via reorganize creates soft redirects properly, inclu…
…ding for descendants * all tests passing again
- Loading branch information
Tom Boutell
committed
Nov 14, 2014
1 parent
7c41304
commit 8912ddf
Showing
4 changed files
with
92 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* jshint node:true */ | ||
|
||
var argv = require('yargs').argv; | ||
var request = require('request'); | ||
var fs = require('fs'); | ||
var async = require('async'); | ||
var _ = require('lodash'); | ||
|
||
var urls = fs.readFileSync(argv._[0], 'utf8').split(/\n/); | ||
|
||
var tries = argv.tries || 10; | ||
|
||
var speed = {}; | ||
|
||
return async.eachSeries(urls, function(url, callback) { | ||
return async.times(tries, function(callback) { | ||
var start = Date.now(); | ||
return request(url, function(err, response) { | ||
console.log(response.statusCode); | ||
if (err && (response.statusCode >= 400)) { | ||
console.log(url + ': ERROR: ' + response.statusCode); | ||
} | ||
return callback(null, Date.now() - start); | ||
}); | ||
}, function(err, results) { | ||
var total; | ||
for (var i = 0; (i < results.length); i++) { | ||
total += results[i]; | ||
} | ||
speed[url] = total / results.length; | ||
return callback(null); | ||
}); | ||
}, function(err) { | ||
|
||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,7 @@ | |
}, | ||
"devDependencies": { | ||
"apostrophe": "*", | ||
"mocha": "*" | ||
"mocha": "*", | ||
"mongodb": "^1.4.19" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters