Class: ScoutApm::Serializers::HistogramsSerializerToJson
- Inherits:
-
Object
- Object
- ScoutApm::Serializers::HistogramsSerializerToJson
- Defined in:
- lib/scout_apm/serializers/histograms_serializer_to_json.rb
Instance Attribute Summary collapse
-
#histograms ⇒ Object
readonly
Returns the value of attribute histograms.
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(histograms) ⇒ HistogramsSerializerToJson
constructor
A new instance of HistogramsSerializerToJson.
Constructor Details
#initialize(histograms) ⇒ HistogramsSerializerToJson
Returns a new instance of HistogramsSerializerToJson.
7 8 9 |
# File 'lib/scout_apm/serializers/histograms_serializer_to_json.rb', line 7 def initialize(histograms) @histograms = histograms end |
Instance Attribute Details
#histograms ⇒ Object (readonly)
Returns the value of attribute histograms.
5 6 7 |
# File 'lib/scout_apm/serializers/histograms_serializer_to_json.rb', line 5 def histograms @histograms end |
Instance Method Details
#as_json ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/scout_apm/serializers/histograms_serializer_to_json.rb', line 11 def as_json histograms.map do |histo| { "name" => histo.name, "histogram" => histo.histogram.as_json, } end end |