Sha256: d70c063a5f8a4e642ad756a5c69ef0c081d5d8db7861beb2d029ac54d9891624

Contents?: true

Size: 553 Bytes

Versions: 5

Compression:

Stored size: 553 Bytes

Contents

require "vmstat"
require_relative "../base"

module AppPerfAgent
  module Plugin
    module System
      class Network < AppPerfAgent::Plugin::Base
        def call
          inets = Vmstat.ethernet_devices
          inets.flat_map {|inet|
            [
              ["system.network.in_bytes", inet.in_bytes, { "name" => inet.name.to_s }],
              ["system.network.out_bytes", inet.out_bytes, { "name" => inet.name.to_s }]
            ]
          }
        end
      end
    end
  end
end

AppPerfAgent.logger.info "Loading Network 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/network.rb
app_perf_agent-0.0.8 lib/app_perf_agent/plugin/system/network.rb
app_perf_agent-0.0.7 lib/app_perf_agent/plugin/system/network.rb
app_perf_agent-0.0.6 lib/app_perf_agent/plugin/system/network.rb
app_perf_agent-0.0.5 lib/app_perf_agent/plugin/system/network.rb