nexaas-auditor 1.0.0 → 1.0.1

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
  SHA1:
3
- metadata.gz: f9346148a901d3522638421724dc138eb776fd1a
4
- data.tar.gz: fa44e097369d0fe7217d6310773a1724efe5de1e
3
+ metadata.gz: 41aa4aade90e929f1017124ecc8dc919dbdf8009
4
+ data.tar.gz: 140f0375f99bf74b7066dee4d4f7c7476c867f2c
5
5
  SHA512:
6
- metadata.gz: e66ad047a111d655e416bac410f17f01f530a133257dc2dfedc0b3e572727b5aeb6d0d9fed7a2d47d9b93c5d2be88f7a8d1775be0f2d2aa29148260aaa83bdbd
7
- data.tar.gz: 555203f20ed7b5e799aea8f2cbf8d235a420dd1c7e8c7f4983009bf84f5b49decf86340fbb0ac4dd91f5ef34d574ca1574e34636c7ce91a3c453f523b0adffc9
6
+ metadata.gz: e04fd39437da7fe52f8b1da3eea32fc8fe09e2b284926a5e650fafd4cc4ed15422e34dffda5a46de83c6d0172b7ada47cdba70fc83636a7d678c310a2cf0d53c
7
+ data.tar.gz: f0902b3f3775e410f6572efeaa46b5707f6ed66c8e9e7e84379bca4ae8de49dc5990f8e0486e3df7b21fc6ae64b9910208981cdb0e7bf571c20573bf6c5a49b1
data/README.md CHANGED
@@ -10,7 +10,7 @@ This has been tested with Rails 4.2.x only so far. It probably works fine as wel
10
10
 
11
11
  The audit log is created in a [logfmt](https://www.brandur.org/logfmt) format only for now. Support for more log formats is planned in the future.
12
12
 
13
- Both the audit log and statistics tracking assume all instrumented events are named in a dot notation format, for example you could use `'app.users.login.sucess'` to instrument a successful user login event. The `'app.'` prefix is a suggestion to separate your bussiness-logic events from framework-specific (Rails) events, which will always have a `'rails.'` prefix, for example `'rails.action_controller.runtime.total'` for example.
13
+ Both the audit log and statistics tracking assume all instrumented events are named in a dot notation format, for example you could use `'app.users.login.sucess'` to instrument a successful user login event. The `'app.'` prefix is a suggestion to separate your business-logic events from framework-specific (Rails) events, which will always have a `'rails.'` prefix, for example `'rails.action_controller.runtime.total'` for example.
14
14
 
15
15
  ## Installation
16
16
 
@@ -43,10 +43,10 @@ Nexaas::Auditor.configure do |config|
43
43
  config.enabled = true
44
44
  config.logger = Rails.logger
45
45
 
46
- # use audit logging for bussiness-logic instrumented events
46
+ # use audit logging for business-logic instrumented events
47
47
  config.log_app_events = true
48
48
 
49
- # use statistics tracking for bussiness-logic instrumented events
49
+ # use statistics tracking for business-logic instrumented events
50
50
  config.track_app_events = true
51
51
 
52
52
  # use statistics tracking for default Rails instrumented events
@@ -74,12 +74,12 @@ end
74
74
  Nexaas::Auditor.subscribe_all
75
75
  ```
76
76
 
77
- Then, create your loggers and statistic trackers in `app/loggers/` and `app/statistics/` for example, inheriting from `Nexaas::Auditor::LogSubscriber` and `Nexaas::Auditor::StatsSubscriber` respectively.
77
+ Then, create your loggers and statistic trackers in `app/loggers/` and `app/statistics/` for example, inheriting from `Nexaas::Auditor::LogsSubscriber` and `Nexaas::Auditor::StatsSubscriber` respectively.
78
78
 
79
79
  For example:
80
80
 
81
81
  ```ruby
82
- class UsersAppLogger < ::Nexaas::Auditor::LogSubscriber
82
+ class UsersAppLogger < ::Nexaas::Auditor::LogsSubscriber
83
83
  # The namespace for events to subscribe to. In this example, subscribe to all
84
84
  # events beggining with "app.users.".
85
85
  def self.pattern
@@ -3,18 +3,18 @@ module Nexaas
3
3
  module StatisticsTrackers
4
4
  class Base
5
5
 
6
- def track_count(name, value=nil)
7
- track(:count, name, value)
6
+ def track_count(metric:, value: nil)
7
+ value ||= 1
8
+ track(:count, metric, value)
8
9
  end
9
10
 
10
- def track_value(name, value)
11
- track(:value, name, value)
11
+ def track_value(metric:, value:)
12
+ track(:value, metric, value)
12
13
  end
13
14
 
14
15
  private
15
16
 
16
17
  def track(type, name, value)
17
- value ||= 1 if type == :count
18
18
  validate_value!(value, type)
19
19
  full_name = full_metric_name(name)
20
20
  validate_name!(name, full_name)
@@ -1,5 +1,5 @@
1
1
  module Nexaas
2
2
  module Auditor
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nexaas-auditor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Tassinari de Oliveira