Module: Bugsnag::Api::Client::Trends

Included in:
Bugsnag::Api::Client
Defined in:
lib/bugsnag/api/client/trends.rb

Overview

Methods for the Pivots API

Instance Method Summary collapse

Instance Method Details

List Trends for an Error in bucket form

Parameters:

  • filters (Hash)

    a customizable set of options

Returns:

  • (Array<Sawyer::Resource>)

    List of Trends as requested

See Also:



14
15
16
17
18
19
20
21
22
# File 'lib/bugsnag/api/client/trends.rb', line 14

def trends_buckets(project_id, buckets_count, error_id=nil, options = {})
  defaults = {:query => {:buckets_count => buckets_count}}
  merged_opts = deep_merge(defaults, options)
  if !error_id.nil?
    get "projects/#{project_id}/errors/#{error_id}/trend", merged_opts
  else
    get "projects/#{project_id}/trend", merged_opts
  end
end

List Trends for an Error in resolution form

Parameters:

  • filters (Hash)

    a customizable set of options

Returns:

  • (Array<Sawyer::Resource>)

    List of Trends as requested

See Also:



29
30
31
32
33
34
35
36
37
# File 'lib/bugsnag/api/client/trends.rb', line 29

def trends_resolution(project_id, resolution, error_id=nil, options = {})
  defaults = {:query => {:resolution => resolution}}
  merged_opts = deep_merge(defaults, options)
  if !error_id.nil?
    get "projects/#{project_id}/errors/#{error_id}/trend", merged_opts
  else
    get "projects/#{project_id}/trend", merged_opts
  end
end