Class: Source::Iptraffic

Inherits:
Source
  • Object
show all
Includes:
Helpers
Defined in:
lib/source/iptraffic.rb

Overview

Generic IP Traffic Collector. i Assumes sieste-style metadata in the form address, bytes: [tx,rx], collection_point: [datacenter], ip: [IPv4,IPv6]

Constant Summary

Constants included from Helpers

Helpers::REDIS_KEY

Instance Method Summary collapse

Methods included from Helpers

#data_sanitize, #delete_metrics_cache, #get_json, #init_lib, #init_source, #init_store, #interpolate, #is_up?, #json_metrics, #json_metrics_list, #keysplit, #mandatory_param, #optional_param, #origin_settings, #redis_conn, #top_tail_pad

Instance Method Details

#titleize(keys) ⇒ Object

Use the useful parts of the metadata as the title


7
8
9
10
11
12
13
14
15
16
# File 'lib/source/iptraffic.rb', line 7

def titleize keys 
	nice = []
	nice << keys["ip"]
	nice << case keys["bytes"]
	when "rx"; " bytes received"
	when "tx"; " bytes transmitted"
		else keys["bytes"]
	end
	return URI.decode(nice.join(" - "))
end