Module: Datadog::Contrib::Elasticsearch::Quantize
- Defined in:
- lib/ddtrace/contrib/elasticsearch/quantize.rb
Overview
Quantize contains ES-specific resource quantization tools.
Constant Summary collapse
- ID_REGEXP =
%r{\/([0-9]+)([\/\?]|$)}- ID_PLACEHOLDER =
'/?\2'.freeze
- INDEX_REGEXP =
/[0-9]{2,}/- INDEX_PLACEHOLDER =
'?'.freeze
Class Method Summary collapse
-
.format_url(url) ⇒ Object
Very basic quantization, complex processing should be done in the agent.
Class Method Details
.format_url(url) ⇒ Object
Very basic quantization, complex processing should be done in the agent
15 16 17 18 |
# File 'lib/ddtrace/contrib/elasticsearch/quantize.rb', line 15 def format_url(url) quantized_url = url.gsub(ID_REGEXP, ID_PLACEHOLDER) quantized_url.gsub(INDEX_REGEXP, INDEX_PLACEHOLDER) end |