Module: Datadog::Tracing::Contrib::Dalli::Quantize

Defined in:
lib/datadog/tracing/contrib/dalli/quantize.rb

Overview

Quantize contains dalli-specic quantization tools.

Class Method Summary collapse

Class Method Details

.format_command(operation, args) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/datadog/tracing/contrib/dalli/quantize.rb', line 11

def format_command(operation, args)
  placeholder = "#{operation} BLOB (OMITTED)"
  command = [operation, *args].join(' ').strip
  command = Core::Utils.utf8_encode(command, binary: true, placeholder: placeholder)
  Core::Utils.truncate(command, Ext::QUANTIZE_MAX_CMD_LENGTH)
rescue => e
  Datadog.logger.debug("Error sanitizing Dalli operation: #{e}")
  placeholder
end