Skip to content

Commit

Permalink
Merge pull request #14 from bdewater/puma-master-stats
Browse files Browse the repository at this point in the history
Compatibility with Puma master
  • Loading branch information
yob committed May 8, 2020
2 parents aae9319 + f1064b2 commit 46a3706
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/puma/plugin/statsd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,12 @@ def register_hooks
end

def fetch_stats
JSON.parse(Puma.stats, symbolize_names: true)
stats = Puma.stats
if stats.is_a?(Hash)
stats
else
JSON.parse(stats, symbolize_names: true)
end
end

def tags
Expand Down

0 comments on commit 46a3706

Please sign in to comment.