percy-common 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/percy/common/version.rb +1 -1
- data/lib/percy/stats.rb +18 -2
- data/percy-common.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15a863191e2a3892bdc0e9083e3c652aa92de501f65f134b0213e760ca4f7573
|
4
|
+
data.tar.gz: b7b33dc5b49fd86048bc37c27ccc763b428065fcd5035a08307510c0e23af469
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acc619521a157d94e02d5e1cc4d667b4e13970fd33245fb1f000109ff1629d72dd7db1a39d9eab08c49d0d22ef6373220a55d58b42a1ba727eb919b5a9f64de4
|
7
|
+
data.tar.gz: 4814087c1058fd032e6635fca5d21b0e8cf489701a3848615a998c4eb50f94966c814ecb2e480cbe7de4d7bc65c5d3f565cbb1c5a490cdb668a75412aa36648f
|
data/lib/percy/common/version.rb
CHANGED
data/lib/percy/stats.rb
CHANGED
@@ -44,15 +44,31 @@ module Percy
|
|
44
44
|
# Programmer mistake, so raise an error.
|
45
45
|
raise 'no timing started' unless @_timing_start
|
46
46
|
|
47
|
-
|
47
|
+
time_since_monotonic(stat, @_timing_start, options)
|
48
48
|
@_timing_start = nil
|
49
49
|
true
|
50
50
|
end
|
51
51
|
|
52
|
-
|
52
|
+
# dogstatsd uses a monotonic (linearly increasing) clock to calculate time
|
53
|
+
# intervals, so this should be used where necessary. However, it's not
|
54
|
+
# possible to compare monotonic time values with fixed times, so both are
|
55
|
+
# available.
|
56
|
+
def time_since_monotonic(stat, start, opts = {})
|
57
|
+
unless start.instance_of? Float
|
58
|
+
raise ArgumentError, 'start value must be Float'
|
59
|
+
end
|
60
|
+
|
53
61
|
timing(stat, ((now.to_f - start.to_f) * 1000).round, opts)
|
54
62
|
end
|
55
63
|
|
64
|
+
def time_since(stat, start, opts = {})
|
65
|
+
unless start.instance_of? Time
|
66
|
+
raise ArgumentError, 'start value must be Time'
|
67
|
+
end
|
68
|
+
|
69
|
+
timing(stat, ((Time.now.to_f - start.to_f) * 1000).round, opts)
|
70
|
+
end
|
71
|
+
|
56
72
|
private def now
|
57
73
|
Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
58
74
|
end
|
data/percy-common.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.add_dependency 'excon', '~> 0.57'
|
21
21
|
|
22
22
|
spec.add_development_dependency 'bundler', '~> 2.0.2'
|
23
|
-
spec.add_development_dependency 'rake', '~>
|
23
|
+
spec.add_development_dependency 'rake', '~> 12.3'
|
24
24
|
spec.add_development_dependency 'rspec', '~> 3.2'
|
25
25
|
spec.add_development_dependency 'guard-rspec', '~> 4.7'
|
26
26
|
spec.add_development_dependency 'percy-style', '~> 0.6.0'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: percy-common
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Perceptual Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-07-
|
11
|
+
date: 2019-07-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dogstatsd-ruby
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '12.3'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '12.3'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|