Property definitions

popcorn $ PopTrackerQueries :: defaultinit
# Group and count entries by query string
class PopTrackerQueries
	super TrackerHandler

	redef fun get(req, res) do
		var pipe = new MongoPipeline
		pipe.group((new MongoGroup("$request.uri")).
			sum("visits", 1).
			avg("response_time", "$response_time").
			addToSet("uniq", "$session"))
		pipe.sort((new MongoMatch).eq("visits", -1))
		pipe.limit(limit(req))
		res.json new JsonArray.from(config.tracker_logs.collection.aggregate(pipe))
	end
end
lib/popcorn/pop_tracker.nit:109,1--123,3