Class: ErrorStalker::Store::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/error_stalker/store/base.rb

Overview

The base store that all other exception stores should inherit from. All methods on this class must be inherited by subclasses, and the methods that return multiple objects must support pagination.

Direct Known Subclasses

InMemory, Mongoid

Instance Method Summary collapse

Instance Method Details

#applicationsObject

A list of all the applications that have seen exceptions

Raises:

  • (NotImplementedError)


42
43
44
# File 'lib/error_stalker/store/base.rb', line 42

def applications
  raise NotImplementedError, "Must be implemented by child class"
end

#empty?Boolean

Have any exceptions been logged? If not, return true

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


22
23
24
# File 'lib/error_stalker/store/base.rb', line 22

def empty?
  raise NotImplementedError, "Must be implemented by child class"
end

#find(id) ⇒ Object

Find an exception report with the given id

Raises:

  • (NotImplementedError)


27
28
29
# File 'lib/error_stalker/store/base.rb', line 27

def find(id)
  raise NotImplementedError, "Must be implemented by child class"
end

#group(digest) ⇒ Object

Returns the ExceptionGroup matching digest

Raises:

  • (NotImplementedError)


32
33
34
# File 'lib/error_stalker/store/base.rb', line 32

def group(digest)
  raise NotImplementedError, "Must be implemented by child class"
end

#machinesObject

A list of all the machines that have seen exceptions

Raises:

  • (NotImplementedError)


47
48
49
# File 'lib/error_stalker/store/base.rb', line 47

def machines
  raise NotImplementedError, "Must be implemented by child class"
end

#recentObject

Return the most recent exception groups. Should return an array of ErrorStalker::ExceptionGroup objects.

Raises:

  • (NotImplementedError)


17
18
19
# File 'lib/error_stalker/store/base.rb', line 17

def recent
  raise NotImplementedError, "Must be implemented by child class"
end

#reports_in_group(digest) ⇒ Object

Returns a list of exceptions whose digest is digest.

Raises:

  • (NotImplementedError)


37
38
39
# File 'lib/error_stalker/store/base.rb', line 37

def reports_in_group(digest)
  raise NotImplementedError, "Must be implemented by child class"
end

#search(params) ⇒ Object

Searches for exception reports maching params. Search should support searching by application name, machine name, exception name, and exception type. The keys in params should match attributes of ErrorStalker::ExceptionReport, and the results should be ordered by timestamp from newest to oldest.

Raises:

  • (NotImplementedError)


71
72
73
# File 'lib/error_stalker/store/base.rb', line 71

def search(params)
  raise NotImplementedError, "Must be implemented by child class"
end

#store(exception_report) ⇒ Object

Store this exception_report, however the store wishes to.

Raises:

  • (NotImplementedError)


11
12
13
# File 'lib/error_stalker/store/base.rb', line 11

def store(exception_report)
  raise NotImplementedError, "Must be implemented by child class"
end

#supports_extended_searches?Boolean

Does this store support searching through the data blob?

Returns:

  • (Boolean)


52
53
54
# File 'lib/error_stalker/store/base.rb', line 52

def supports_extended_searches?
  false
end

#totalObject

Returns the total number of exceptions

Raises:

  • (NotImplementedError)


57
58
59
# File 'lib/error_stalker/store/base.rb', line 57

def total
  raise NotImplementedError, "Must be implemented by child class"      
end

#total_since(timestamp) ⇒ Object

Returns the total number of exceptions since timestamp

Raises:

  • (NotImplementedError)


62
63
64
# File 'lib/error_stalker/store/base.rb', line 62

def total_since(timestamp)
  raise NotImplementedError, "Must be implemented by child class"
end