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

#duration, #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
19
# File 'lib/app_profiler/vernier_profile.rb', line 15

def initialize(data, id: nil, context: nil)
  data[:meta] ||= {}
  data[:meta][:vernierUserMetadata] ||= {}
  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



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

def format
  FILE_EXTENSION
end

#metadataObject



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

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

#modeObject



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

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

#view(params = {}) ⇒ Object



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

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