netuitive_ruby_api 1.1.0 → 1.1.1
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 +7 -0
- data/README.md +24 -1
- data/lib/netuitive_ruby_api/data_manager.rb +36 -24
- data/lib/netuitive_ruby_api/netuitive_logger.rb +3 -6
- metadata +18 -22
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 98d072ff6acf0507a604b97520402406ae4b9da1
|
4
|
+
data.tar.gz: f94fb2922985d808654b5c26cac6ec2328ba7877
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 0892548aa4d6a02197a729d21f2a1d0d301a48ec10949b9bb780f2a9b7168962cbaeea96cbcccdd56ce6666ab4f223a251ca369c831cb40d8ffa5eb9dc58045b
|
7
|
+
data.tar.gz: 871dd33d9ff868741560d2c24ab62741fc65f624cb63f87c419774b5464b868d07b5ab6d41e714223ee8429cfb318f7bb4360a1d6e281bc0475d342ffbdbbf4d
|
data/README.md
CHANGED
@@ -26,4 +26,27 @@ Add the aggregation value to the existing value for the metric for this interval
|
|
26
26
|
|
27
27
|
NetuitiveRubyAPI::netuitivedServer.aggregateMetric("metric.name", [aggregation value])
|
28
28
|
|
29
|
-
An aggregation value is the sum of metric values over the course of a single interval. Aggregation can be quite useful for datasets like the number of requests per minute.
|
29
|
+
An aggregation value is the sum of metric values over the course of a single interval. Aggregation can be quite useful for datasets like the number of requests per minute.
|
30
|
+
|
31
|
+
### Test
|
32
|
+
|
33
|
+
To run the tests and code syntax validation run the following commands:
|
34
|
+
|
35
|
+
```
|
36
|
+
gem install bundle
|
37
|
+
bundle install
|
38
|
+
bundle exec rubocop
|
39
|
+
bundle exec rake test
|
40
|
+
```
|
41
|
+
|
42
|
+
### Docker
|
43
|
+
|
44
|
+
This project can be tested and built in a Docker container for convenience. To build and run execute the following:
|
45
|
+
|
46
|
+
```
|
47
|
+
docker build -t netuitive/ruby-api .
|
48
|
+
docker run --name ruby-api netuitive/ruby-api
|
49
|
+
docker cp ruby-api:/opt/app/netuitive_ruby_api-<version>.gem .
|
50
|
+
```
|
51
|
+
|
52
|
+
Make sure to replace `<version>` with the version of the gem which was built in the container.
|
@@ -85,22 +85,30 @@ module NetuitiveRubyApi
|
|
85
85
|
num = sample[:samples].size + sample[:counter_samples].size + sample[:aggregate_metrics].size + sample[:aggregate_counter_metrics].size
|
86
86
|
NetuitiveRubyApi::NetuitiveLogger.log.info "sending #{num} samples" if num > 0
|
87
87
|
threads = []
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
end
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
88
|
+
unless sample[:samples].empty?
|
89
|
+
threads << server_interaction do
|
90
|
+
NetuitiveRubyApi::NetuitiveLogger.log.debug "sending samples: #{sample[:samples]} "
|
91
|
+
netuitived_server.add_samples sample[:samples]
|
92
|
+
end
|
93
|
+
end
|
94
|
+
unless sample[:counter_samples].empty?
|
95
|
+
threads << server_interaction do
|
96
|
+
NetuitiveRubyApi::NetuitiveLogger.log.debug "sending counter_samples: #{sample[:counter_samples]} "
|
97
|
+
netuitived_server.add_counter_samples sample[:counter_samples]
|
98
|
+
end
|
99
|
+
end
|
100
|
+
unless sample[:aggregate_metrics].empty?
|
101
|
+
threads << server_interaction do
|
102
|
+
NetuitiveRubyApi::NetuitiveLogger.log.debug "sending aggregate_metrics: #{sample[:aggregate_metrics]} "
|
103
|
+
netuitived_server.add_aggregate_metrics sample[:aggregate_metrics]
|
104
|
+
end
|
105
|
+
end
|
106
|
+
unless sample[:aggregate_counter_metrics].empty?
|
107
|
+
threads << server_interaction do
|
108
|
+
NetuitiveRubyApi::NetuitiveLogger.log.debug "sending aggregate_counter_metrics: #{sample[:aggregate_counter_metrics]} "
|
109
|
+
netuitived_server.add_aggregate_counter_metrics sample[:aggregate_counter_metrics]
|
110
|
+
end
|
111
|
+
end
|
104
112
|
threads
|
105
113
|
end
|
106
114
|
end
|
@@ -111,14 +119,18 @@ module NetuitiveRubyApi
|
|
111
119
|
num = event_cache[:events].size + event_cache[:exception_events].size
|
112
120
|
NetuitiveRubyApi::NetuitiveLogger.log.info "sending #{num} events" if num > 0
|
113
121
|
threads = []
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
+
unless event_cache[:events].empty?
|
123
|
+
threads << server_interaction do
|
124
|
+
NetuitiveRubyApi::NetuitiveLogger.log.debug "sending events: #{event_cache[:events]} "
|
125
|
+
netuitived_server.add_events(event_cache[:events])
|
126
|
+
end
|
127
|
+
end
|
128
|
+
unless event_cache[:exception_events].empty?
|
129
|
+
threads << server_interaction do
|
130
|
+
NetuitiveRubyApi::NetuitiveLogger.log.debug "sending exception_events: #{event_cache[:exception_events]} "
|
131
|
+
netuitived_server.add_exception_events(event_cache[:exception_events])
|
132
|
+
end
|
133
|
+
end
|
122
134
|
threads
|
123
135
|
end
|
124
136
|
end
|
@@ -2,14 +2,11 @@ require 'logger'
|
|
2
2
|
module NetuitiveRubyApi
|
3
3
|
class CheaterLogger
|
4
4
|
attr_accessor :level
|
5
|
-
def debug(message)
|
6
|
-
end
|
5
|
+
def debug(message); end
|
7
6
|
|
8
|
-
def error(message)
|
9
|
-
end
|
7
|
+
def error(message); end
|
10
8
|
|
11
|
-
def info(message)
|
12
|
-
end
|
9
|
+
def info(message); end
|
13
10
|
end
|
14
11
|
|
15
12
|
class NetuitiveLogger
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: netuitive_ruby_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
5
|
-
prerelease:
|
4
|
+
version: 1.1.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- John King
|
@@ -14,17 +13,15 @@ dependencies:
|
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: netuitived
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: 1.1.0
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: 1.1.0
|
30
27
|
description: Allows for easy submittion of metrics to Netuitive
|
@@ -33,41 +30,40 @@ executables: []
|
|
33
30
|
extensions: []
|
34
31
|
extra_rdoc_files: []
|
35
32
|
files:
|
36
|
-
-
|
37
|
-
-
|
38
|
-
-
|
39
|
-
- lib/netuitive_ruby_api
|
33
|
+
- "./LICENSE"
|
34
|
+
- "./README.md"
|
35
|
+
- config/agent.yml
|
36
|
+
- lib/netuitive_ruby_api.rb
|
40
37
|
- lib/netuitive_ruby_api/config_manager.rb
|
41
|
-
- lib/netuitive_ruby_api/
|
38
|
+
- lib/netuitive_ruby_api/data_cache.rb
|
39
|
+
- lib/netuitive_ruby_api/data_manager.rb
|
42
40
|
- lib/netuitive_ruby_api/error_logger.rb
|
43
|
-
- lib/netuitive_ruby_api.rb
|
44
|
-
-
|
45
|
-
-
|
41
|
+
- lib/netuitive_ruby_api/event_schedule.rb
|
42
|
+
- lib/netuitive_ruby_api/netuitive_logger.rb
|
43
|
+
- lib/netuitive_ruby_api/sample_schedule.rb
|
46
44
|
- log/netuitive.log
|
47
|
-
- ./README.md
|
48
45
|
homepage: http://rubygems.org/gems/netuitive_ruby_api
|
49
46
|
licenses:
|
50
|
-
- Apache
|
47
|
+
- Apache-2.0
|
48
|
+
metadata: {}
|
51
49
|
post_install_message:
|
52
50
|
rdoc_options: []
|
53
51
|
require_paths:
|
54
52
|
- lib
|
55
53
|
required_ruby_version: !ruby/object:Gem::Requirement
|
56
|
-
none: false
|
57
54
|
requirements:
|
58
|
-
- -
|
55
|
+
- - ">="
|
59
56
|
- !ruby/object:Gem::Version
|
60
57
|
version: 1.9.0
|
61
58
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
62
|
-
none: false
|
63
59
|
requirements:
|
64
|
-
- -
|
60
|
+
- - ">="
|
65
61
|
- !ruby/object:Gem::Version
|
66
62
|
version: '0'
|
67
63
|
requirements: []
|
68
64
|
rubyforge_project:
|
69
|
-
rubygems_version:
|
65
|
+
rubygems_version: 2.4.5
|
70
66
|
signing_key:
|
71
|
-
specification_version:
|
67
|
+
specification_version: 4
|
72
68
|
summary: Interface for Netuitive's metric ingest API
|
73
69
|
test_files: []
|