start with metrics mongo script - still need to add "active users"

This commit is contained in:
Tyler Renelle
2013-06-14 16:17:41 -04:00
parent 20196a9383
commit 8c27f96d08

27
migrations/metrics.js Normal file
View File

@@ -0,0 +1,27 @@
var
corrupt = {
$or: [
{lastCron: {$exists:false}},
{lastCron: 'new'}
]
}
un_registered = {
"auth.local": {$exists: false},
"auth.facebook": {$exists: false}
},
registered = {
$or: [
{ 'auth.local': { $exists: true }},
{ 'auth.facebook': { $exists: true }}
]
};
print('corrupt: ' + db.users.count(corrupt));
print('unregistered: ' + db.users.count(un_registered));
print('registered: ' + db.users.count(registered));
// TODO active users
// - history > 14 entries
// - lastCron < 14d