Sha256: 7851e03ae9b4aa25d3d781ba33624867639922319a1e823ff477d7ecf2724b79

Contents?: true

Size: 1.2 KB

Versions: 1

Compression:

Stored size: 1.2 KB

Contents

require 'vmstat'
require_relative "../base"

module AppPerfAgent
  module Plugin
    module System
      class Memory < AppPerfAgent::Plugin::Base
        def call
          memory = Vmstat.memory
          [
            [
              AppPerfAgent::Types::MEMORY,
              "system.memory.free_bytes",
              "Memory (Free)",
              memory.free_bytes
            ],
            [
              AppPerfAgent::Types::MEMORY,
              "system.memory.inactive_bytes",
              "Memory (Inactive)",
              memory.inactive_bytes
            ],
            [
              AppPerfAgent::Types::MEMORY,
              "system.memory.active_bytes",
              "Memory (Active)",
              memory.active_bytes
            ],
            [
              AppPerfAgent::Types::MEMORY,
              "system.memory.wired_bytes",
              "Memory (Wired)",
              memory.wired_bytes
            ],
            [
              AppPerfAgent::Types::MEMORY,
              "system.memory.total_bytes",
              "Memory (Total)",
              memory.total_bytes
            ]
          ]
        end
      end
    end
  end
end

AppPerfAgent.logger.info "Loading Memory monitoring."

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
app_perf_agent-0.0.4 lib/app_perf_agent/plugin/system/memory.rb