lpxc 0.0.1 → 0.0.2
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/lpxc.rb +3 -2
- data/readme.md +11 -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: e9055cfc3547883f793f5c2a1dbf2e3e39d4d6f5
|
4
|
+
data.tar.gz: d662f72b722516458f8e1f31dd1ddfafcf85129c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8fe8cd9dfb9a9db8bfecf22cadbb6532364c3208e6cc76bfba7504e062c6883d03577c1dd7e3494f737fa3c6be831d94a4fbd6ceb531767a1acd95446e786f18
|
7
|
+
data.tar.gz: d8547c0561673704ea4646fc02a4de1d2ae060c0a679cc2bda11b4f6cd71b099864233b8ce871bb5110033b273feccbb3de50ae8ae0f3a02d8669b0da208ee26
|
data/lpxc.rb
CHANGED
@@ -21,6 +21,7 @@ class Lpxc
|
|
21
21
|
#:batch_size => 300:: Max number of log messages inside single HTTP request.
|
22
22
|
#:flush_interval => 0.5:: Fractional number of seconds before flushing all log messages in buffer to logplex.
|
23
23
|
#:logplex_url => \'https://east.logplex.io/logs':: HTTP server that will accept our log messages.
|
24
|
+
#:disable_delay_flush => nil:: Force flush only batch_size is reached.
|
24
25
|
def initialize(opts={})
|
25
26
|
@hash_lock = Mutex.new
|
26
27
|
@hash = opts[:hash] || Hash.new
|
@@ -34,7 +35,7 @@ class Lpxc
|
|
34
35
|
@conn_timeout = opts[:conn_timeout] || 2
|
35
36
|
@batch_size = opts[:batch_size] || 300
|
36
37
|
@flush_interval = opts[:flush_interval] || 0.5
|
37
|
-
@logplex_url = URI(opts[:logplex_url] || ENV["LOGPLEX_URL"] ||
|
38
|
+
@logplex_url = URI(opts[:logplex_url] || ENV["LOGPLEX_URL"] ||
|
38
39
|
raise("Must set logplex url."))
|
39
40
|
|
40
41
|
#Keep track of the number of requests that the outlet
|
@@ -46,7 +47,7 @@ class Lpxc
|
|
46
47
|
|
47
48
|
#Start the processing threads.
|
48
49
|
Thread.new {outlet}
|
49
|
-
Thread.new {delay_flush}
|
50
|
+
Thread.new {delay_flush} if opts[:disable_delay_flush].nil?
|
50
51
|
end
|
51
52
|
|
52
53
|
#The interface to publish logs into the stream.
|
data/readme.md
CHANGED
@@ -1,9 +1,17 @@
|
|
1
1
|
#lpxc
|
2
2
|
|
3
|
-
|
3
|
+
Lpxc is a fast & efficient client for sending log messages to Heroku's logplex. It uses batching and keep-alive connections to enable high-throughput with little overhead.
|
4
|
+
|
5
|
+
## Documentation
|
6
|
+
|
7
|
+
[Rdoc](https://lpxc.s3.amazonaws.com/doc/Lpxc.html)
|
4
8
|
|
5
9
|
## Usage
|
6
10
|
|
11
|
+
```bash
|
12
|
+
$ gem install lpxc
|
13
|
+
```
|
14
|
+
|
7
15
|
```ruby
|
8
16
|
require 'lpxc'
|
9
17
|
lpxc = Lpxc.new
|
@@ -12,6 +20,8 @@ lpxc.puts("hello world", 't.123')
|
|
12
20
|
|
13
21
|
## Runing Tests
|
14
22
|
|
23
|
+
[](https://drone.io/github.com/ryandotsmith/lpxc/latest)
|
24
|
+
|
15
25
|
```bash
|
16
26
|
$ ruby test.rb
|
17
27
|
```
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lpxc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Smith (♠ ace hacker)
|
@@ -38,7 +38,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
38
38
|
version: '0'
|
39
39
|
requirements: []
|
40
40
|
rubyforge_project:
|
41
|
-
rubygems_version: 2.0.
|
41
|
+
rubygems_version: 2.0.3
|
42
42
|
signing_key:
|
43
43
|
specification_version: 4
|
44
44
|
summary: Ruby client for logplex.
|