Skip to content

Instantly share code, notes, and snippets.

View FrancescaK's full-sized avatar

Francesca Krihely FrancescaK

View GitHub Profile
db.action.find({ location: { $geoWithin: { $polygon:
[ [ -5.577327758073807, 53.92722913826002 ],
[ -5.628384947776794, 53.94341400538505 ],
..
[ -7.603911347687244, 53.48786460176994 ] ] }
}
}).limit(1000).sort( "time": 1});
{
actionType : "PLAY",
..
location : { lon : Double , lat : Double },
time : ISODate(..)
}
@FrancescaK
FrancescaK / buffer_6
Created June 4, 2014 15:36
buffer_6_agg_2
{
"result" : [
{
"_id" : {
"endpoint" : "profiles/updates_pending"
},
"avgResponseTime" : 118.69420306241872,
"count" : 749800
},
{
@FrancescaK
FrancescaK / buffer_5
Created June 4, 2014 15:34
buffer_5_agg_1
db.event.api.aggregate({
$match: {
date: {
$gt: ISODate("2014-05-08T20:02:33.133Z"),
$lt: ISODate("2014-05-09T20:02:33.133Z"),
}
}
}, {
$group: {
_id: {
> db.event.web.group_sharing.create_group.find().pretty()
{
"_id" : ObjectId("536c07e148022c1069b4ff3d"),
"via" : "web",
"user_id" : ObjectId("536bfbea61bb78af76e2a94d"),
"user_joined_at" : ISODate("2014-05-08T21:49:30Z"),
"date" : ISODate("2014-05-08T22:40:33.880Z"),
"group" : {
"profile_ids" : [
"536c074d613b7d9924e1a90f",
db.event.api.findOne()
{
"_id" : ObjectId("536c1a7648222c105f807212"),
"endpoint" : {
"name" : "updates/create"
},
"user_id" : ObjectId("50367b2c6ffb36784c000048"),
"params" : {
"get" : {
"text" : "Sending a test update for the the blog post!",
> db.event.visits.findOne({date:{$gt:ISODate("2014-05-05")}})
{
"_id" : ObjectId("5366d48148222c37e51a9f31"),
"domain" : "blog.rafflecopter.com",
"user_id" : null,
"ip" : "50.27.200.15",
"user_joined_at" : null,
"visitor_id" : ObjectId("5366d48151823c7914450517"),
"uri" : "",
"agent" : {
$visit_event = array(
'visitor_id' => $visitor_id,
'ip' => $ip_address,
'uri' => $uri,
'referrer' => $referrer,
'user_agent' => $user_agent
);
//track, < metric name >, < metric data > , < operation type >
$visitor->track('visits', $visit_event, 'event')
mlogfilter mongod.log mongod-sec.log mongod-arb.log --from Apr 5 20:15 --to +5min
grep "majority" mongod.log | mplotqueries --overlay
mplotqueries mongod.log --type rsstate