Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/datadog/core/remote/worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def initialize(interval:, logger:, &block)
attr_reader :logger

def start
logger.debug { 'remote worker starting' }
logger.debug { "remote worker starting (pid: #{$$})" }

acquire_lock

Expand All @@ -50,7 +50,7 @@ def start
end

def stop
logger.debug { 'remote worker stopping' }
logger.debug { "remote worker stopping (pid: #{$$})" }

acquire_lock

Expand Down
2 changes: 1 addition & 1 deletion lib/datadog/di/el/evaluator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def iref(var)

def len(var, var_name)
case var
when Array, String
when Array, String, Hash
var.length
else
raise DI::Error::ExpressionEvaluationError, "Unsupported type for length: #{var.class}: #{var_name}"
Expand Down
29 changes: 29 additions & 0 deletions spec/datadog/di/el/integration_cases/all_any.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,32 @@
- locals:
collection: []
result: false

- name: "any with @value"
ast:
any:
- ref: collection
- isEmpty:
ref: '@value'

# compiled:

eval:
- locals:
collection:
foo: ""
result: true

- locals:
collection:
foo: 42
result: false

- locals:
collection: [1]
# TODO reconsider - there are no keys in an array
result: false

- locals:
collection: []
result: false
15 changes: 14 additions & 1 deletion spec/datadog/di/el/integration_cases/length.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,23 @@
compiled: len(ref('var'), 'var')

eval:
- locals:
- name: string
locals:
var: 'test'
result: 4

- name: array
locals:
var: [1, 2, 3]
result: 3

- name: hash
locals:
var:
foo: bar
foo1: bar1
result: 2

- name: length of complex expression
ast:
len:
Expand Down
Loading