app_monit 0.0.5 → 0.0.6

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: b45442d97743d84c104c4ff7d9f353e68f0c7d2f
4
- data.tar.gz: 82ea6df8c1bf81b4702570735e65c07e6ecede16
3
+ metadata.gz: 68542c41cf8434d64795e937bed7a684e499260b
4
+ data.tar.gz: a5dec15e7534d0935032850052799f35284e36d3
5
5
  SHA512:
6
- metadata.gz: 853143be5929ea5b6f8fc6bc00cce5a1b60ad42dff0c811d4764a26f12506f0447937ccafc693e764b8d9372830cf94c092ddd01b00dcf3052b1fdc8e7c38f24
7
- data.tar.gz: 3c30b46d77e7fb013c629ac31521fe917ba0d1c3f95e5ef9aa051a06d07f89295f95a2535fceebb146cd81af432da3d890aa6e5c3fcaf1fd8ccc45acddf5aeb7
6
+ metadata.gz: 6bf337709e54a6e179c263280dc617aaf181e93d003f010b1f4807fd29d1171f48cb93c21fce299ff61b4c5cf11c82a3683f3e7efb96315c81ccfddea0629bf7
7
+ data.tar.gz: 49b0d5d567be3da56eee58543d5d42f398511c6029bd0d55bd991fd4b6424b6fa7f805ff9dd345ac491fdd1bb3a33d48202ac046a51e3c4527dc67b6ebc0af22
data/README.md CHANGED
@@ -44,6 +44,14 @@ To disable creating events, set the `.enabled` option in the configuration (defa
44
44
  AppMonit::Config.enabled = false
45
45
  ```
46
46
 
47
+ Default timeout for HTTP requests is 1 second to prevent stalling the application when sending events.
48
+ To change this setting use the `.timeout` option (default: 1). When set to 0 it falls back to the default HTTP timeout of 60 seconds.
49
+
50
+ ```ruby
51
+ AppMonit::Config.timeout = 10
52
+ ```
53
+
54
+
47
55
  ### Create an event
48
56
 
49
57
  ```ruby
@@ -191,6 +199,11 @@ Use the following operators:
191
199
  | in | in |
192
200
  | nin | not in |
193
201
 
202
+ ### Extra query params
203
+
204
+ You can also specify the environment and API key through the parameters
205
+
206
+ AppMonit::Query.count('registered', ap_key: 'KEY', environment: 'ENV')
194
207
 
195
208
  ## Contributing
196
209
 
@@ -13,7 +13,15 @@ module AppMonit
13
13
 
14
14
  params[:event_collection] = collection_name
15
15
 
16
- response = Http.get("#{path}?query=#{CGI.escape(params.to_json)}")
16
+ query_string_parts = []
17
+
18
+ query_string_parts << "api_key=#{params.delete(:api_key)}" if params[:api_key]
19
+ query_string_parts << "environment=#{params.delete(:environment)}" if params[:environment]
20
+ query_string_parts << "query=#{CGI.escape(params.to_json)}"
21
+
22
+ query_string = query_string_parts.join('&')
23
+
24
+ response = Http.get("#{path}?#{query_string}")
17
25
 
18
26
  case response.code.to_i
19
27
  when 200
@@ -1,3 +1,3 @@
1
1
  module AppMonit
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: app_monit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Redmar Kerkhoff
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-10-21 00:00:00.000000000 Z
12
+ date: 2014-10-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler