Class: AppProfiler::StackprofProfile

Inherits:
BaseProfile show all
Defined in:
lib/app_profiler/stackprof_profile.rb

Constant Summary collapse

FILE_EXTENSION =
".stackprof.json"

Instance Attribute Summary

Attributes inherited from BaseProfile

#context

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseProfile

#enqueue_upload, #file, from_stackprof, from_vernier, #id, #to_h, #upload, #valid?

Constructor Details

#initialize(data, id: nil, context: nil) ⇒ StackprofProfile

Returns a new instance of StackprofProfile.



13
14
15
16
# File 'lib/app_profiler/stackprof_profile.rb', line 13

def initialize(data, id: nil, context: nil)
  data[:metadata] ||= {}
  super(data, id: id, context: context)
end

Class Method Details

.backend_nameObject



8
9
10
# File 'lib/app_profiler/stackprof_profile.rb', line 8

def backend_name
  Backend::StackprofBackend.name.to_s
end

Instance Method Details

#formatObject



26
27
28
# File 'lib/app_profiler/stackprof_profile.rb', line 26

def format
  FILE_EXTENSION
end

#metadataObject



22
23
24
# File 'lib/app_profiler/stackprof_profile.rb', line 22

def 
  @data[:metadata]
end

#modeObject



18
19
20
# File 'lib/app_profiler/stackprof_profile.rb', line 18

def mode
  @data[:mode]
end

#view(params = {}) ⇒ Object



30
31
32
# File 'lib/app_profiler/stackprof_profile.rb', line 30

def view(params = {})
  AppProfiler.stackprof_viewer.view(self, **params)
end