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 +4 -4
- data/README.md +13 -0
- data/lib/app_monit/query.rb +9 -1
- data/lib/app_monit/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68542c41cf8434d64795e937bed7a684e499260b
|
4
|
+
data.tar.gz: a5dec15e7534d0935032850052799f35284e36d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
data/lib/app_monit/query.rb
CHANGED
@@ -13,7 +13,15 @@ module AppMonit
|
|
13
13
|
|
14
14
|
params[:event_collection] = collection_name
|
15
15
|
|
16
|
-
|
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
|
data/lib/app_monit/version.rb
CHANGED
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.
|
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-
|
12
|
+
date: 2014-10-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|