Module: Athena

Extended by:
Athena
Included in:
Athena
Defined in:
lib/athena.rb,
lib/athena.rb

Overview

Athena is a library to convert (mainly) prometheus database files to various output formats. It’s accompanied by a corresponding script that gives access to all its converting features.

In order to support additional input and/or output formats, Athena::Formats::Base needs to be sub-classed and, respectively, an instance method parse or an instance method convert supplied. This way, a specific format can even function as both input and output format.

Defined Under Namespace

Modules: Formats, Util, Version Classes: Parser, Record

Constant Summary collapse

VERSION =
to_s

Instance Method Summary collapse

Instance Method Details

#deferred_output?(format) ⇒ Boolean

Returns:

  • (Boolean)


71
72
73
# File 'lib/athena.rb', line 71

def deferred_output?(format)
  Formats[:out, format].deferred?
end

#input_formatsObject



55
56
57
# File 'lib/athena.rb', line 55

def input_formats
  Formats::Base.formats[:in].sort
end

#output_formatsObject



63
64
65
# File 'lib/athena.rb', line 63

def output_formats
  Formats::Base.formats[:out].sort
end

#parser(config, format) ⇒ Object



51
52
53
# File 'lib/athena.rb', line 51

def parser(config, format)
  Parser.new(config, format)
end

#valid_input_format?(format) ⇒ Boolean

Returns:

  • (Boolean)


59
60
61
# File 'lib/athena.rb', line 59

def valid_input_format?(format)
  Formats::Base.valid_format?(:in, format)
end

#valid_output_format?(format) ⇒ Boolean

Returns:

  • (Boolean)


67
68
69
# File 'lib/athena.rb', line 67

def valid_output_format?(format)
  Formats::Base.valid_format?(:out, format)
end

#with_format(format, &block) ⇒ Object



75
76
77
# File 'lib/athena.rb', line 75

def with_format(format, &block)
  Formats[:out, format].wrap(&block)
end