Module: StackifyRubyAPM::Util
- Defined in:
- lib/stackify_apm/util.rb,
lib/stackify_apm/util/inflector.rb,
lib/stackify_apm/util/inspector.rb,
lib/stackify_apm/util/lru_cache.rb,
lib/stackify_apm/util/trace_log_watcher.rb
Overview
rubocop:disable all
Defined Under Namespace
Modules: Inflector, TraceLogWatcher Classes: Inspector, LruCache
Class Method Summary collapse
- .host_os ⇒ Object private
- .micros(target = Time.now.utc) ⇒ Object private
-
.pushToAryIndex(ary, idx, val) ⇒ Object
private
Push the element to existing array of object with incremented index(key/value pair) We get the prepared statement values [‘J.K. Rowling’, ‘Harry Potter’, …] and restructure it.
Class Method Details
.host_os ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/stackify_apm/util.rb', line 11 def self.host_os host_os = RbConfig::CONFIG['host_os'] case host_os when /cygwin|mswin|mingw|bccwin|wince|emx/i 'WINDOWS' when /linux|arch/i 'LINUX' when /sunos|solaris/i 'SOLARIS' when /bsd/i 'BSD' when /darwin/i 'MAC OS X' else "UNKNOWN #{host_os}" end end |
.micros(target = Time.now.utc) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
7 8 9 |
# File 'lib/stackify_apm/util.rb', line 7 def self.micros(target = Time.now.utc) target.to_i * 1_000_000 + target.usec end |
.pushToAryIndex(ary, idx, val) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Push the element to existing array of object with incremented index(key/value pair) We get the prepared statement values [‘J.K. Rowling’, ‘Harry Potter’, …] and restructure it. Example structured: [‘J.K. Rowling’,‘Harry Potter’, …, ‘other data’]
32 33 34 35 36 37 |
# File 'lib/stackify_apm/util.rb', line 32 def self.pushToAryIndex(ary, idx, val) obj = {} i = idx + 1 obj[i] = val.to_s ary.push(obj) end |