NAME
Linux::Info::SysInfo::CPU - Collects CPU information from /proc/cpuinfo
VERSION
version 2.17
SYNOPSIS
Don't create a instance of this class, you will be able to do it only with subclasses from it.
See Linux::Info::SysInfo methods to retrieve a instance of subclass from the default "proc/cpuinfo" file.
DESCRIPTION
This class provides an abstraction of general attributes a processor used by Linux has.
It also defines an expected interface for subclasses, with methods that need to be override in order to avoid an error with Carp confess.
METHODS
processor_regex
Returns a regular expression that identifies the processor that is being read.
This is used to identify which subclasses will be required to parse the file content.
get_cores
Returns an integer with the number of cores available in the processor.
get_threads
Returns an integer with the number of hyper threads available in the processor.
has_flag
Expects as parameter a string with the name of the flag.
Return "true" (1) or "false" (0) if the processor has that specific flag associated.
get_flags
Returns all flags related to the processor as a array reference.
new
Creates and return a new instance of this class.
Expects as parameter a single string as the path to an alternate file instead of using the default /proc/cpuinfo. This is must useful for unit testing and is not required.
get_arch
Returns a integer representing if the process is 32 or 64 bits.
get_bogomips
Returns a decimal number representing the bogomips of the processor.
get_model
Returns a string with the CPU model.
get_source_file
Returns the actual location of the cpuinfo read to create a instance of this class.
get_vendor
Returns a string of the processor vendor.
SEE ALSO
AUTHOR
Alceu Rodrigues de Freitas Junior <glasswalk3r@yahoo.com.br>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2015 by Alceu Rodrigues de Freitas Junior.
This is free software, licensed under:
The GNU General Public License, Version 3, June 2007