rack-lineprof 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rack/lineprof.rb +1 -1
- data/lib/rack/lineprof/source.rb +6 -6
- metadata +19 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c671bd62ed01d6e795f86c4707f3c63009e23af
|
4
|
+
data.tar.gz: 7a4119942165738a119d97f7261b4dbba1865e25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2d30923f4976336eb6e0d2fd1f9eb031901a32990e00846ac918625935a2dc6d3428561d78babcabd365863ac36c296c0b7cb3283f887c263096537e7cc91c3
|
7
|
+
data.tar.gz: 36feda5c2153b34a6a3b9fd91bf76ee3c4446c62541fa63fdcd6e9b066b795bb26ab130a0e5e77ea4bb766d5495337d1e3d82b85c2b30b1cf917c2ff62484a5c
|
data/lib/rack/lineprof.rb
CHANGED
data/lib/rack/lineprof/source.rb
CHANGED
@@ -36,16 +36,16 @@ module Rack
|
|
36
36
|
ms = sample[0] / 1000.0
|
37
37
|
calls = sample[2]
|
38
38
|
|
39
|
-
|
40
|
-
|
39
|
+
abnormal = ms >= thresholds[NOMINAL]
|
40
|
+
near_abnormal = (line-context..line+context).any? do |near|
|
41
41
|
near = [1, near].max
|
42
42
|
next unless raw_samples[near]
|
43
|
-
(raw_samples[near][0] / 1000.0) >=
|
43
|
+
(raw_samples[near][0] / 1000.0) >= thresholds[NOMINAL]
|
44
44
|
end
|
45
45
|
|
46
|
-
next unless
|
46
|
+
next unless abnormal or near_abnormal
|
47
47
|
|
48
|
-
threshold = thresholds.detect { |
|
48
|
+
threshold = thresholds.invert.detect { |th, _| ms > th }
|
49
49
|
level = threshold ? threshold.last : CONTEXT
|
50
50
|
|
51
51
|
next unless code = source_lines[line - 1]
|
@@ -75,7 +75,7 @@ module Rack
|
|
75
75
|
CRITICAL => 50,
|
76
76
|
WARNING => 5,
|
77
77
|
NOMINAL => 0.2
|
78
|
-
}.merge(options.fetch :thresholds, {})
|
78
|
+
}.merge(options.fetch :thresholds, {})
|
79
79
|
end
|
80
80
|
|
81
81
|
end
|
metadata
CHANGED
@@ -1,57 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-lineprof
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evan Owen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '1.5'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '1.5'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rblineprof
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.3.
|
33
|
+
version: 0.3.6
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.3.
|
40
|
+
version: 0.3.6
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: term-ansicolor
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '1.3'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '1.3'
|
55
55
|
description: Rack middleware for rblineprof (github.com/tmm1/rblineprof)
|
56
56
|
email:
|
57
57
|
- kainosnoema@gmail.com
|
@@ -59,10 +59,10 @@ executables: []
|
|
59
59
|
extensions: []
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
|
+
- lib/rack-lineprof.rb
|
63
|
+
- lib/rack/lineprof.rb
|
62
64
|
- lib/rack/lineprof/sample.rb
|
63
65
|
- lib/rack/lineprof/source.rb
|
64
|
-
- lib/rack/lineprof.rb
|
65
|
-
- lib/rack-lineprof.rb
|
66
66
|
homepage: https://github.com/kainosnoema/rack-lineprof
|
67
67
|
licenses:
|
68
68
|
- MIT
|
@@ -73,17 +73,17 @@ require_paths:
|
|
73
73
|
- lib
|
74
74
|
required_ruby_version: !ruby/object:Gem::Requirement
|
75
75
|
requirements:
|
76
|
-
- -
|
76
|
+
- - ">="
|
77
77
|
- !ruby/object:Gem::Version
|
78
78
|
version: '0'
|
79
79
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- -
|
81
|
+
- - ">="
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '0'
|
84
84
|
requirements: []
|
85
85
|
rubyforge_project:
|
86
|
-
rubygems_version: 2.
|
86
|
+
rubygems_version: 2.2.2
|
87
87
|
signing_key:
|
88
88
|
specification_version: 4
|
89
89
|
summary: Makes line-by-line source code profiling easy.
|