Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 27 lines (20 sloc) 522 Bytes
#!/usr/bin/env ruby
require 'rubygems'
require 'dogapi'
require 'jsonl'
require 'time'
api_key = ENV["DD_API_KEY"]
$dog = Dogapi::Client.new(api_key)
$i = 0
def send_metrics(points)
$dog.emit_points('tilt.updates', points, :tags => {user: 'hyu'}, :type => 'gauge'))
end
def adjust_timestamp(time)
$i = $i + 1
new_t = Time.now - $i * 60
new_t
end
raw_json = ARGF.read
parsed_json = JSONL.parse(raw_json)
points = parsed_json.map { |j| [adjust_timestamp(Time.parse(j["StartTime"])), 1] }
send_metrics(points)
You can’t perform that action at this time.