callcounter 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 70bca5d8cccd13dc7e49b588c2da40b4ca0312b04732ca21d4a28f1265d9deed
4
- data.tar.gz: 0ab8f77ab9fb23395bd28a479dbb16f3223ec20695514d73eaee5832c2f2c79d
3
+ metadata.gz: 694f83b9c21262d809ab3d266ff011d8f75c2a45b8260a6a6887ede4f1c360e5
4
+ data.tar.gz: 1e83328f50e2bd7e6bed1230fdee6e27cba10b6d28e7cebc8dda449835598867
5
5
  SHA512:
6
- metadata.gz: 77436a39409401c6781d2ad2c82ed52737a4fcaaea40bca81a98cbb2f4e110df81d54298e1d3786ff2c59449959b74a26be667a6284b8afbdada373e41bd07d2
7
- data.tar.gz: ea6c438f1f8d8abc6edbfa1c70cbb28c6113054da09ea2eaac0636fcf2dcea00ac845c5a7c6ee9a838253546fded12d19f531d1ed7081e2a6c0b4fca1e11259c
6
+ metadata.gz: 9b999f9fc145d1b6691d0ba32d1344f8396df52efaa53973d2953abf0a38d471238ad61c6b0c536a3a5bad814538bade3046a29b9569ee22cf7a9b727013a57f
7
+ data.tar.gz: 285d154f5da3904ccd4bf6750254061fe26e0c6ea8b9ef7a6ace9f2513e6eefcf94145c494a483f82a69645796e4bcfd916fe1af362fd95bd56d9d6c407bd2bb
data/README.md CHANGED
@@ -2,18 +2,39 @@
2
2
 
3
3
  # Callcounter Ruby integration gem
4
4
 
5
- This gem can be used to gather API request & response data from Rack based applications.
5
+ This gem can be used to gather API request & response data from Rack based applications and send it to Callcounter.
6
+
7
+ Callcounter is an API analytics platform that collect information about requests (calls) to your API using so-called
8
+ integrations. Integrations come in the form of a Ruby gem, a Nuget package, a Pip module, etcetera. The integrations
9
+ can send the data to Callcounter using an API, which is described at: https://callcounter.eu/pages/api
10
+
11
+ After collection data, the web interface can then be used to view all kinds of metrics, giving you insight in the
12
+ (mis)usage of your API.
6
13
 
7
14
  ## Install
8
15
 
9
- When using bundler, simply add the following line to your Gemfile:
16
+ ### Bundler
17
+
18
+ When using bundler, simply add the following line to your Gemfile and run `bundle`:
10
19
 
11
20
  ```ruby
12
21
  gem 'callcounter'
13
22
  ```
14
23
 
15
- Run `bundle install` in your project directory and create an initializer
16
- `config/initializers/callcounter.rb` with the following content:
24
+ ### Other
25
+
26
+ Install the gem with: `gem install callcounter`. Next, add the following call to your entry file in order to activate
27
+ the Rack middleware:
28
+
29
+ ```ruby
30
+ use Callcounter::Capturer
31
+ ```
32
+
33
+ ## Configure what to capture
34
+
35
+ Configure callcounter with the following code, this can be placed in a Rails initializer when using Ruby on Rails,
36
+ for example `config/initializers/callcounter.rb`, or somewhere in your entry point file when using Sinatra or other
37
+ Rack based frameworks:
17
38
 
18
39
  ```ruby
19
40
  Callcounter.configure do |config|
@@ -21,13 +42,12 @@ Callcounter.configure do |config|
21
42
  end
22
43
  ```
23
44
 
24
- After deploying you should start seeing data in Callcounter. Note that this might take some time
25
- because this gems only sends data every few requests or every few minutes.
26
-
27
- ## Configure what to capture
45
+ This will capture any requests to the `api` subdomain and any request that has a path which starts with `/api`.
46
+ After deploying you should start seeing data in Callcounter. Note that this might take some time because this gems
47
+ only sends data every few requests or every few minutes.
28
48
 
29
- You can add a lambda that will be called for every request to determine whether it was a request to your API.
30
- For example, the default lambda is shown below:
49
+ If you API doesn't match with the default matching rules, you can add a lambda that will be called for every request
50
+ to determine whether it was a request to your API. For example, you can custome the default lambda shown below:
31
51
 
32
52
  ```ruby
33
53
  Callcounter.configure do |config|
@@ -38,6 +58,22 @@ Callcounter.configure do |config|
38
58
  end
39
59
  ```
40
60
 
61
+ ## Bug reporting
62
+
63
+ Bugs can be reported through the Sourcehut todo lists found at: https://todo.sr.ht/~webindie/callcounter-gem
64
+ If you don't want to sign up for an account, you can also contact us through https://callcounter.eu/contact
65
+
66
+ ## Releasing
67
+
68
+ - Verify tests pass.
69
+ - Increment version number in: `lib/callcounter/version.rb`
70
+ - Run `bundle install`
71
+ - Commit all changes
72
+ - Create a git tag for the release.
73
+ - Push the git tag.
74
+ - Build the gem: `gem build callcounter.gemspec`
75
+ - Push the gem to rubygems.org: `gem push callcounter-?.?.?.gem`
76
+
41
77
  ## About Callcounter
42
78
 
43
79
  [Callcounter](https://callcounter.eu) is a service built by [Webindie](https://webindie.nl) that
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'net/http'
4
+
3
5
  module Callcounter
4
6
  # class that captures the rack requests and sends them to callcounter.eu
5
7
  class Capturer
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Callcounter
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: callcounter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Webindie
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-28 00:00:00.000000000 Z
11
+ date: 2021-05-03 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Callcounter is a service that helps API providers with debugging and
14
14
  optimising the usage of their APIs.