Sha256: c1fd385d69c3621a05bc0c656f5672e7911170bd409e1eeb688466132ee81568

Contents?: true

Size: 939 Bytes

Versions: 5

Compression:

Stored size: 939 Bytes

Contents

require "vmstat"
require_relative "../base"

module AppPerfAgent
  module Plugin
    module System
      class Disk < AppPerfAgent::Plugin::Base
        def call
          disks = Vmstat.snapshot.disks
          disks.flat_map {|disk|
            [
              ["system.disk.used_bytes",       disk.used_bytes,      { "origin" => disk.origin, "type" => disk.type, "mount" => disk.mount }],
              ["system.disk.free_bytes",       disk.free_bytes,      { "origin" => disk.origin, "type" => disk.type, "mount" => disk.mount }],
              ["system.disk.available_bytes",  disk.available_bytes, { "origin" => disk.origin, "type" => disk.type, "mount" => disk.mount }],
              ["system.disk.total_bytes",      disk.total_bytes,     { "origin" => disk.origin, "type" => disk.type, "mount" => disk.mount }]
            ]
          }
        end
      end
    end
  end
end

AppPerfAgent.logger.info "Loading Disk monitoring."

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
app_perf_agent-0.0.9 lib/app_perf_agent/plugin/system/disk.rb
app_perf_agent-0.0.8 lib/app_perf_agent/plugin/system/disk.rb
app_perf_agent-0.0.7 lib/app_perf_agent/plugin/system/disk.rb
app_perf_agent-0.0.6 lib/app_perf_agent/plugin/system/disk.rb
app_perf_agent-0.0.5 lib/app_perf_agent/plugin/system/disk.rb