Module: LogStash::Util::DurationFormatter

Defined in:
lib/logstash/util/duration_formatter.rb

Constant Summary collapse

CHRONIC_OPTIONS =
{ :format => :short }

Class Method Summary collapse

Class Method Details

.human_format(duration) ⇒ String

Take a duration in milliseconds and transform it into a format that a human can understand. This is currently used by the API.

Parameters:

  • Duration (Integer)

    in milliseconds

Returns:

  • (String)

    Duration in human format



12
13
14
# File 'lib/logstash/util/duration_formatter.rb', line 12

def self.human_format(duration)
  ChronicDuration.output(duration / 1000, CHRONIC_OPTIONS)
end