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 49
|
.find ⇒ void
This method returns an undefined value.
Not Implemented. You cannot search for a Stat.
45
46
47
|
# File 'lib/esp/resources/stat.rb', line 45
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
79
80
81
82
83
|
# File 'lib/esp/resources/stat.rb', line 79
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.
88
89
90
91
|
# File 'lib/esp/resources/stat.rb', line 88
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
38
39
40
|
# File 'lib/esp/resources/stat.rb', line 33
def self.where(attrs)
if attrs[:from].to_s.include?('latest_for_teams')
super
else
fail ESP::NotImplementedError
end
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 59
|
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 54
|
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 95
|
#total_error ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 103
|
#total_fail ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 99
|
#total_info ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 105
|
#total_new_1d ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 159
|
#total_new_1d_error ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 123
|
#total_new_1d_fail ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 119
|
#total_new_1d_info ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 125
|
#total_new_1d_pass ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 117
|
#total_new_1d_warn ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 121
|
#total_new_1h ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 157
|
#total_new_1h_error ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 113
|
#total_new_1h_fail ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 109
|
#total_new_1h_info ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 115
|
#total_new_1h_pass ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 107
|
#total_new_1h_warn ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 111
|
#total_new_1w ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 161
|
#total_new_1w_error ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 131
|
#total_new_1w_fail ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 129
|
#total_new_1w_info ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 133
|
#total_new_1w_pass ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 127
|
#total_new_1w_warn ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 135
|
#total_old ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 163
|
#total_old_error ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 143
|
#total_old_fail ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 137
|
#total_old_info ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 145
|
#total_old_pass ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 139
|
#total_old_warn ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 141
|
#total_pass ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 97
|
#total_suppressed ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 147
|
#total_suppressed_error ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 155
|
#total_suppressed_fail ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 151
|
#total_suppressed_pass ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 149
|
#total_suppressed_warn ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 153
|
#total_warn ⇒ Object
|
# File 'lib/esp/resources/stat.rb', line 101
|