lib/3scale/backend/stats/aggregator.rb
# This method stores the events in buckets if that option is enabled
# or if it was disable because of an emergency (not because a user
# did it manually), and Kinesis has already consumed all the pending
# buckets.
This method stores the events in buckets if that option is enabled
or if it was disable because of an emergency (not because a user
did it manually), and Kinesis has already consumed all the pending
buckets.
This method stores the events in buckets if that option is enabled or if it was disable because of an emergency ( not because a user did it manually ) and Kinesis has already consumed all the pending buckets .
def process(transactions)
            current_bucket = nil
            if configuration.can_create_event_buckets
              if Storage.enabled? && buckets_limit_exceeded?
                Storage.disable!(true)
                log_bucket_creation_disabled
              elsif save_in_bucket?
                Storage.enable! unless Storage.enabled?
                current_bucket = Time.now.utc.beginning_of_bucket(stats_bucket_size)
                                             .to_not_compact_s
              end
            end
            touched_apps = aggregate(transactions, current_bucket)
            ApplicationEvents.generate(touched_apps.values)
            update_alerts(transactions)
            begin
              ApplicationEvents.ping
            rescue ApplicationEvents::PingFailed => e
              logger.notify e
            end
          end
def process ( transactions ) current_bucket = nil if configuration . can_create_event_buckets if Storage . enabled? && buckets_limit_exceeded? Storage . disable! ( true ) log_bucket_creation_disabled elsif save_in_bucket? Storage . enable! unless Storage . enabled? current_bucket = Time . now . utc . beginning_of_bucket ( stats_bucket_size ) . to_not_compact_s end end touched_apps = aggregate ( transactions , current_bucket ) ApplicationEvents . generate ( touched_apps . values ) update_alerts ( transactions ) begin ApplicationEvents . ping rescue ApplicationEvents :: PingFailed => e logger . notify e end end
This method stores the events in buckets if that option is enabled
or if it was disable because of an emergency (not because a user
did it manually), and Kinesis has already consumed all the pending
buckets.
This method stores the events in buckets if that option is enabled or if it was disable because of an emergency ( not because a user did it manually ) and Kinesis has already consumed all the pending buckets .
# Only disable indicating emergency if bucket storage is enabled. # Otherwise, we might indicate emergency when a user manually # disabled it previously. # we could not ping the frontend, log it
transactions
<not_specific>