rorvswild 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 539fb2b080805724e336dc4d11c5321c4dccde4e
4
- data.tar.gz: 7564c5063da3e4e140a1ead81da5273379966207
3
+ metadata.gz: fb391d416535c07f5586df1a052ecb699cc943a2
4
+ data.tar.gz: a374d4de6e7c30c37feba70a8cd1bde0af217336
5
5
  SHA512:
6
- metadata.gz: 9cc49fe8204ad12061a1c9995f81ad6d96b0352e5789abd3d762755d1caeb12ff10ee11442c13bef624bebfcf6d49be62838911e8ab4577a820460865850781d
7
- data.tar.gz: d58eb06d7bd4004b9ee7964f07f98a1e512fe9a99cc315afff18f200708d4a04b81f2bf4645740940d7b98f247a08889e675e275168d695fbe78ade449d4c2ef
6
+ metadata.gz: a4fdeb901a45b705209bfc2400cd21f519a7e2ff6534b0f2543b105db38ce86c7d6d69178355880d03cdfe9de09b716ec3e2e683f2517468e04a0ffa322d1d79
7
+ data.tar.gz: 7bdf9774c34ec3d465b718f620c73a4e38962905d4d775a397ba52a5d2431a4d953cd7be2c408b7cef1b034162b8d8be12d43775aa59399b89859c1966f74eac
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  <img align="right" src="/images/rorvswild_logo.jpg">
5
5
 
6
- *RoRvsWild* is a free ruby gem to monitor performances and quality in Ruby on Rails applications.
6
+ *RoRvsWild* is a ruby gem to monitor performances and quality in Ruby on Rails applications.
7
7
 
8
8
  This gem has a double mode, development and production.
9
9
  It can be used without an account to monitor your requests performances in your development environment.
@@ -35,14 +35,14 @@ Signup on https://www.rorvswild.com and create an app to get one.
35
35
 
36
36
  The `rorvswild-setup` command creates a `config/rorvswild.yml` file.
37
37
 
38
- For those who prefer to manually use an initializer, they can do the following.
38
+ If you prefer to use an initializer, you can do the following:
39
39
 
40
40
  ```ruby
41
41
  # config/initializers/rorvswild.rb
42
42
  RorVsWild.start(api_key: API_KEY)
43
43
  ```
44
44
 
45
- You can create unlimited apps on *rorvswild.com* to monitor your different environments, or use the same key for both staging and production. If you want to add a staging server you have to edit your Gemfile.
45
+ You can create unlimited apps on *rorvswild.com*. If you want to monitor your staging environment, create a new app and edit your rorvswild.yml to add the API key.
46
46
 
47
47
  ## Development mode: *RoRvsWild Local*
48
48
 
@@ -46,6 +46,10 @@ module RorVsWild
46
46
  Logger.new(Rails.root + "log/rorvswild.log")
47
47
  end
48
48
  end
49
+
50
+ def self.clock_milliseconds
51
+ Process.clock_gettime(Process::CLOCK_MONOTONIC, :millisecond)
52
+ end
49
53
  end
50
54
 
51
55
  if defined?(Rails)
@@ -84,7 +84,7 @@ module RorVsWild
84
84
  push_exception(ex, parameters: parameters)
85
85
  raise
86
86
  ensure
87
- data[:runtime] = (Time.now - data[:started_at]) * 1000
87
+ data[:runtime] = RorVsWild.clock_milliseconds - data[:started_at]
88
88
  post_job
89
89
  end
90
90
  end
@@ -97,7 +97,7 @@ module RorVsWild
97
97
 
98
98
  def stop_request
99
99
  return unless data[:name]
100
- data[:runtime] = (Time.now.utc - data[:started_at]) * 1000
100
+ data[:runtime] = RorVsWild.clock_milliseconds - data[:started_at]
101
101
  post_request
102
102
  end
103
103
 
@@ -144,7 +144,7 @@ module RorVsWild
144
144
  data[:name] = name
145
145
  data[:sections] = []
146
146
  data[:section_stack] = []
147
- data[:started_at] = Time.now.utc
147
+ data[:started_at] = RorVsWild.clock_milliseconds
148
148
  end
149
149
 
150
150
  def cleanup_data
@@ -17,10 +17,6 @@ module RorVsWild
17
17
 
18
18
  def self.template(api_key)
19
19
  <<YAML
20
- # Keep the development block for testing on your local machine only.
21
- development:
22
- api_key: #{api_key}
23
-
24
20
  production:
25
21
  api_key: #{api_key}
26
22
  # ignored_exceptions:
@@ -25,6 +25,7 @@ module RorVsWild
25
25
  log_incompatible_middleware_warning
26
26
  else
27
27
  body.each { |string| inject_into(string) }
28
+ headers["Content-Length"] = body.map(&:bytesize).reduce(0, :+) if headers["Content-Length"]
28
29
  end
29
30
  end
30
31
  [status, headers, body]
@@ -262,12 +262,14 @@ h2.rorvswild-local-panel__request__name__title {
262
262
  display: inline-block !important;
263
263
  }
264
264
  .rorvswild-local-panel__request-details__section__command {
265
+ overflow: hidden !important;
265
266
  color: #afbecc !important;
266
267
  margin-left: 12px !important;
267
268
  -webkit-box-flex: 1 !important;
268
269
  -ms-flex: 1 !important;
269
270
  flex: 1 !important;
270
271
  opacity: .6 !important;
272
+ word-wrap: break-word !important;
271
273
  }
272
274
 
273
275
  .rorvswild-local-panel__request-details__section:hover .rorvswild-local-panel__request-details__section__command {
@@ -12,11 +12,9 @@ http://prismjs.com/download.html?themes=prism-twilight&languages=markup+css+clik
12
12
  font-family: monospace !important;
13
13
  text-align: left !important;
14
14
  text-shadow: 0 0 0 !important;
15
- white-space: inherit !important;
16
15
  word-spacing: normal !important;
17
-
18
- word-break: break-all !important;
19
- overflow-wrap: break-word !important;
16
+ white-space: pre-wrap !important;
17
+ word-wrap: break-word !important;
20
18
 
21
19
  font-size: 15px !important;
22
20
  line-height: 24px !important;
@@ -26,7 +24,6 @@ http://prismjs.com/download.html?themes=prism-twilight&languages=markup+css+clik
26
24
  tab-size: 4 !important;
27
25
 
28
26
  -webkit-hyphens: none !important;
29
- -moz-hyphens: none !important;
30
27
  -ms-hyphens: none !important;
31
28
  hyphens: none !important;
32
29
 
@@ -45,7 +42,6 @@ http://prismjs.com/download.html?themes=prism-twilight&languages=markup+css+clik
45
42
  border: 0 !important;
46
43
  box-shadow: 0 0 0 !important;
47
44
  margin: 0 !important;
48
- overflow: hidden !important;
49
45
  padding: 0 !important;
50
46
  }
51
47
 
@@ -66,7 +62,6 @@ http://prismjs.com/download.html?themes=prism-twilight&languages=markup+css+clik
66
62
  border: 0 !important;
67
63
  box-shadow: 0 0 0 !important;
68
64
  padding: 0 !important;
69
- white-space: normal !important;
70
65
  }
71
66
 
72
67
  .rorvswild-local-panel .token.comment,
@@ -13,7 +13,7 @@ module RorVsWild
13
13
  def self.stop(&block)
14
14
  section = stack.pop
15
15
  block.call(section) if block_given?
16
- section.total_runtime = (Time.now.utc - section.started_at) * 1000
16
+ section.total_runtime = RorVsWild.clock_milliseconds - section.started_at
17
17
  current.children_runtime += section.total_runtime if current
18
18
  RorVsWild.agent.add_section(section)
19
19
  end
@@ -30,7 +30,7 @@ module RorVsWild
30
30
  @calls = 1
31
31
  @total_runtime = 0
32
32
  @children_runtime = 0
33
- @started_at = Time.now.utc
33
+ @started_at = RorVsWild.clock_milliseconds
34
34
  location = RorVsWild.agent.find_most_relevant_location(caller_locations)
35
35
  @file = RorVsWild.agent.relative_path(location.path)
36
36
  @line = location.lineno
@@ -1,3 +1,3 @@
1
1
  module RorVsWild
2
- VERSION = "1.3.0".freeze
2
+ VERSION = "1.3.1".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rorvswild
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexis Bernard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-12 00:00:00.000000000 Z
11
+ date: 2017-12-14 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Performances and quality insights for rails developers.
14
14
  email: