Remove Skylight
This commit is contained in:
parent
fd6042573a
commit
192af7b1b7
2
Gemfile
2
Gemfile
|
@ -24,8 +24,6 @@ gem 'pry'
|
|||
gem 'metriks', '0.9.9.6'
|
||||
gem 'metriks-librato_metrics', github: 'eric/metriks-librato_metrics'
|
||||
|
||||
gem 'skylight', github: 'henrikhodne/skylight-ruby', branch: 'master-sinatra'
|
||||
|
||||
group :test do
|
||||
gem 'rspec', '~> 2.13'
|
||||
gem 'factory_girl', '~> 2.4.0'
|
||||
|
|
|
@ -14,14 +14,6 @@ GIT
|
|||
hashie (>= 1.1.0)
|
||||
uuidtools
|
||||
|
||||
GIT
|
||||
remote: git://github.com/henrikhodne/skylight-ruby.git
|
||||
revision: 76f66ce091dd8fd40d9a2c429e4afacb41cb1491
|
||||
branch: master-sinatra
|
||||
specs:
|
||||
skylight (0.3.12)
|
||||
activesupport (>= 3.0.0)
|
||||
|
||||
GIT
|
||||
remote: git://github.com/rack/rack-contrib.git
|
||||
revision: 5c12ace4ba2b9e4802e4d948a8ee0114da18760b
|
||||
|
@ -347,7 +339,6 @@ DEPENDENCIES
|
|||
sentry-raven!
|
||||
sinatra
|
||||
sinatra-contrib
|
||||
skylight!
|
||||
travis-api!
|
||||
travis-core!
|
||||
travis-sidekiqs!
|
||||
|
|
|
@ -7,14 +7,6 @@ class Travis::Api::App
|
|||
class Base < Sinatra::Base
|
||||
register Extensions::SmartConstants
|
||||
|
||||
if ENV['SKYLIGHT_APPLICATION']
|
||||
require 'skylight'
|
||||
require 'travis/api/app/skylight/dalli_probe'
|
||||
require 'travis/api/app/skylight/redis_probe'
|
||||
require 'travis/api/app/skylight/service_probe'
|
||||
register ::Skylight::Sinatra
|
||||
end
|
||||
|
||||
error NotImplementedError do
|
||||
content_type :txt
|
||||
status 501
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
require 'skylight'
|
||||
require 'travis/api/app'
|
||||
|
||||
class Travis::Api::App
|
||||
module Skylight
|
||||
class DalliProbe
|
||||
def install
|
||||
%w[get get_multi set add incr decr delete replace append prepend].each do |method_name|
|
||||
next unless Dalli::Client.method_defined?(method_name.to_sym)
|
||||
Dalli::Client.class_eval <<-EOD
|
||||
alias #{method_name}_without_sk #{method_name}
|
||||
def #{method_name}(*args, &block)
|
||||
::Skylight.instrument(category: "api.memcache.#{method_name}", title: "Memcache #{method_name}") do
|
||||
#{method_name}_without_sk(*args, &block)
|
||||
end
|
||||
end
|
||||
EOD
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
::Skylight::Probes.register("Dalli::Client", "dalli", DalliProbe.new)
|
||||
end
|
||||
end
|
|
@ -1,31 +0,0 @@
|
|||
require 'skylight'
|
||||
require 'travis/api/app'
|
||||
|
||||
class Travis::Api::App
|
||||
module Skylight
|
||||
class RedisProbe
|
||||
def install
|
||||
::Redis::Client.class_eval do
|
||||
alias call_without_sk call
|
||||
|
||||
def call(command_parts, &block)
|
||||
command = command_parts[0].upcase
|
||||
|
||||
opts = {
|
||||
category: "api.redis.#{command.downcase}",
|
||||
title: "Redis #{command}",
|
||||
annotations: {
|
||||
command: command.to_s
|
||||
}
|
||||
}
|
||||
|
||||
::Skylight.instrument(opts) do
|
||||
call_without_sk(command_parts, &block)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
::Skylight::Probes.register("Redis", "redis", RedisProbe.new)
|
||||
end
|
||||
end
|
|
@ -1,51 +0,0 @@
|
|||
require 'skylight'
|
||||
require 'travis/api/app'
|
||||
|
||||
class Travis::Api::App
|
||||
module Skylight
|
||||
class ServiceProbe
|
||||
class ServiceProxy < Delegator
|
||||
def initialize(key, service)
|
||||
super(service)
|
||||
@key = key
|
||||
@service = service
|
||||
end
|
||||
|
||||
def __getobj__
|
||||
@service
|
||||
end
|
||||
|
||||
def __setobj__(obj)
|
||||
@service = obj
|
||||
end
|
||||
|
||||
def run(*args)
|
||||
opts = {
|
||||
category: "api.service.#{@key}",
|
||||
title: "Service #{@key}",
|
||||
annotations: {
|
||||
service: @key.to_s
|
||||
}
|
||||
}
|
||||
|
||||
::Skylight.instrument(opts) do
|
||||
@service.run(*args)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def install
|
||||
Travis::Services::Helpers.class_eval do
|
||||
alias service_without_sk service
|
||||
|
||||
def service(key, *args)
|
||||
s = service_without_sk(key, *args)
|
||||
ServiceProxy.new(key, s)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
::Skylight::Probes.register("Travis::Services::Helpers", "travis/services/helpers", ServiceProbe.new)
|
||||
end
|
||||
end
|
|
@ -119,9 +119,6 @@ Gem::Specification.new do |s|
|
|||
"lib/travis/api/app/responders/plain.rb",
|
||||
"lib/travis/api/app/responders/service.rb",
|
||||
"lib/travis/api/app/responders/xml.rb",
|
||||
"lib/travis/api/app/skylight/dalli_probe.rb",
|
||||
"lib/travis/api/app/skylight/redis_probe.rb",
|
||||
"lib/travis/api/app/skylight/service_probe.rb",
|
||||
"lib/travis/api/serializer.rb",
|
||||
"lib/travis/api/v2.rb",
|
||||
"lib/travis/api/v2/http.rb",
|
||||
|
|
Loading…
Reference in New Issue
Block a user