class SidekiqProfilingMiddleware::Util

Constants

BOOTED_AT_FORMAT

Public Class Methods

current_epoch_ms() click to toggle source
# File lib/sidekiq_profiling_middleware/util.rb, line 18
def self.current_epoch_ms
  (Time.now.utc.to_f * 1000).to_i
end
default_output_prefix(name) click to toggle source
# File lib/sidekiq_profiling_middleware/util.rb, line 6
def self.default_output_prefix(name)
  "tmp/#{name}_bootedat#{Time.now.strftime(BOOTED_AT_FORMAT)}_"
end
worker_names() click to toggle source
# File lib/sidekiq_profiling_middleware/util.rb, line 10
def self.worker_names
  # allocate hash for quickly converting class names to
  # nice names a file system would like
  @worker_names ||= Hash.new do |hash, worker_name|
    hash[worker_name] = worker_name.to_s.gsub(/\W+/, "_").gsub(/(^_|_$)/, "")
  end
end