Class: ESP::Stat
- Inherits:
-
Resource
show all
- Defined in:
- lib/esp/resources/stat.rb
'total' rollup methods
collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Dirty
#changed_attributes, #original_attributes, #original_attributes=
#load
Class Method Details
.create ⇒ void
This method returns an undefined value.
Not Implemented. You cannot create a Stat.
|
# File 'lib/esp/resources/stat.rb', line 46
|
.find ⇒ void
This method returns an undefined value.
Not Implemented. You cannot search for a Stat.
42
43
44
|
# File 'lib/esp/resources/stat.rb', line 42
def self.find(*)
fail ESP::NotImplementedError, 'Regular ARELlike methods are disabled. Use either the ESP::Stat.for_report or ESP::Stat.latest_for_teams method.'
end
|
Returns all the stats of all the alerts for a report identified by the report_id parameter. Said report contains all statistics for this alert triggered from signatures contained in all regions for the selected hour.
Parameters
76
77
78
79
80
|
# File 'lib/esp/resources/stat.rb', line 76
def self.for_report(report_id = nil, options = {}) fail ArgumentError, "You must supply a report id." unless report_id.present?
find_one(from: "#{prefix}reports/#{report_id}/stats.json", params: options)
end
|
Returns all the stats for the most recent report of each team accessible by the given API key.
85
86
87
88
|
# File 'lib/esp/resources/stat.rb', line 85
def self.latest_for_teams
where(from: "#{prefix}stats/latest_for_teams")
end
|
.where(attrs) ⇒ void
This method returns an undefined value.
Not Implemented. You cannot search for a Stat.
33
34
35
36
37
|
# File 'lib/esp/resources/stat.rb', line 33
def self.where(attrs)
return super if attrs[:from].to_s.include?('latest_for_teams')
fail ESP::NotImplementedError
end
|
Instance Method Details
The stats for each custom signature associated with this stat object.
28
|
# File 'lib/esp/resources/stat.rb', line 28
has_many :custom_signatures, class_name: 'ESP::StatCustomSignature'
|
#destroy ⇒ void
This method returns an undefined value.
Not Implemented. You cannot delete a Stat.
|
# File 'lib/esp/resources/stat.rb', line 56
|
The stats for each region associated with this stat object.
13
|
# File 'lib/esp/resources/stat.rb', line 13
has_many :regions, class_name: 'ESP::StatRegion'
|
The report these stats are for.
8
|
# File 'lib/esp/resources/stat.rb', line 8
belongs_to :report, class_name: 'ESP::Report'
|
#save ⇒ void
This method returns an undefined value.
Not Implemented. You cannot create or update a Stat.
|
# File 'lib/esp/resources/stat.rb', line 51
|
The stats for each service associated with this stat object.
18
|
# File 'lib/esp/resources/stat.rb', line 18
has_many :services, class_name: 'ESP::StatService'
|
The stats for each signature associated with this stat object.
23
|
# File 'lib/esp/resources/stat.rb', line 23
has_many :signatures, class_name: 'ESP::StatSignature'
|
#total ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 92
|
#total_error ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 100
|
#total_fail ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 96
|
#total_info ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 102
|
#total_new_1d ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 156
|
#total_new_1d_error ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 120
|
#total_new_1d_fail ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 116
|
#total_new_1d_info ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 122
|
#total_new_1d_pass ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 114
|
#total_new_1d_warn ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 118
|
#total_new_1h ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 154
|
#total_new_1h_error ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 110
|
#total_new_1h_fail ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 106
|
#total_new_1h_info ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 112
|
#total_new_1h_pass ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 104
|
#total_new_1h_warn ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 108
|
#total_new_1w ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 158
|
#total_new_1w_error ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 128
|
#total_new_1w_fail ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 126
|
#total_new_1w_info ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 130
|
#total_new_1w_pass ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 124
|
#total_new_1w_warn ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 132
|
#total_old ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 160
|
#total_old_error ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 140
|
#total_old_fail ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 134
|
#total_old_info ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 142
|
#total_old_pass ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 136
|
#total_old_warn ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 138
|
#total_pass ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 94
|
#total_suppressed ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 144
|
#total_suppressed_error ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 152
|
#total_suppressed_fail ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 148
|
#total_suppressed_pass ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 146
|
#total_suppressed_warn ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 150
|
#total_warn ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 98
|