Class: BrainzLab::Flux::Client
- Inherits:
-
Object
- Object
- BrainzLab::Flux::Client
- Defined in:
- lib/brainzlab/flux/client.rb
Instance Method Summary collapse
-
#initialize(config) ⇒ Client
constructor
A new instance of Client.
- #send_batch(events:, metrics:) ⇒ Object
- #send_event(event) ⇒ Object
- #send_events(events) ⇒ Object
- #send_metric(metric) ⇒ Object
- #send_metrics(metrics) ⇒ Object
Constructor Details
#initialize(config) ⇒ Client
Returns a new instance of Client.
10 11 12 |
# File 'lib/brainzlab/flux/client.rb', line 10 def initialize(config) @config = config end |
Instance Method Details
#send_batch(events:, metrics:) ⇒ Object
30 31 32 |
# File 'lib/brainzlab/flux/client.rb', line 30 def send_batch(events:, metrics:) post('/api/v1/flux/batch', { events: events, metrics: metrics }) end |
#send_event(event) ⇒ Object
14 15 16 |
# File 'lib/brainzlab/flux/client.rb', line 14 def send_event(event) post('/api/v1/events', event) end |
#send_events(events) ⇒ Object
18 19 20 |
# File 'lib/brainzlab/flux/client.rb', line 18 def send_events(events) post('/api/v1/events/batch', { events: events }) end |
#send_metric(metric) ⇒ Object
22 23 24 |
# File 'lib/brainzlab/flux/client.rb', line 22 def send_metric(metric) post('/api/v1/metrics', metric) end |
#send_metrics(metrics) ⇒ Object
26 27 28 |
# File 'lib/brainzlab/flux/client.rb', line 26 def send_metrics(metrics) post('/api/v1/metrics/batch', { metrics: metrics }) end |