lib/sensu/server/process.rb
# Determine if a transport message is under the optional
# configured max message size. This method helps prevent
# oversized messages from consuming memory and being persisted
# to the datastore.
#
# @param message [String]
# @return [TrueClass,FalseClass]
Determine if a transport message is under the optional
configured max message size. This method helps prevent
oversized messages from consuming memory and being persisted
to the datastore.
Determine if a transport message is under the optional configured max message size . This method helps prevent oversized messages from consuming memory and being persisted to the datastore .
def message_size_ok?(message)
        if @settings[:sensu][:server] &&
           @settings[:sensu][:server][:max_message_size]
          message_size = message.bytesize
          max_message_size = @settings[:sensu][:server][:max_message_size]
          if message_size <= max_message_size
            true
          else
            @logger.error("message exceeds the configured max message size", {
              :max_message_size => max_message_size,
              :message_size => message_size,
              :message => message
            })
            false
          end
        else
          true
        end
      end
def message_size_ok? ( message ) if @settings [ :sensu ] [ :server ] && @settings [ :sensu ] [ :server ] [ :max_message_size ] message_size = message . bytesize max_message_size = @settings [ :sensu ] [ :server ] [ :max_message_size ] if message_size <= max_message_size true else @logger . error ( "message exceeds the configured max message size" , { :max_message_size => max_message_size , :message_size => message_size , :message => message } ) false end else true end end
Determine if a transport message is under the optional
configured max message size.
Determine if a transport message is under the optional configured max message size .
None
TrueClass,FalseClass
message
None