Class: Datadog::Statsd::Schema::Analyzer::BaseFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog/statsd/schema/analyzer.rb

Overview

——————————————————————————————————————————————————————————————————————————————————————————————————————————————- Formatter classes ——————————————————————————————————————————————————————————————————————————————————————————————————————————————-

Since:

  • 0.1.0

Direct Known Subclasses

JSONFormatter, TextFormatter, YAMLFormatter

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stdout:, stderr:, color:, analysis_result:) ⇒ BaseFormatter

Returns a new instance of BaseFormatter.

Since:

  • 0.1.0



369
370
371
372
373
374
375
376
377
# File 'lib/datadog/statsd/schema/analyzer.rb', line 369

def initialize(stdout:, stderr:, color:, analysis_result:)
  @stdout = stdout
  @stderr = stderr
  @color = color
  @analysis_result = analysis_result.to_h.transform_values { |v| v.is_a?(Data) ? v.to_h : v }
  @total_unique_metrics = @analysis_result[:total_unique_metrics]
  @metrics_analysis = @analysis_result[:metrics_analysis]
  @total_possible_custom_metrics = @analysis_result[:total_possible_custom_metrics]
end

Instance Attribute Details

#analysis_resultObject (readonly)

Since:

  • 0.1.0



363
364
365
# File 'lib/datadog/statsd/schema/analyzer.rb', line 363

def analysis_result
  @analysis_result
end

#colorObject (readonly)

Since:

  • 0.1.0



363
364
365
# File 'lib/datadog/statsd/schema/analyzer.rb', line 363

def color
  @color
end

#metrics_analysisObject (readonly)

Since:

  • 0.1.0



363
364
365
# File 'lib/datadog/statsd/schema/analyzer.rb', line 363

def metrics_analysis
  @metrics_analysis
end

#stderrObject (readonly)

Since:

  • 0.1.0



363
364
365
# File 'lib/datadog/statsd/schema/analyzer.rb', line 363

def stderr
  @stderr
end

#stdoutObject (readonly)

Since:

  • 0.1.0



363
364
365
# File 'lib/datadog/statsd/schema/analyzer.rb', line 363

def stdout
  @stdout
end

#total_possible_custom_metricsObject (readonly)

Since:

  • 0.1.0



363
364
365
# File 'lib/datadog/statsd/schema/analyzer.rb', line 363

def total_possible_custom_metrics
  @total_possible_custom_metrics
end

#total_unique_metricsObject (readonly)

Since:

  • 0.1.0



363
364
365
# File 'lib/datadog/statsd/schema/analyzer.rb', line 363

def total_unique_metrics
  @total_unique_metrics
end

Instance Method Details

#renderObject

Raises:

  • (NotImplementedError)

Since:

  • 0.1.0



379
380
381
# File 'lib/datadog/statsd/schema/analyzer.rb', line 379

def render
  raise NotImplementedError, "Subclasses must implement this method"
end