Class: DatadogProxy::DatadogClient
- Inherits:
-
Object
- Object
- DatadogProxy::DatadogClient
- Defined in:
- lib/datadog_proxy/datadog_client.rb
Defined Under Namespace
Classes: Error
Instance Method Summary collapse
- #graph_snapshot_url(options) ⇒ Object
-
#initialize(api_key, app_key) ⇒ DatadogClient
constructor
A new instance of DatadogClient.
Constructor Details
#initialize(api_key, app_key) ⇒ DatadogClient
8 9 10 11 |
# File 'lib/datadog_proxy/datadog_client.rb', line 8 def initialize(api_key, app_key) @client = Dogapi::Client.new(api_key, app_key) @graph_snapshot_url_cache = {} end |
Instance Method Details
#graph_snapshot_url(options) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/datadog_proxy/datadog_client.rb', line 13 def graph_snapshot_url() # TODO: cap cache size or use external storage like memcached @graph_snapshot_url_cache[.hash] ||= _graph_snapshot_url() # Append time to avoid the graph is cached. "#{@graph_snapshot_url_cache[options.hash]}?#{Time.now.to_i}" end |