Sha256: 322a00257b7d0cd2f3360c81284a04b1396b085afdc3557aeed61173886f9fd6

Contents?: true

Size: 420 Bytes

Versions: 3

Compression:

Stored size: 420 Bytes

Contents

# Copyright 2013 Google Inc. All Rights Reserved.
# Licensed under the Apache License, Version 2.0, found in the LICENSE file.

class Rack::AllocationStats::Formatters::JSON < Rack::AllocationStats::Formatters::Base
  def format
    allocations = @allocations.to_a.map do |group_key, allocations|
      { group_key: group_key, allocations: allocations }
    end

    return [Yajl::Encoder.encode(allocations)]
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rack-allocation_stats-0.1.2 lib/rack/allocation_stats/formatters/json.rb
rack-allocation_stats-0.1.1 ./lib/rack/allocation_stats/formatters/json.rb
rack-allocation_stats-0.1.0 ./lib/rack/allocation_stats/formatters/json.rb