本文整理汇总了PHP中phodevi类的典型用法代码示例。如果您正苦于以下问题:PHP phodevi类的具体用法?PHP phodevi怎么用?PHP phodevi使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了phodevi类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($new_values = null)
{
if (PTS_IS_DAEMONIZED_SERVER_PROCESS || is_file('/etc/phoronix-test-suite.xml') && is_writable('/etc/phoronix-test-suite.xml')) {
$file = '/etc/phoronix-test-suite.xml';
} else {
if (PTS_IS_CLIENT && is_file(pts_config::get_config_file_location())) {
$file = pts_config::get_config_file_location();
} else {
if (PTS_USER_PATH . 'user-config.xml' != pts_config::get_config_file_location() && is_file(PTS_USER_PATH . 'user-config.xml')) {
$file = PTS_USER_PATH . 'user-config.xml';
} else {
if (PTS_IS_CLIENT && is_file($t = PTS_CORE_STATIC_PATH . phodevi::read_property('system', 'vendor-identifier') . '-user-config-template.xml')) {
$file = $t;
} else {
if (is_file(PTS_CORE_STATIC_PATH . 'user-config-template.xml')) {
$file = PTS_CORE_STATIC_PATH . 'user-config-template.xml';
} else {
if (is_file(PTS_CORE_STATIC_PATH . 'user-config-defaults.xml')) {
$file = PTS_CORE_STATIC_PATH . 'user-config-defaults.xml';
} else {
$file = null;
}
}
}
}
}
}
$this->override_values = is_array($new_values) ? $new_values : false;
parent::__construct($file);
}
开发者ID:ShaolongHu,项目名称:phoronix-test-suite,代码行数:30,代码来源:pts_config_nye_XmlReader.php
示例2: run
public static function run($r)
{
define('PHOROMATIC_PROCESS', true);
$commands = array('detailed_system_info' => null, 'list_available_tests' => null, 'list_available_suites' => null, 'info' => array('pts/all'), 'clone_openbenchmarking_result' => array('1107247-LI-MESACOMMI48', '1509040-HA-GCCINTELS17', '1508201-HA-GTX95073337', '1508233-HA-INTELSKYL16'), 'refresh_graphs' => array('1107247-LI-MESACOMMI48'), 'result_file_to_text' => array('1107247-LI-MESACOMMI48'), 'merge_results' => array('1107247-LI-MESACOMMI48', '1509040-HA-GCCINTELS17', '1508201-HA-GTX95073337', '1508233-HA-INTELSKYL16'), 'diagnostics' => null, 'dump_possible_options' => null, 'debug_render_test' => null);
$individual_times = array();
phodevi::clear_cache();
$start = microtime(true);
foreach ($commands as $command => $args) {
echo PHP_EOL . '### ' . $command . ' ###' . PHP_EOL;
$individual_times[$command] = array();
for ($i = 0; $i < 3; $i++) {
$c_start = microtime(true);
pts_client::execute_command($command, $args);
$c_finish = microtime(true);
$individual_times[$command][] = $c_finish - $c_start;
}
}
$finish = microtime(true);
echo PHP_EOL . PHP_EOL . '### OVERALL DATA ###' . PHP_EOL . PHP_EOL;
echo 'PHP: ' . PTS_PHP_VERSION . PHP_EOL;
$longest_c = max(array_map('strlen', array_keys($individual_times)));
foreach ($individual_times as $component => $times) {
echo strtoupper($component) . ': ' . str_repeat(' ', $longest_c - strlen($component)) . pts_math::set_precision(round(array_sum($times) / count($times), 3), 3) . ' seconds' . PHP_EOL;
}
echo PHP_EOL . 'TOTAL ELAPSED TIME: ' . str_repeat(' ', $longest_c - strlen('ELAPSED TIME')) . round($finish - $start, 3) . ' seconds';
echo PHP_EOL . 'PEAK MEMORY USAGE: ' . str_repeat(' ', $longest_c - strlen('PEAK MEMORY USAGE')) . round(memory_get_peak_usage(true) / 1048576, 3) . ' MB';
echo PHP_EOL . 'PEAK MEMORY USAGE EMALLOC: ' . str_repeat(' ', $longest_c - strlen('PEAK MEMORY USAGE (emalloc)')) . round(memory_get_peak_usage() / 1048576, 3) . ' MB';
echo PHP_EOL;
}
开发者ID:pacificIT,项目名称:phoronix-test-suite,代码行数:29,代码来源:debug_self_test.php
示例3: run
public static function run($r)
{
$commands = array('detailed_system_info' => null, 'list_available_tests' => null, 'list_available_suites' => null, 'info' => array('xonotic'), 'clone_openbenchmarking_result' => array('1107247-LI-MESACOMMI48'), 'result_file_to_text' => array('1107247-LI-MESACOMMI48'), 'diagnostics' => null, 'dump_possible_options' => null);
$individual_times = array();
phodevi::clear_cache();
$start = microtime(true);
foreach ($commands as $command => $args) {
echo PHP_EOL . '### ' . $command . ' ###' . PHP_EOL;
$individual_times[$command] = array();
for ($i = 0; $i < 3; $i++) {
$c_start = microtime(true);
pts_client::execute_command($command, $args);
$c_finish = microtime(true);
array_push($individual_times[$command], $c_finish - $c_start);
}
}
$finish = microtime(true);
echo PHP_EOL . PHP_EOL . '### OVERALL DATA ###' . PHP_EOL . PHP_EOL;
echo 'PHP: ' . PTS_PHP_VERSION . PHP_EOL;
$longest_c = max(array_map('strlen', array_keys($individual_times)));
foreach ($individual_times as $component => $times) {
echo strtoupper($component) . ': ' . str_repeat(' ', $longest_c - strlen($component)) . pts_math::set_precision(round(array_sum($times) / count($times), 3), 3) . ' seconds' . PHP_EOL;
}
echo PHP_EOL . 'ELAPSED TIME: ' . str_repeat(' ', $longest_c - strlen('ELAPSED TIME')) . round($finish - $start, 3) . ' seconds';
echo PHP_EOL . 'PEAK MEMORY USAGE: ' . str_repeat(' ', $longest_c - strlen('PEAK MEMORY USAGE')) . round(memory_get_peak_usage(true) / 1048576, 3) . ' MB';
echo PHP_EOL . 'PEAK MEMORY USAGE (emalloc): ' . str_repeat(' ', $longest_c - strlen('PEAK MEMORY USAGE (emalloc)')) . round(memory_get_peak_usage() / 1048576, 3) . ' MB';
echo PHP_EOL;
}
开发者ID:pchiruma,项目名称:phoronix-test-suite,代码行数:28,代码来源:debug_self_test.php
示例4: run
public static function run($r)
{
pts_client::$display->generic_heading('Available Tests');
$test_count = 0;
foreach (pts_openbenchmarking::available_tests(false) as $identifier) {
$repo = substr($identifier, 0, strpos($identifier, '/'));
$id = substr($identifier, strlen($repo) + 1);
$repo_index = pts_openbenchmarking::read_repository_index($repo);
if (!in_array(phodevi::operating_system(), $repo_index['tests'][$id]['supported_platforms']) || empty($repo_index['tests'][$id]['title'])) {
// Don't show unsupported tests
continue;
}
echo sprintf('%-30ls - %-35ls %-9ls', $identifier, $repo_index['tests'][$id]['title'], $repo_index['tests'][$id]['test_type']) . PHP_EOL;
$test_count++;
}
foreach (pts_file_io::glob(PTS_TEST_PROFILE_PATH . 'local/*/test-definition.xml') as $path) {
$test_profile = new pts_test_profile('local/' . basename(dirname($path)));
if ($test_profile->get_title() != null && $test_profile->is_supported(false)) {
echo sprintf('%-30ls - %-35ls %-9ls', $test_profile->get_identifier(), $test_profile->get_title(), $test_profile->get_test_hardware_type()) . PHP_EOL;
$test_count++;
}
}
if ($test_count == 0) {
echo PHP_EOL . 'No tests found. Please check that you have Internet connectivity to download test profile data from OpenBenchmarking.org. The Phoronix Test Suite has documentation on configuring the network setup, proxy settings, and PHP network options. Please contact Phoronix Media if you continuing to experience problems.' . PHP_EOL . PHP_EOL;
}
}
开发者ID:ShaolongHu,项目名称:phoronix-test-suite,代码行数:26,代码来源:list_available_tests.php
示例5: generate_download_object_list
public function generate_download_object_list($do_file_checks = true)
{
$download_xml_file = $this->test_profile->get_file_download_spec();
if ($download_xml_file != null) {
$xml_parser = new pts_test_downloads_nye_XmlReader($download_xml_file);
$package_url = $xml_parser->getXMLArrayValues('PhoronixTestSuite/Downloads/Package/URL');
$package_md5 = $xml_parser->getXMLArrayValues('PhoronixTestSuite/Downloads/Package/MD5');
$package_sha256 = $xml_parser->getXMLArrayValues('PhoronixTestSuite/Downloads/Package/SHA256');
$package_filename = $xml_parser->getXMLArrayValues('PhoronixTestSuite/Downloads/Package/FileName');
$package_filesize = $xml_parser->getXMLArrayValues('PhoronixTestSuite/Downloads/Package/FileSize');
$package_platform = $xml_parser->getXMLArrayValues('PhoronixTestSuite/Downloads/Package/PlatformSpecific');
$package_architecture = $xml_parser->getXMLArrayValues('PhoronixTestSuite/Downloads/Package/ArchitectureSpecific');
foreach (array_keys($package_url) as $i) {
if (!empty($package_platform[$i]) && $do_file_checks) {
$platforms = pts_strings::comma_explode($package_platform[$i]);
if (!in_array(phodevi::operating_system(), $platforms) && !(phodevi::is_bsd() && in_array('Linux', $platforms) && (pts_client::executable_in_path('kldstat') && strpos(shell_exec('kldstat -n linux 2>&1'), 'linux.ko') != false))) {
// This download does not match the operating system
continue;
}
}
if (!empty($package_architecture[$i]) && $do_file_checks) {
$architectures = pts_strings::comma_explode($package_architecture[$i]);
if (phodevi::cpu_arch_compatible($architectures) == false) {
// This download does not match the CPU architecture
continue;
}
}
$this->test_files[] = new pts_test_file_download($package_url[$i], $package_filename[$i], $package_filesize[$i], $package_md5[$i], $package_sha256[$i], $package_platform[$i], $package_architecture[$i]);
}
}
}
开发者ID:pacificIT,项目名称:phoronix-test-suite,代码行数:31,代码来源:pts_test_install_request.php
示例6: network_device_string
public static function network_device_string()
{
$network = array();
if (phodevi::is_macosx()) {
// TODO: implement
} else {
if (phodevi::is_bsd()) {
foreach (array('dev.em.0.%desc', 'dev.wpi.0.%desc', 'dev.mskc.0.%desc') as $controller) {
$pci = phodevi_bsd_parser::read_sysctl($controller);
if (!empty($pci)) {
array_push($network, $pci);
}
}
} else {
if (phodevi::is_windows()) {
// TODO: implement
} else {
if (phodevi::is_linux()) {
foreach (array('Ethernet controller', 'Network controller') as $controller) {
$pci = phodevi_linux_parser::read_pci($controller);
if (!empty($pci)) {
array_push($network, $pci);
}
}
}
}
}
}
return implode(' + ', $network);
}
开发者ID:ShaolongHu,项目名称:phoronix-test-suite,代码行数:30,代码来源:phodevi_network.php
示例7: init_files
public static function init_files()
{
// Don't let the process run multiple times...
if (pts_config::$init_process_ran) {
return false;
}
pts_config::$init_process_ran = true;
// The main PTS user client config
pts_config::user_config_generate();
// Generate the graph config
$json_pre = null;
if (is_file(PTS_USER_PATH . 'graph-config.json')) {
$json_pre = file_get_contents(PTS_USER_PATH . 'graph-config.json');
} else {
if (PTS_IS_CLIENT && is_file($t = PTS_CORE_STATIC_PATH . 'graph-config-template-' . phodevi::read_property('system', 'vendor-identifier') . '.json')) {
$json_pre = file_get_contents($t);
} else {
if (is_file(PTS_CORE_STATIC_PATH . 'graph-config-template.json')) {
$json_pre = file_get_contents(PTS_CORE_STATIC_PATH . 'graph-config-template.json');
}
}
}
$json_graph = array();
pts_Graph::set_default_graph_values($json_graph);
if ($json_pre != null) {
$json_pre = json_decode($json_pre, true);
if (is_array($json_pre)) {
$json_graph = array_merge($json_graph, $json_pre);
}
}
pts_Graph::init_graph_config($json_graph);
file_put_contents(PTS_USER_PATH . 'graph-config.json', pts_arrays::json_encode_pretty_string($json_graph));
}
开发者ID:rkingsbury,项目名称:phoronix-test-suite,代码行数:33,代码来源:pts_config.php
示例8: __construct
public function __construct($identifier = null)
{
$this->struct = array('external-dependencies' => array('name' => null, 'package_manager' => null, 'aliases' => array(), 'packages' => array()));
if (PTS_IS_CLIENT) {
$xml = PTS_EXDEP_PATH . 'xml/' . $identifier . '-packages.xml';
$xml_parser = new nye_XmlReader($xml);
$this->struct['external-dependencies']['name'] = $xml_parser->getXMLValue('PhoronixTestSuite/ExternalDependencies/Information/Name');
$this->struct['external-dependencies']['package_manager'] = $xml_parser->getXMLValue('PhoronixTestSuite/ExternalDependencies/Information/PackageManager');
$generic_package = $xml_parser->getXMLArrayValues('PhoronixTestSuite/ExternalDependencies/Package/GenericName');
$distro_package = $xml_parser->getXMLArrayValues('PhoronixTestSuite/ExternalDependencies/Package/PackageName');
$file_check = $xml_parser->getXMLArrayValues('PhoronixTestSuite/ExternalDependencies/Package/FileCheck');
$arch_specific = $xml_parser->getXMLArrayValues('PhoronixTestSuite/ExternalDependencies/Package/ArchitectureSpecific');
$os_version_specific = $xml_parser->getXMLArrayValues('PhoronixTestSuite/ExternalDependencies/Package/VersionSpecific');
$os_version = phodevi::read_property('system', 'os-version');
foreach (array_keys($generic_package) as $i) {
if (empty($generic_package[$i])) {
continue;
}
$os_version_compliant = empty($os_version_specific[$i]) || in_array($os_version, pts_strings::comma_explode($os_version_specific[$i]));
if ($os_version_compliant == false) {
continue;
}
$this->struct['external-dependencies']['packages'][$generic_package[$i]] = $this->get_package_format($distro_package[$i], $file_check[$i], $arch_specific[$i]);
}
$aliases = $xml_parser->getXMLValue('PhoronixTestSuite/ExternalDependencies/Information/Aliases');
if ($aliases != null) {
$aliases = pts_strings::trim_explode(',', $aliases);
foreach ($aliases as $alias) {
if ($alias != null) {
$this->struct['external-dependencies']['aliases'][] = $alias;
}
}
}
}
}
开发者ID:pacificIT,项目名称:phoronix-test-suite,代码行数:35,代码来源:pts_exdep_platform_parser.php
示例9: mem_usage
private function mem_usage()
{
if (phodevi::is_linux()) {
return self::mem_usage_linux();
} elseif (phodevi::is_macosx() || phodevi::is_bsd()) {
return self::mem_usage_bsd('MEMORY', 'USED');
}
}
开发者ID:ptzafrir,项目名称:phoronix-test-suite,代码行数:8,代码来源:memory_usage.php
示例10: read_sensor
public function read_sensor()
{
$fan_speed = -1;
if (phodevi::is_linux()) {
$fan_speed = $this->sys_fanspeed_linux();
}
return $fan_speed;
}
开发者ID:ShaolongHu,项目名称:phoronix-test-suite,代码行数:8,代码来源:sys_fanspeed.php
示例11: read_sensor
public function read_sensor()
{
if (phodevi::is_linux()) {
return $this->cpu_power_linux();
}
return -1;
// TODO make -1 a named constant
}
开发者ID:ShaolongHu,项目名称:phoronix-test-suite,代码行数:8,代码来源:cpu_power.php
示例12: read_sensor
public function read_sensor()
{
$write_speed = -1;
if (phodevi::is_linux()) {
$write_speed = $this->hdd_write_speed_linux();
}
return pts_math::set_precision($write_speed, 2);
}
开发者ID:ShaolongHu,项目名称:phoronix-test-suite,代码行数:8,代码来源:hdd_write_speed.php
示例13: read_sensor
public function read_sensor()
{
$temp = -1;
if (phodevi::is_linux()) {
$temp = $this->hdd_temp_linux();
}
return pts_math::set_precision($temp, 2);
}
开发者ID:numerant,项目名称:phoronix-test-suite,代码行数:8,代码来源:hdd_temp.php
示例14: read_sensor
public function read_sensor()
{
$net_speed = -1;
if (phodevi::is_bsd() || phodevi::is_macosx()) {
$net_speed = $this->network_usage_bsd();
}
return pts_math::set_precision($net_speed, 2);
}
开发者ID:numerant,项目名称:phoronix-test-suite,代码行数:8,代码来源:network_usage.php
示例15: read_sensor
public function read_sensor()
{
$swap_usage = -1;
if (phodevi::is_linux()) {
$swap_usage = self::swap_usage_linux();
}
return $swap_usage;
}
开发者ID:numerant,项目名称:phoronix-test-suite,代码行数:8,代码来源:swap_usage.php
示例16: read_sensor
public function read_sensor()
{
$voltage = -1;
if (phodevi::is_linux()) {
$voltage = $this->cpu_voltage_linux();
}
return $voltage;
}
开发者ID:ptzafrir,项目名称:phoronix-test-suite,代码行数:8,代码来源:cpu_voltage.php
示例17: read_sensor
public function read_sensor()
{
$iowait = -1;
if (phodevi::is_linux()) {
$iowait = $this->sys_iowait_linux();
}
return $iowait;
}
开发者ID:ShaolongHu,项目名称:phoronix-test-suite,代码行数:8,代码来源:sys_iowait.php
示例18: read_sensor
public static function read_sensor()
{
// Read the processor temperature
$temp_c = -1;
if (phodevi::is_bsd()) {
$cpu_temp = phodevi_bsd_parser::read_sysctl(array('hw.sensors.acpi_tz0.temp0', 'dev.cpu.0.temperature', 'hw.sensors.cpu0.temp0'));
if ($cpu_temp != false) {
if (($end = strpos($cpu_temp, 'degC')) || ($end = strpos($cpu_temp, 'C')) > 0) {
$cpu_temp = substr($cpu_temp, 0, $end);
}
if (is_numeric($cpu_temp)) {
$temp_c = $cpu_temp;
}
} else {
$acpi = phodevi_bsd_parser::read_sysctl('hw.acpi.thermal.tz0.temperature');
if (($end = strpos($acpi, 'C')) > 0) {
$acpi = substr($acpi, 0, $end);
}
if (is_numeric($acpi)) {
$temp_c = $acpi;
}
}
} else {
if (phodevi::is_linux()) {
// Try hwmon interface
$raw_temp = phodevi_linux_parser::read_sysfs_node('/sys/class/hwmon/hwmon*/device/temp1_input', 'POSITIVE_NUMERIC', array('name' => 'coretemp'));
if ($raw_temp == -1) {
$raw_temp = phodevi_linux_parser::read_sysfs_node('/sys/class/hwmon/hwmon*/device/temp1_input', 'POSITIVE_NUMERIC', array('name' => 'k10temp'));
}
if ($raw_temp == -1) {
// Try ACPI thermal
// Assuming the system thermal sensor comes 2nd to the ACPI CPU temperature
// It appears that way on a ThinkPad T60, but TODO find a better way to validate
$raw_temp = phodevi_linux_parser::read_sysfs_node('/sys/class/thermal/thermal_zone*/temp', 'POSITIVE_NUMERIC', null, 2);
}
if ($raw_temp != -1) {
if ($raw_temp > 1000) {
$raw_temp = $raw_temp / 1000;
}
$temp_c = pts_math::set_precision($raw_temp, 2);
}
if ($temp_c == -1) {
// Try LM_Sensors
$sensors = phodevi_linux_parser::read_sensors(array('CPU Temp', 'Core 0', 'Core0 Temp', 'Core1 Temp'));
if ($sensors != false && is_numeric($sensors) && $sensors > 0) {
$temp_c = $sensors;
}
}
if (pts_client::executable_in_path('ipmitool')) {
$ipmi = phodevi_linux_parser::read_ipmitool_sensor('Temp 0');
if ($ipmi > 0 && is_numeric($ipmi)) {
$temp_c = $ipmi;
}
}
}
}
return $temp_c;
}
开发者ID:rkingsbury,项目名称:phoronix-test-suite,代码行数:58,代码来源:cpu_temp.php
示例19: read_sensor
public static function read_sensor()
{
if (phodevi::is_linux()) {
$sensor = phodevi_linux_parser::read_sensors(array('V5', '+5V'));
} else {
$sensor = -1;
}
return $sensor;
}
开发者ID:rkingsbury,项目名称:phoronix-test-suite,代码行数:9,代码来源:sys_v5.php
示例20: needs_updated_install
public function needs_updated_install()
{
foreach (pts_types::identifiers_to_test_profile_objects($this->get_identifier(), false, true) as $test_profile) {
if ($test_profile->test_installation == false || $test_profile->test_installation->get_installed_system_identifier() != phodevi::system_id_string() || pts_c::$test_flags & pts_c::force_install) {
return true;
}
}
return false;
}
开发者ID:pchiruma,项目名称:phoronix-test-suite,代码行数:9,代码来源:pts_test_suite.php
注:本文中的phodevi类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论