Module: Stackdriver::Client::Custom
- Included in:
- Stackdriver::Client
- Defined in:
- lib/stackdriver/client/custom.rb
Constant Summary collapse
- ENDPOINT =
'v1/custom'.freeze
Instance Method Summary collapse
- #custom(name, value, collected_at = Time.now.to_i, instance = nil) ⇒ Object
-
#gateway_message(data) ⇒ Object
Wraps the datapoint per doc.
Instance Method Details
#custom(name, value, collected_at = Time.now.to_i, instance = nil) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/stackdriver/client/custom.rb', line 10 def custom(name, value, collected_at=Time.now.to_i, instance=nil) data_point = { name: name, value: value, collected_at: collected_at, instance: instance, } request(:post, ENDPOINT, (data_point)) end |
#gateway_message(data) ⇒ Object
Wraps the datapoint per doc.
24 25 26 27 28 29 30 |
# File 'lib/stackdriver/client/custom.rb', line 24 def (data) { data: data, timestamp: Time.now.to_i, proto_version: 1, } end |