mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
parent
f5cf122f3b
commit
d54c66a8dd
3 changed files with 6 additions and 7 deletions
|
@ -7,11 +7,10 @@ module LogStash::Api::AppHelpers
|
|||
as = options.fetch(:as, :json)
|
||||
pretty = params.has_key?("pretty")
|
||||
|
||||
unless options.include?(:exclude_default_metadata)
|
||||
data = default_metadata.merge(data)
|
||||
end
|
||||
|
||||
if as == :json
|
||||
unless options.include?(:exclude_default_metadata)
|
||||
data = default_metadata.merge(data)
|
||||
end
|
||||
content_type "application/json"
|
||||
LogStash::Json.dump(data, {:pretty => pretty})
|
||||
else
|
||||
|
|
|
@ -62,7 +62,7 @@ module LogStash
|
|||
end
|
||||
|
||||
def to_s
|
||||
hash = to_hash
|
||||
hash = to_hash[:hot_threads]
|
||||
report = "#{I18n.t("logstash.web_api.hot_threads.title", :hostname => hash[:hostname], :time => hash[:time], :top_count => @thread_dump.top_count )} \n"
|
||||
report << '=' * 80
|
||||
report << "\n"
|
||||
|
@ -98,7 +98,7 @@ module LogStash
|
|||
thread[:traces] = traces unless traces.empty?
|
||||
hash[:threads] << thread
|
||||
end
|
||||
hash
|
||||
{ :hot_threads => hash }
|
||||
end
|
||||
|
||||
def cpu_time_as_percent(hash)
|
||||
|
|
|
@ -35,7 +35,7 @@ module LogStash
|
|||
options[:threads] = params["threads"].to_i if params.has_key?("threads")
|
||||
|
||||
as = options[:human] ? :string : :json
|
||||
respond_with({:hot_threads => node.hot_threads(options)}, {:as => as})
|
||||
respond_with(node.hot_threads(options), {:as => as})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue