From b1f366f2b764654d0dd1460369531e420b8b988c Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 16 Jan 2015 00:20:27 +0000 Subject: [PATCH] admin: reduce bytecode overhead of get_stats This is a deprecated call anyways and no longer supported by modern versions of the server, so avoid wasting RAM with it. We will remove this in 4.x --- lib/mogilefs/admin.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/mogilefs/admin.rb b/lib/mogilefs/admin.rb index eeff6bd..68574ca 100644 --- a/lib/mogilefs/admin.rb +++ b/lib/mogilefs/admin.rb @@ -120,6 +120,7 @@ class MogileFS::Admin < MogileFS::Client # # *** This command no longer works with recent versions of MogileFS *** # *** Use mogstats(1) from the MogileFS::Utils package on CPAN *** + # *** We will remove this method in 4.x *** # # admin.get_stats # @@ -148,9 +149,9 @@ class MogileFS::Admin < MogileFS::Client } end - stats.delete 'device' if stats['device'].empty? - stats.delete 'file' if stats['file'].empty? - stats.delete 'replication' if stats['replication'].empty? + %w(device file replication).each do |s| + stats.delete(s) if stats[s].empty? + end stats end -- 2.11.4.GIT