pts-core: A few fixes

This commit is contained in:
Michael Larabel
2024-09-08 05:28:32 -05:00
parent 70843bc7b5
commit 472f45b46f
9 changed files with 30 additions and 15 deletions

View File

@@ -65,9 +65,9 @@ class dump_ob_to_ae_db implements pts_option_interface
continue;
}
if(isset($system_data[$system->get_identifier()]['Processor']) && !phodevi::is_fake_device($system_data[$system->get_identifier()]['Processor']))
if(isset($system_data[$system->get_identifier()]['Processor']) && (!phodevi::is_fake_device($system_data[$system->get_identifier()]['Processor']) || stripos($system_data[$system->get_identifier()]['Processor'], 'AmpereOne') !== false))
{
if(stripos($system_data[$system->get_identifier()]['Processor'], 'ARMv') !== false || stripos($system_data[$system->get_identifier()]['Processor'], 'POWER9') !== false)
if(stripos($system_data[$system->get_identifier()]['Processor'], 'ARMv') !== false || stripos($system_data[$system->get_identifier()]['Processor'], 'POWER9') !== false || stripos($system_data[$system->get_identifier()]['Processor'], 'AmpereOne') !== false)
{
if(($cores = $system->get_cpu_core_count()) != false && $cores > 1 && stripos($system_data[$system->get_identifier()]['Processor'], 'Core') === false)
{

View File

@@ -35,7 +35,7 @@ class pts_basic_display_mode implements pts_display_mode_interface
{
echo PHP_EOL . $msg_string . PHP_EOL;
}
public function test_install_process($test_install_manager)
public function test_install_process(&$test_install_manager)
{
return;
}

View File

@@ -36,6 +36,7 @@ class pts_concise_display_mode implements pts_display_mode_interface
// Test install bits
private $test_install_pos = 0;
private $test_install_count = 0;
private $test_install_manager = null;
// Run bits
protected $expected_trial_run_count = 0;
@@ -58,10 +59,11 @@ class pts_concise_display_mode implements pts_display_mode_interface
return $mb;
}
public function test_install_process($test_install_manager)
public function test_install_process(&$test_install_manager)
{
$this->test_install_pos = 0;
$this->test_install_count = $test_install_manager->tests_to_install_count();
$this->test_install_manager = &$test_install_manager;
echo PHP_EOL;
echo $this->tab . pts_strings::plural_handler($this->test_install_count, 'Test') . ' To Install' . PHP_EOL;
@@ -71,12 +73,11 @@ class pts_concise_display_mode implements pts_display_mode_interface
$cache_total = 0;
$cache_size = 0;
$install_size = 0;
$install_time = 0;
$install_time = $test_install_manager->estimated_install_time_remaining();
foreach($test_install_manager->get_test_run_requests() as $test_run_request)
{
$install_size += $test_run_request->test_profile->get_environment_size();
$install_time += $test_run_request->test_profile->get_estimated_install_time();
foreach($test_run_request->get_download_objects() as $test_file_download)
{
@@ -291,9 +292,12 @@ class pts_concise_display_mode implements pts_display_mode_interface
}
if(($time = $test_install_request->test_profile->get_estimated_install_time()) > 1)
{
echo $this->tab . $this->tab . pts_client::cli_just_bold('Estimated Install Time: ') . pts_strings::format_time($time) . PHP_EOL;
echo $this->tab . $this->tab . pts_client::cli_just_bold('Estimated Test Install Time: ') . pts_strings::format_time($time) . PHP_EOL;
}
if($this->test_install_manager && $this->test_install_manager->tests_to_install_count() > 1 && ($total_time = $this->test_install_manager->estimated_install_time_remaining()) > 1)
{
echo $this->tab . $this->tab . pts_client::cli_just_bold('Total Install Time Remaining: ') . pts_strings::format_time(($total_time + $time)) . PHP_EOL;
}
echo $this->tab . $this->tab . 'Installing Test' . ' @ ' . date('H:i:s') . PHP_EOL;
return;
}

View File

@@ -24,7 +24,7 @@
interface pts_display_mode_interface
{
public function __construct();
public function test_install_process($test_install_manager);
public function test_install_process(&$test_install_manager);
public function test_install_begin($test_install_request);
public function test_install_downloads($test_install_request);
public function test_install_download_file($process, &$pts_test_file_download);

View File

@@ -64,7 +64,7 @@ class pts_web_display_mode implements pts_display_mode_interface
{
return;
}
public function test_install_process($test_install_manager)
public function test_install_process(&$test_install_manager)
{
$this->test_install_pos = 0;
$this->test_install_count = $test_install_manager->tests_to_install_count();

View File

@@ -131,7 +131,7 @@ class pts_websocket_display_mode implements pts_display_mode_interface
// LATEST RESULT
$this->web_socket_respond($j);
}
public function test_install_process($test_install_manager)
public function test_install_process(&$test_install_manager)
{
$this->test_install_pos = 0;
$this->test_install_count = $test_install_manager->tests_to_install_count();

View File

@@ -3,8 +3,8 @@
/*
Phoronix Test Suite
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
Copyright (C) 2010 - 2018, Phoronix Media
Copyright (C) 2010 - 2018, Michael Larabel
Copyright (C) 2010 - 2024, Phoronix Media
Copyright (C) 2010 - 2024, Michael Larabel
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -168,6 +168,16 @@ class pts_test_install_manager
{
return count($this->tests_to_install) > 0 ? array_shift($this->tests_to_install) : false;
}
public function estimated_install_time_remaining()
{
$install_time = 0;
foreach($this->tests_to_install as &$test_run_request)
{
$install_time += $test_run_request->test_profile->get_estimated_install_time();
}
return $install_time;
}
public static function download_cache_locations()
{
static $cache_directories = null;

View File

@@ -1385,7 +1385,8 @@ class pts_result_file_output
{
// On AMD product strings, trip the XX-Core from string to save space...
// Similarly some "APU with Radeon" text also chop off
if(($cc = strpos($component, $cutoff)) !== false)
// Except if only one space in string it's likely significant to include "-Core" or so...
if(($cc = strpos($component, $cutoff)) !== false && strpos($component, ' ') != strrpos($component, ' '))
{
$component = substr($component, 0, $cc);
$component = substr($component, 0, strrpos($component, ' '));

View File

@@ -39,7 +39,7 @@ class pts_result_viewer_embed
$this->result_file = &$result_file;
$this->result_public_id = $public_id;
$this->show_result_sidebar = !defined('PHOROMATIC_SERVER_WEB_INTERFACE');
$this->print_html_immediately = defined('OPENBENCHMARKING_BUILD') || (defined('RESULT_VIEWER_VERSION') && RESULT_VIEWER_VERSION > 2);
$this->print_html_immediately = (defined('OPENBENCHMARKING_BUILD') || (defined('RESULT_VIEWER_VERSION') && RESULT_VIEWER_VERSION > 2)) && !isset($_REQUEST['export']);
if(isset($_SERVER['REQUEST_URI']) && !empty($_SERVER['REQUEST_URI']))
{