stathat-json 0.0.2 → 0.0.3

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: 3e11e1f213f0fb5a8e8d1cdcd6debf99483e4505
4
- data.tar.gz: 5001f7d597113e1648b43980720e2d8d1a00d0a8
3
+ metadata.gz: 669a58cde1c9c0f3956a90633a0c8e65a52f76d3
4
+ data.tar.gz: 92c6e45690f8824953a34e98b447f36ca7657449
5
5
  SHA512:
6
- metadata.gz: f1061139f95edfc6167badb8f376fd253075978ece70895fd5dd3516dfc09e79971a70d7beca7d5adeefe3a2db7627018bf0eb462b5b276182ddeca0aa9b7e6b
7
- data.tar.gz: f69b067199d963d6d3da1dd8f02cd0454db8fece10c1f48bab5ba19f5323e6f88398c12ac9b6ea29985854ade6854cad2e8f054cc5df93aea16131ce6f2c8785
6
+ metadata.gz: 12b831c6a47d2462955f9ce3269521a8793ce8a0a9349682ccff1cdd4f23bacf396707674ed1bfcf64cc92b74de00e40767c2739df9ee49687b3a7b2bbc4d7d3
7
+ data.tar.gz: fd2743801161472223f07c0f7df4412826209645ebb123247546fbc7d5a5af3e9dabe3eff0bab71649fa705136aa92d05452714045478067697ca85baf8011aa
data/README.md CHANGED
@@ -25,8 +25,44 @@ Or install it yourself as:
25
25
  $ gem install stathat-json
26
26
 
27
27
  ## Usage
28
+ #### Batch post stats
29
+ ```Ruby
30
+ require 'stathat/json'
28
31
 
29
- TODO: Write usage instructions here
32
+ StatHat::Json::Api.ez_key = 'YOUR_EZ_KEY' # will also be picked up from ENV['STATHAT_EZKEY']
33
+
34
+ stats = []
35
+ stats << {stat: 'count_stat1'} # implicit count and time
36
+ stats << {stat: 'count_stat2', count: 2, t: 1420428506} # explicit count and time
37
+ stats << {stat: 'value_stat1', value: 3.14159} # delicious Pi
38
+
39
+ StatHat::Json::Api.post_stats(stats)
40
+
41
+ ```
42
+
43
+ #### Post individual stats
44
+ ```Ruby
45
+ require 'stathat/json'
46
+
47
+ StatHat::Json::Api.ez_key = 'YOUR_EZ_KEY' # will also be picked up from ENV['STATHAT_EZKEY']
48
+
49
+ StatHat::Json::Api.post_count('count_stat1') # implicit count and time
50
+ StatHat::Json::Api.post_count('count_stat2', 2, 1420428506) # explicit count and time
51
+ StatHat::Json::Api.post_value('value_stat1', 3.14159) # delicious Pi
52
+
53
+ ```
54
+ #### Short lived processes
55
+ `StatHat::Json::Api` uses [Celluloid::IO](https://github.com/celluloid/celluloid-io) for threading and async network IO for long runing processes.
56
+ Use `StatHat::Json::SyncApi` for short lived processes, the API is identical.
57
+
58
+ ## Tested with the following Rubies
59
+ * 1.9.3
60
+ * 2.0.0
61
+ * 2.1.0
62
+ * rbx-2.2.10
63
+ * jruby-19mode
64
+ * ruby-head
65
+ * jruby-head
30
66
 
31
67
  ## Contributing
32
68
 
@@ -1,5 +1,5 @@
1
1
  module StatHat
2
2
  module Json
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ['nkeyes@gmail.com']
11
11
  spec.summary = %q{StatHat JSON API Client.}
12
12
  spec.description = %q{StatHat JSON API Client.}
13
- spec.homepage = ''
13
+ spec.homepage = 'https://github.com/nkeyes/stathat-json'
14
14
  spec.license = 'MIT'
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stathat-json
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Keyes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-05 00:00:00.000000000 Z
11
+ date: 2015-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -162,7 +162,7 @@ files:
162
162
  - spec/stathat/json/sync_api_spec.rb
163
163
  - stathat-json.gemspec
164
164
  - tasks/bump.rake
165
- homepage: ''
165
+ homepage: https://github.com/nkeyes/stathat-json
166
166
  licenses:
167
167
  - MIT
168
168
  metadata: {}