mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
adde fixture data
This commit is contained in:
parent
baf5a52b7d
commit
d001931e38
4
fixtures/README.md
Normal file
4
fixtures/README.md
Normal file
@ -0,0 +1,4 @@
|
||||
```
|
||||
curl http://randomuser.coolaj86.com/api?seed=rohkevus&results=50000 \
|
||||
-o users.json
|
||||
```
|
20
fixtures/network.js
Normal file
20
fixtures/network.js
Normal file
@ -0,0 +1,20 @@
|
||||
'use strict';
|
||||
|
||||
var users = require('./users.json').results
|
||||
, Chance = require('chance')
|
||||
, chance = new Chance(1234)
|
||||
, b
|
||||
, d = Date.now()
|
||||
, num = 10000
|
||||
;
|
||||
|
||||
users = chance.shuffle(users).slice(0, num);
|
||||
b = chance.shuffle(users.slice(0));
|
||||
b.forEach(function (user, i) {
|
||||
if (0 === (i % 100)) {
|
||||
console.log((Date.now() - d) / 1000, i);
|
||||
d = Date.now();
|
||||
}
|
||||
user.friends = chance.shuffle(users).slice(chance.integer({ min: 20, max: 120 }));
|
||||
});
|
||||
console.log((Date.now() - d) / 1000, num);
|
1550004
fixtures/users.json
Normal file
1550004
fixtures/users.json
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user