Skip to content

Instantly share code, notes, and snippets.

@averas
Created September 14, 2016 10:26
Show Gist options
  • Save averas/01c00259465a6f66d1212dd3d4617c57 to your computer and use it in GitHub Desktop.
Save averas/01c00259465a6f66d1212dd3d4617c57 to your computer and use it in GitHub Desktop.
var stream = require('getstream');
client = stream.connect('key', 'secret', 'id', { location: 'eu-central' });
var feed = client.feed('user', 'foobar');
var counter = 20;
var results = [];
function fetchFeed() {
var start = new Date().getTime();
feed.get({limit:20}).then(function(data) {
results.push(new Date().getTime() - start);
process.stdout.write(".");
if (counter-- > 0)
fetchFeed();
else
console.log((results.reduce(function(a, b) { return a + b; }) / results.length) + "ms");
});
}
fetchFeed();
@averas
Copy link
Author

averas commented Sep 15, 2016

Cool! Great job identifying the issue so fast!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment