Class: Tiler::Widgets::Metric
- Inherits:
-
Tiler::Widget
- Object
- Tiler::Widget
- Tiler::Widgets::Metric
- Defined in:
- lib/tiler/widgets/metric.rb
Instance Attribute Summary
Attributes inherited from Tiler::Widget
Class Method Summary collapse
-
.example_config ⇒ Object
Defer to Tiler::Widget#empty? — empty when no data_source AND no preview.
- .example_payload ⇒ Object
- .example_preview ⇒ Object
Methods inherited from Tiler::Widget
#data, #empty?, #initialize, #label, #partial, #query_class, supports_color_config?, supports_palette_config?
Constructor Details
This class inherits a constructor from Tiler::Widget
Class Method Details
.example_config ⇒ Object
Defer to Tiler::Widget#empty? — empty when no data_source AND no preview.
30 31 32 33 |
# File 'lib/tiler/widgets/metric.rb', line 30 def self.example_config { "aggregation" => "avg", "value_column" => "duration", "time_window" => "24h", "suffix" => "ms" } end |
.example_payload ⇒ Object
35 36 37 |
# File 'lib/tiler/widgets/metric.rb', line 35 def self.example_payload { "status" => "ok", "duration" => 142.3 } end |
.example_preview ⇒ Object
39 40 41 42 43 |
# File 'lib/tiler/widgets/metric.rb', line 39 def self.example_preview { "value" => 142, "label" => "Sample metric", "prefix" => "", "suffix" => "ms", "aggregation" => "avg", "time_window" => "24h" } end |