Class: Kward::TelemetryStats::Result

Inherits:
Struct
  • Object
show all
Defined in:
lib/kward/telemetry/stats.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#enabled_categoriesObject

Returns the value of attribute enabled_categories

Returns:

  • (Object)

    the current value of enabled_categories



14
15
16
# File 'lib/kward/telemetry/stats.rb', line 14

def enabled_categories
  @enabled_categories
end

#errorsObject

Returns the value of attribute errors

Returns:

  • (Object)

    the current value of errors



14
15
16
# File 'lib/kward/telemetry/stats.rb', line 14

def errors
  @errors
end

#log_dirObject

Returns the value of attribute log_dir

Returns:

  • (Object)

    the current value of log_dir



14
15
16
# File 'lib/kward/telemetry/stats.rb', line 14

def log_dir
  @log_dir
end

#performanceObject

Returns the value of attribute performance

Returns:

  • (Object)

    the current value of performance



14
15
16
# File 'lib/kward/telemetry/stats.rb', line 14

def performance
  @performance
end

#rangeObject

Returns the value of attribute range

Returns:

  • (Object)

    the current value of range



14
15
16
# File 'lib/kward/telemetry/stats.rb', line 14

def range
  @range
end

#record_countObject

Returns the value of attribute record_count

Returns:

  • (Object)

    the current value of record_count



14
15
16
# File 'lib/kward/telemetry/stats.rb', line 14

def record_count
  @record_count
end

#records_by_categoryObject

Returns the value of attribute records_by_category

Returns:

  • (Object)

    the current value of records_by_category



14
15
16
# File 'lib/kward/telemetry/stats.rb', line 14

def records_by_category
  @records_by_category
end

#records_by_eventObject

Returns the value of attribute records_by_event

Returns:

  • (Object)

    the current value of records_by_event



14
15
16
# File 'lib/kward/telemetry/stats.rb', line 14

def records_by_event
  @records_by_event
end

#tokensObject

Returns the value of attribute tokens

Returns:

  • (Object)

    the current value of tokens



14
15
16
# File 'lib/kward/telemetry/stats.rb', line 14

def tokens
  @tokens
end

#toolsObject

Returns the value of attribute tools

Returns:

  • (Object)

    the current value of tools



14
15
16
# File 'lib/kward/telemetry/stats.rb', line 14

def tools
  @tools
end

Instance Method Details

#to_hObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/kward/telemetry/stats.rb', line 15

def to_h
  {
    range: {
      input: range[:input],
      count: range[:count],
      unit: range[:unit],
      startAt: range[:start_at].iso8601,
      endAt: range[:end_at].iso8601
    },
    logDir: log_dir,
    enabledCategories: enabled_categories,
    recordCount: record_count,
    recordsByCategory: records_by_category,
    recordsByEvent: records_by_event,
    usageStats: tokens,
    performance: performance,
    tools: tools,
    errors: errors
  }
end