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 needs to be sub-classed and, respectively, an instance method parse or a class method convert supplied. This way, a specific format can even function as both input and output format.

Defined Under Namespace

Modules: Util, Version Classes: Formats, 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.formats[:in].sort
end

#output_formatsObject



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

def output_formats
  Formats.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.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.valid_format?(:out, format)
end