module Stackdriver::Client::Custom

Constants

ENDPOINT

Public Instance Methods

custom(name, value, collected_at=Time.now.to_i, instance=nil) click to toggle source
# 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, gateway_message(data_point))
end
gateway_message(data) click to toggle source

Wraps the datapoint per doc.

# File lib/stackdriver/client/custom.rb, line 24
def gateway_message(data)
  {
    data: data,
    timestamp: Time.now.to_i,
    proto_version: 1,
  }
end