This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"video", [{count: 1}, {count: 1}, {count: 1}, {count: 1}]} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function() { | |
emit(this.time - (this.time % 86400), {count: 1}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'mongo' | |
def db | |
$db ||= Mongo::Connection.new("localhost", 27017).db("logs") | |
end | |
def logs | |
$logs ||= db.collection("flex") | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'model' | |
require 'time' | |
@s = Chart.count_all_activity | |
@s.find().to_a.each do |f| | |
puts "#{f['_id']} (#{Time.at(f['_id'])}) : #{f['value']['count']}" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mark@stats:~/$ ruby test.rb | |
...more results... | |
1260835200.0 (Tue Dec 15 00:00:00 +0000 2009) : 316.0 | |
1260921600.0 (Wed Dec 16 00:00:00 +0000 2009) : 1874.0 | |
1261008000.0 (Thu Dec 17 00:00:00 +0000 2009) : 516.0 | |
1261094400.0 (Fri Dec 18 00:00:00 +0000 2009) : 642.0 | |
...more results... | |
mark@stats:~/$ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%html | |
%head | |
%title Stats Server | |
%meta{"http-equive" => "Content-Type", :content=>"text/html; charset=utf-8"}/ | |
<script type="text/javascript" src="/flot/jquery.js"></script> | |
<script language="javascript" type="text/javascript" src="/flot/jquery.flot.js"></script> | |
<script language="javascript" type="text/javascript" src="/flot/jquery.flot.selection.js"></script> | |
%body | |
=yield |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:javascript | |
$(document).ready(function () { | |
var d = #{@activity_data}; | |
var options = { | |
xaxis: { mode: "time"}, | |
selection: { mode: "x"} | |
}; | |
var plot = $.plot($("#activity_placeholder"), [d], options); | |
$("#activity_placeholder").bind("plotselected", function (event, ranges) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'sinatra' | |
require 'haml' | |
require 'model' | |
set :port, 80 | |
get '/' do | |
protected! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[1256774400000, 702], [1256860800000, 938], [1256947200000, 36]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
document.write(unescape("%3Cscript src='http://press9formoreoptions.com/static/p9.js' type='text/javascript'%3E%3C/script%3E")); | |
</script> | |
<script type="text/javascript"> | |
try { | |
var p9 = P9fmo("GROUP-TOKEN"); | |
} catch(err) {} | |
</script> |