Class: TCellAgent::SensorEvents::ServerAgentPackagesSensorEvent
- Inherits:
-
TCellSensorEvent
- Object
- Hash
- TCellSensorEvent
- TCellAgent::SensorEvents::ServerAgentPackagesSensorEvent
- Includes:
- ModuleLoggerAccess
- Defined in:
- lib/tcell_agent/sensor_events/server_agent.rb
Instance Attribute Summary
Attributes inherited from TCellSensorEvent
Instance Method Summary collapse
-
#initialize ⇒ ServerAgentPackagesSensorEvent
constructor
A new instance of ServerAgentPackagesSensorEvent.
Methods included from ModuleLoggerAccess
Methods inherited from TCellSensorEvent
#bucket_key, #calculate_offset
Constructor Details
#initialize ⇒ ServerAgentPackagesSensorEvent
Returns a new instance of ServerAgentPackagesSensorEvent.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/tcell_agent/sensor_events/server_agent.rb', line 13 def initialize super('server_agent_packages') @flush = true @ensure = true packages = [] Gem.loaded_specs.values.map do |x| begin if x.name package = { 'n' => x.name, 'v' => x.version.version } packages.push(package) module_logger.debug("Adding packages #{x.name}") end rescue StandardError => e module_logger.error("Exception adding package: #{e.}") module_logger.exception(e) end end self['packages'] = packages end |