Class: Langfuse::CLI::Types::MetricsQuery

Inherits:
T::Struct
  • Object
show all
Defined in:
lib/langfuse/cli/types.rb

Overview

Struct for metrics query parameters

Instance Method Summary collapse

Instance Method Details

#to_hObject



84
85
86
87
88
89
90
91
92
93
94
# File 'lib/langfuse/cli/types.rb', line 84

def to_h
  {
    'view' => view,
    'metrics' => [{ 'measure' => measure, 'aggregation' => aggregation }],
    'dimensions' => dimensions&.map { |d| { 'field' => d } },
    'fromTimestamp' => from_timestamp,
    'toTimestamp' => to_timestamp,
    'timeDimension' => granularity ? { 'granularity' => granularity } : nil,
    'limit' => limit
  }.compact
end