5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/scout_apm/serializers/payload_serializer.rb', line 5
def self.serialize(metadata, metrics, slow_transactions, jobs, slow_jobs, histograms, db_query_metrics, external_service_metrics, traces)
if ScoutApm::Agent.instance.context.config.value("report_format") == 'json'
ScoutApm::Serializers::PayloadSerializerToJson.serialize(metadata, metrics, slow_transactions, jobs, slow_jobs, histograms, db_query_metrics, external_service_metrics, traces)
else
metadata = metadata.dup
metadata.default = nil
metrics = metrics.dup
metrics.default = nil
Marshal.dump(:metadata => metadata,
:metrics => metrics,
:slow_transactions => slow_transactions,
:jobs => jobs,
:slow_jobs => slow_jobs,
:histograms => HistogramsSerializerToJson.new(histograms).as_json,
:db_query_metrics => db_query_metrics,
:external_service_metrics => external_service_metrics)
end
end
|