Class: AppProfiler::VernierProfile

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

Constant Summary collapse

FILE_EXTENSION =
".vernier.json"
BACKEND_NAME =
:vernier

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) ⇒ VernierProfile

Returns a new instance of VernierProfile.



15
16
17
18
# File 'lib/app_profiler/vernier_profile.rb', line 15

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

Class Method Details

.backend_nameObject



9
10
11
12
# File 'lib/app_profiler/vernier_profile.rb', line 9

def backend_name
  # cannot reference Backend::VernierBackend because of different ruby versions we have to support
  BACKEND_NAME.to_s
end

Instance Method Details

#formatObject



28
29
30
# File 'lib/app_profiler/vernier_profile.rb', line 28

def format
  FILE_EXTENSION
end

#metadataObject



24
25
26
# File 'lib/app_profiler/vernier_profile.rb', line 24

def 
  @data[:meta]
end

#modeObject



20
21
22
# File 'lib/app_profiler/vernier_profile.rb', line 20

def mode
  @data[:meta][:mode]
end

#view(params = {}) ⇒ Object



32
33
34
# File 'lib/app_profiler/vernier_profile.rb', line 32

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