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
| <?php | |
| class Dashboard_Model_OAuth_Consumer extends OCAD_Db_Row | |
| { | |
| public function recordRequest($timestamp, $nonce) | |
| { | |
| if( $timestamp > $this->timestamp ) | |
| { | |
| // Update saved timestamp | |
| $this->timestamp = $timestamp; | |
| $this->setNonces(array($nonce)); // Clear saved nonces |
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
| #! /usr/bin/ruby | |
| require 'socket' | |
| statsd_host = "" | |
| statsd_port = "8125" | |
| namespace_prefix = "statsd-ruby" | |
| mode = "statsd" | |
| ARGV.each do |arg| | |
| name, value = arg.split '=' |
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
| #!/usr/bin/env ruby | |
| require 'socket' | |
| require 'optparse' | |
| # Collect INFO from Redis, report it to Graphite | |
| opts = OptionParser.new do |opts| | |
| opts.banner = "Usage: redis-graphite.rb redis-host[:redis-port] graphite-host" | |
| opts.on( '-h', '--help', 'Display this screen' ) do | |
| puts opts |
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 'socket' | |
| class Graphite | |
| def initialize(host) | |
| @host = host | |
| end | |
| def socket | |
| return @socket if @socket && [email protected]? | |
| @socket = TCPSocket.new(@host, 2003) |
NewerOlder