Class: ScoutApm::Serializers::PayloadSerializer

Inherits:
Object
  • Object
show all
Defined in:
lib/scout_apm/serializers/payload_serializer.rb

Class Method Summary collapse

Class Method Details

.deserialize(data) ⇒ Object



22
23
24
# File 'lib/scout_apm/serializers/payload_serializer.rb', line 22

def self.deserialize(data)
  Marshal.load(data)
end

.serialize(metadata, metrics, slow_transactions, jobs, slow_jobs) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/scout_apm/serializers/payload_serializer.rb', line 5

def self.serialize(, metrics, slow_transactions, jobs, slow_jobs)
  if ScoutApm::Agent.instance.config.value("report_format") == 'json'
    ScoutApm::Serializers::PayloadSerializerToJson.serialize(, metrics, slow_transactions, jobs, slow_jobs)
  else
     = .dup
    .default = nil

    metrics = metrics.dup
    metrics.default = nil
    Marshal.dump(:metadata          => ,
                 :metrics           => metrics,
                 :slow_transactions => slow_transactions,
                 :jobs              => jobs,
                 :slow_jobs         => slow_jobs)
  end
end