Class: StatHat::Reporter
Instance Method Summary collapse
- #ez_post_count(stat_name, ezkey, count, timestamp, cb) ⇒ Object
- #ez_post_value(stat_name, ezkey, value, timestamp, cb) ⇒ Object
- #finish ⇒ Object
-
#initialize ⇒ Reporter
constructor
A new instance of Reporter.
- #post_count(stat_key, user_key, count, timestamp, cb) ⇒ Object
- #post_value(stat_key, user_key, value, timestamp, cb) ⇒ Object
Constructor Details
#initialize ⇒ Reporter
Returns a new instance of Reporter.
97 98 99 100 101 |
# File 'lib/stathat.rb', line 97 def initialize @que = Queue.new @runlock = Mutex.new run_pool() end |
Instance Method Details
#ez_post_count(stat_name, ezkey, count, timestamp, cb) ⇒ Object
132 133 134 135 136 137 138 |
# File 'lib/stathat.rb', line 132 def ez_post_count(stat_name, ezkey, count, , cb) args = { :stat => stat_name, :ezkey => ezkey, :count => count } args[:t] = unless .nil? enqueue(Common::EZ_URL, args, cb) end |
#ez_post_value(stat_name, ezkey, value, timestamp, cb) ⇒ Object
124 125 126 127 128 129 130 |
# File 'lib/stathat.rb', line 124 def ez_post_value(stat_name, ezkey, value, , cb) args = { :stat => stat_name, :ezkey => ezkey, :value => value } args[:t] = unless .nil? enqueue(Common::EZ_URL, args, cb) end |
#finish ⇒ Object
103 104 105 106 |
# File 'lib/stathat.rb', line 103 def finish() stop_pool # XXX serialize queue? end |
#post_count(stat_key, user_key, count, timestamp, cb) ⇒ Object
116 117 118 119 120 121 122 |
# File 'lib/stathat.rb', line 116 def post_count(stat_key, user_key, count, , cb) args = { :key => stat_key, :ukey => user_key, :count => count } args[:t] = unless .nil? enqueue(Common::CLASSIC_COUNT_URL, args, cb) end |
#post_value(stat_key, user_key, value, timestamp, cb) ⇒ Object
108 109 110 111 112 113 114 |
# File 'lib/stathat.rb', line 108 def post_value(stat_key, user_key, value, , cb) args = { :key => stat_key, :ukey => user_key, :value => value } args[:t] = unless .nil? enqueue(Common::CLASSIC_VALUE_URL, args, cb) end |