Class: ThreeScale::Backend::Stats::Aggregators::ResponseCode

Inherits:
Object
  • Object
show all
Extended by:
Base, Keys
Defined in:
lib/3scale/backend/stats/aggregators/response_code.rb

Class Method Summary collapse

Methods included from Base

aggregate_values, storage, storage_cmd

Methods included from Keys

application_key_prefix, application_response_code_value_key, application_usage_value_key, applications_key_prefix, changed_keys_bucket_key, changed_keys_key, counter_key, metric_key_prefix, response_code_key_prefix, service_key_prefix, service_response_code_value_key, service_usage_value_key, set_of_apps_with_traffic, transaction_keys

Methods included from ThreeScale::Backend::StorageKeyHelpers

#encode_key

Class Method Details

.aggregate(transaction, bucket = nil) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/3scale/backend/stats/aggregators/response_code.rb', line 14

def aggregate(transaction, bucket = nil)
  keys_for_multiple_codes = keys_for_response_code(transaction)
  timestamp = transaction.timestamp

  # For now, we are not interested in storing response codes in
  # buckets, that is the reason why set bucket to nil.
  bucket = nil

  keys_for_multiple_codes.each do |keys|
    aggregate_values(1, timestamp, keys, :incrby, bucket)
  end
end