Class: ScoutApm::Serializers::DbQuerySerializerToJson
- Inherits:
-
Object
- Object
- ScoutApm::Serializers::DbQuerySerializerToJson
- Defined in:
- lib/scout_apm/serializers/db_query_serializer_to_json.rb
Instance Attribute Summary collapse
-
#db_query_metrics ⇒ Object
readonly
Returns the value of attribute db_query_metrics.
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(db_query_metrics) ⇒ DbQuerySerializerToJson
constructor
A new instance of DbQuerySerializerToJson.
Constructor Details
#initialize(db_query_metrics) ⇒ DbQuerySerializerToJson
Returns a new instance of DbQuerySerializerToJson.
6 7 8 |
# File 'lib/scout_apm/serializers/db_query_serializer_to_json.rb', line 6 def initialize(db_query_metrics) @db_query_metrics = db_query_metrics end |
Instance Attribute Details
#db_query_metrics ⇒ Object (readonly)
Returns the value of attribute db_query_metrics.
4 5 6 |
# File 'lib/scout_apm/serializers/db_query_serializer_to_json.rb', line 4 def db_query_metrics @db_query_metrics end |
Instance Method Details
#as_json ⇒ Object
10 11 12 |
# File 'lib/scout_apm/serializers/db_query_serializer_to_json.rb', line 10 def as_json db_query_metrics.map{|metric| metric.as_json } end |