def usage_report(node)
      period_start = node.at('period_start')
      period_end = node.at('period_end')

      { :metric        => node['metric'].to_s.strip,
        :period        => node['period'].to_s.strip.to_sym,
        :period_start  => period_start ? period_start.content : '',
        :period_end    => period_end ? period_end.content : '',
        :current_value => node.at('current_value').content.to_i,
        :max_value     => node.at('max_value').content.to_i }
    end
def usage_report(node)
      period_start = node.at('period_start')
      period_end = node.at('period_end')

      { :metric        => node['metric'].to_s.strip,
        :period        => node['period'].to_s.strip.to_sym,
        :period_start  => period_start ? period_start.content : '',
        :period_end    => period_end ? period_end.content : '',
        :current_value => node.at('current_value').content.to_i,
        :max_value     => node.at('max_value').content.to_i }
    end
It can be a user usage report or an app usage report