newrelic-daybreak 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +20 -0
- data/README.md +23 -0
- data/lib/newrelic-daybreak.rb +2 -0
- data/lib/newrelic-daybreak/instrumentation.rb +61 -0
- data/lib/newrelic-daybreak/version.rb +3 -0
- metadata +76 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: dba7083de4541fc38647ff386eaa1c4837f9a2d7
|
4
|
+
data.tar.gz: d889fe6f88f4cc6ad5c7fad73e8f014199662ead
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c2cafb2a9bc39c03d07f56f48a8fd167abab222e08efd46a3a100a49a7952538f552c887f9c39312bc59e97bdb046ff62ad093a3d72f09aa17f22a6175cebffb
|
7
|
+
data.tar.gz: 593d19c687c0f539e62bf70a7146600a9b4b668b400e15f9090c8bf92ed39dd6021289911d0b82aa255de459497443b59ba445e49342cbc81f6ea04a52a3040e
|
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (C) 2015 Warren Guy <warren@guy.net.au>
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
7
|
+
the Software without restriction, including without limitation the rights to
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
10
|
+
subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# newrelic-daybreak
|
2
|
+
|
3
|
+
Daybreak instrumentation for NewRelic. Reports time spent inside Daybreak
|
4
|
+
transactions. Supports `get`, `set`, `update`, and `delete` methods.
|
5
|
+
|
6
|
+
## Installing
|
7
|
+
|
8
|
+
* Add the gem to your `Gemfile`:
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
source 'https://rubygems.org'
|
12
|
+
gem 'newrelic-daybreak'
|
13
|
+
```
|
14
|
+
|
15
|
+
## License
|
16
|
+
|
17
|
+
MIT license. See LICENSE.
|
18
|
+
|
19
|
+
## Author
|
20
|
+
|
21
|
+
Warren Guy <warren@guy.net.au>
|
22
|
+
|
23
|
+
https://warrenguy.me
|
@@ -0,0 +1,61 @@
|
|
1
|
+
DependencyDetection.defer do
|
2
|
+
@name = :daybreak
|
3
|
+
|
4
|
+
depends_on do
|
5
|
+
defined?(::Daybreak) &&
|
6
|
+
!NewRelic::Control.instance['disable_daybreak'] &&
|
7
|
+
ENV['NEWRELIC_ENABLE'].to_s !~ /false|off|no/i
|
8
|
+
end
|
9
|
+
|
10
|
+
executes do
|
11
|
+
NewRelic::Agent.logger.info 'Installing Daybreak Instrumentation'
|
12
|
+
end
|
13
|
+
|
14
|
+
executes do
|
15
|
+
require 'new_relic/agent/datastores'
|
16
|
+
|
17
|
+
module NewRelicDaybreak::Instrumentation
|
18
|
+
def [](key)
|
19
|
+
NewRelic::Agent::Datastores.wrap("Daybreak", "get", key) do
|
20
|
+
super(key)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
alias_method :get, '[]'
|
24
|
+
|
25
|
+
def []=(key, value)
|
26
|
+
NewRelic::Agent::Datastores.wrap("Daybreak", "set", key) do
|
27
|
+
super(key, value)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
alias_method :set, '[]='
|
31
|
+
|
32
|
+
def set!(key, value)
|
33
|
+
NewRelic::Agent::Datastores.wrap("Daybreak", "set", key) do
|
34
|
+
super(key, value)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def delete(key)
|
39
|
+
NewRelic::Agent::Datastores.wrap("Daybreak", "delete", key) do
|
40
|
+
super(key)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def delete!(key)
|
45
|
+
NewRelic::Agent::Datastores.wrap("Daybreak", "delete", key) do
|
46
|
+
super(key)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def update(*args)
|
51
|
+
NewRelic::Agent::Datastores.wrap("Daybreak", "update", args.keys) do
|
52
|
+
super(*args)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
class Daybreak::DB
|
58
|
+
prepend NewRelicDaybreak::Instrumentation
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
metadata
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: newrelic-daybreak
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Warren Guy
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-08-03 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: daybreak
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.3'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: newrelic_rpm
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3.11'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3.11'
|
41
|
+
description: A simple redis backed cache for Sinatra
|
42
|
+
email: warren@guy.net.au
|
43
|
+
executables: []
|
44
|
+
extensions: []
|
45
|
+
extra_rdoc_files: []
|
46
|
+
files:
|
47
|
+
- LICENSE
|
48
|
+
- README.md
|
49
|
+
- lib/newrelic-daybreak.rb
|
50
|
+
- lib/newrelic-daybreak/instrumentation.rb
|
51
|
+
- lib/newrelic-daybreak/version.rb
|
52
|
+
homepage: https://github.com/warrenguy/newrelic-daybreak
|
53
|
+
licenses:
|
54
|
+
- MIT
|
55
|
+
metadata: {}
|
56
|
+
post_install_message:
|
57
|
+
rdoc_options: []
|
58
|
+
require_paths:
|
59
|
+
- lib
|
60
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
61
|
+
requirements:
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '0'
|
65
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
requirements: []
|
71
|
+
rubyforge_project:
|
72
|
+
rubygems_version: 2.2.2
|
73
|
+
signing_key:
|
74
|
+
specification_version: 4
|
75
|
+
summary: A simple redis backed cache for Sinatra
|
76
|
+
test_files: []
|