Class: NewRelic::StatsBase

Inherits:
Object
  • Object
show all
Includes:
Stats
Defined in:
lib/new_relic/stats.rb

Direct Known Subclasses

ApdexStats, BasicStats, MethodTraceStats

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Stats

#absent?, #apdex_score, #as_percentage, #as_percentage_of, #average_call_time, #average_exclusive_time, #calls_per_minute, #checked_calculation, #duration, #exclusive_time_percentage, #expand_min_max_to, #get_apdex, #is_reset?, #merge, #merge!, #merge_attributes, #midpoint, #min_time_less?, #multiply_by, #reset, #should_replace_begin_time?, #should_replace_end_time?, #stack_min_max_from, #standard_deviation, #sum_attributes, #sum_merge!, #summary, #time_percentage, #time_str, #to_s, #total_call_time_per_minute, #update_boundaries, #update_totals

Constructor Details

#initializeStatsBase

Returns a new instance of StatsBase.



213
214
215
# File 'lib/new_relic/stats.rb', line 213

def initialize
  reset
end

Instance Attribute Details

#call_countObject

Returns the value of attribute call_count.



206
207
208
# File 'lib/new_relic/stats.rb', line 206

def call_count
  @call_count
end

#max_call_timeObject

Returns the value of attribute max_call_time.



208
209
210
# File 'lib/new_relic/stats.rb', line 208

def max_call_time
  @max_call_time
end

#min_call_timeObject

Returns the value of attribute min_call_time.



207
208
209
# File 'lib/new_relic/stats.rb', line 207

def min_call_time
  @min_call_time
end

#sum_of_squaresObject

Returns the value of attribute sum_of_squares.



211
212
213
# File 'lib/new_relic/stats.rb', line 211

def sum_of_squares
  @sum_of_squares
end

#total_call_timeObject

Returns the value of attribute total_call_time.



209
210
211
# File 'lib/new_relic/stats.rb', line 209

def total_call_time
  @total_call_time
end

#total_exclusive_timeObject

Returns the value of attribute total_exclusive_time.



210
211
212
# File 'lib/new_relic/stats.rb', line 210

def total_exclusive_time
  @total_exclusive_time
end

Instance Method Details

#begin_timeObject



240
241
242
# File 'lib/new_relic/stats.rb', line 240

def begin_time
  0.0
end

#begin_time=(t) ⇒ Object

In this class, we explicitly don’t track begin and end time here, to save space during cross process serialization via xml. Still the accessor methods must be provided for merge to work.



234
235
# File 'lib/new_relic/stats.rb', line 234

def begin_time=(t)
end

#end_timeObject



244
245
246
# File 'lib/new_relic/stats.rb', line 244

def end_time
  0.0
end

#end_time=(t) ⇒ Object



237
238
# File 'lib/new_relic/stats.rb', line 237

def end_time=(t)
end

#freezeObject



217
218
219
220
# File 'lib/new_relic/stats.rb', line 217

def freeze
  @end_time = Time.now
  super
end

#to_json(*a) ⇒ Object



222
223
224
225
226
227
228
229
# File 'lib/new_relic/stats.rb', line 222

def to_json(*a)
  {'call_count' => call_count,
    'min_call_time' => min_call_time,
    'max_call_time' => max_call_time,
    'total_call_time' => total_call_time,
    'total_exclusive_time' => total_exclusive_time,
    'sum_of_squares' => sum_of_squares}.to_json(*a)
end