Skip to content

Instantly share code, notes, and snippets.

@lyondhill
lyondhill / componentstats
Created February 24, 2012 23:50
component-stats
http://analytics.pagodabox.com/components/4ea893f048afd85b6500014e/hardware-usage
should return:
hardwareUsage({"data":[{"cpu":0,"mem":0,"hour":"0"},{"cpu":0,"mem":0,"hour":"1"},{"cpu":0,"mem":0,"hour":"2"},{"cpu":0,"mem":0,"hour":"3"},{"cpu":0,"mem":0,"hour":"4"},{"cpu":0,"mem":0,"hour":"5"},{"cpu":0,"mem":0,"hour":"6"},{"cpu":0,"mem":0,"hour":"7"},{"cpu":0,"mem":0,"hour":"8"},{"cpu":0,"mem":0,"hour":"9"},{"cpu":0,"mem":0,"hour":"10"},{"cpu":0,"mem":0,"hour":"11"},{"cpu":0,"mem":0,"hour":"12"},{"cpu":0,"mem":0,"hour":"13"},{"cpu":0,"mem":0,"hour":"14"},{"cpu":0,"mem":0,"hour":"15"},{"cpu":0,"mem":0,"hour":"16"},{"cpu":0,"mem":0,"hour":"17"},{"cpu":0,"mem":0,"hour":"18"},{"cpu":0,"mem":0,"hour":"19"},{"cpu":0,"mem":0,"hour":"20"},{"cpu":0,"mem":0,"hour":"21"},{"cpu":0,"mem":0,"hour":"22"},{"cpu":0,"mem":0,"hour":"23"}],"description":""})
global:
env:
- APP_NAME: lucy
- ENV: production
web1:
cron:
- "* * * * *": "ls -la"
- "*/3 */2 1-3 2,6,7 2": "echo 'im a little teapot'"
@lyondhill
lyondhill / crontest.rb
Created December 29, 2011 23:13
cron test
require 'spec_helper'
describe ScheduledJob do
it "should return an empty criteria" do
time = Time.new(1111,1,1,1,1,1)
ScheduledJob.create(:minute => [time.min])
ScheduledJob.create(:hour => [time.hour])
ScheduledJob.create(:day => [time.day])
ScheduledJob.create(:month => [time.month])
@lyondhill
lyondhill / scheduledjobs.rb
Created December 21, 2011 17:59
scheduledjobs
class ScheduledJob
include Mongoid::Document
field :minute, :type => Array, :default => ['*']
field :hour, :type => Array, :default => ['*']
field :day, :type => Array, :default => ['*']
field :month, :type => Array, :default => ['*']
field :week, :type => Array, :default => ['*']
field :url