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, #fraction_of, #get_apdex, #is_reset?, #merge, #merge!, #merge_attributes, #midpoint, #min_time_less?, #multiply_by, #reset, #should_replace_begin_time?, #should_replace_end_time?, #split, #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.



266
267
268
# File 'lib/new_relic/stats.rb', line 266

def initialize
  reset
end

Instance Attribute Details

#call_countObject

Returns the value of attribute call_count.



259
260
261
# File 'lib/new_relic/stats.rb', line 259

def call_count
  @call_count
end

#max_call_timeObject

Returns the value of attribute max_call_time.



261
262
263
# File 'lib/new_relic/stats.rb', line 261

def max_call_time
  @max_call_time
end

#min_call_timeObject

Returns the value of attribute min_call_time.



260
261
262
# File 'lib/new_relic/stats.rb', line 260

def min_call_time
  @min_call_time
end

#sum_of_squaresObject

Returns the value of attribute sum_of_squares.



264
265
266
# File 'lib/new_relic/stats.rb', line 264

def sum_of_squares
  @sum_of_squares
end

#total_call_timeObject

Returns the value of attribute total_call_time.



262
263
264
# File 'lib/new_relic/stats.rb', line 262

def total_call_time
  @total_call_time
end

#total_exclusive_timeObject

Returns the value of attribute total_exclusive_time.



263
264
265
# File 'lib/new_relic/stats.rb', line 263

def total_exclusive_time
  @total_exclusive_time
end

Instance Method Details

#begin_timeObject



293
294
295
# File 'lib/new_relic/stats.rb', line 293

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.



287
288
# File 'lib/new_relic/stats.rb', line 287

def begin_time=(t)
end

#end_timeObject



297
298
299
# File 'lib/new_relic/stats.rb', line 297

def end_time
  0.0
end

#end_time=(t) ⇒ Object



290
291
# File 'lib/new_relic/stats.rb', line 290

def end_time=(t)
end

#freezeObject



270
271
272
273
# File 'lib/new_relic/stats.rb', line 270

def freeze
  @end_time = Time.now
  super
end

#to_json(*a) ⇒ Object



275
276
277
278
279
280
281
282
# File 'lib/new_relic/stats.rb', line 275

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