projects / phoronix-test-suite.git / commitdiff
Build Results
 
Summary

Description: Unnamed repository; edit this file to name it for gitweb.
Last Change: Wed 2/3/10 13:04

Recent Commits
Time
Signed-Off By
Description
Commit Diff
Wed 2/3/10 13:04
Michael Larabel  
phoromatic: Add... 
Wed 2/3/10 12:38
Michael Larabel  
phoromatic: Add... 
Wed 2/3/10 12:27
Michael Larabel  
phoromatic: Add... 
Wed 2/3/10 9:26
Michael Larabel  
pts: Drop MD5 hashes in... 
Tue 2/2/10 23:43
Michael Larabel  
phoromatic: Add... 
Tue 2/2/10 23:35
Michael Larabel  
pts-core: Phoromatic... 
 
> --git a/CHANGE-LOG b/CHANGE-LOG
index 1ad14b2
..0b7dc6c 100644
--- a/CHANGE-LOG
+++ b/CHANGE-LOG
@@ -22,+22,@@ Phoronix Test Suite (Git)
 - 
pts-coreAdd PTS External Dependencies support for Optware
 
pts-coreAdd yasm to PTS External Dependencies
 
pts-coreSupport using PHPs cURL library for handling downloads when available
+- pts-coreCalculate download speeds for each test file downloadto provide estimations on future downloads for how long it may take to download
 
phodeviSplit out phodevi_parser module into phodevi_linux_parserphodevi_osx_parser, and phodevi_solaris_parser for OS-specific functions
 
phodeviAvoid situations of the manufacturer/vendor string being repeated in the motherboard property
 
phodeviAdd device notes and special settings string functionality to API
diff 
--git a/pts-core/library/pts-functions_assignments.php b/pts-core/library/pts-functions_assignments.php
index 0925c9c
..06cba27 100644
--- a/pts-core/library/pts-functions_assignments.php
+++ b/pts-core/library/pts-functions_assignments.php
@@ -33,+33,13 @@ function pts_read_assignment($assignment)
 {
     return 
pts_assignment_manager::read($assignment);
 }
+function 
pts_read_and_clear_assignment($assignment)
+{
+    
$read pts_assignment_manager::read($assignment);
+    
pts_assignment_manager::clear($assignment);
+
+    return 
$read;
+}
 function 
pts_is_assignment($assignment)
 {
     return 
pts_assignment_manager::is_set($assignment);
diff --git a/pts-core/library/pts-functions_tests.php b/pts-core/library/pts-functions_tests.php
index 3ab3e2d
..68192de 100644
--- a/pts-core/library/pts-functions_tests.php
+++ b/pts-core/library/pts-functions_tests.php
@@ -457,12 +457,12 @@ function pts_suite_identifier_to_name($identifier)

     return 
$cache[$identifier];
 }
-function 
pts_estimated_download_size($identifier)
+function 
pts_estimated_download_size($identifier$divider 1048576)
 {
     
// Estimate the size of files to be downloaded
     
static $cache;

-    if(
is_array($identifier) || !isset($cache[$identifier]))
+    if(
is_array($identifier) || !isset($cache[$identifier][$divider]))
     {
         
$estimated_size 0;

@@ -
471,17 +471,19 @@ function pts_estimated_download_size($identifier)
             
// The work for calculating the download size in 1.4.0+
             
foreach(pts_objects_test_downloads($test) as $download_object)
             {
-                
$estimated_size += pts_trim_double($download_object->get_filesize() / 1048576);
+                
$estimated_size += $download_object->get_filesize();
             }
         }

+        
$estimated_size pts_trim_double($estimated_size $divider);
+
         if(!
is_array($identifier))
         {
-            
$cache[$identifier] = $estimated_size;
+            
$cache[$identifier][$divider] = $estimated_size;
         }
     }

-    return 
is_array($identifier) ? $estimated_size $cache[$identifier];
+    return 
is_array($identifier) ? $estimated_size $cache[$identifier][$divider];
 }
 function 
pts_estimated_environment_size($identifier)
 {
diff --git a/pts-core/library/pts-includes-install.php b/pts-core/library/pts-includes-install.php
index f1379bb
..fd80b25 100644
--- a/pts-core/library/pts-includes-install.php
+++ b/pts-core/library/pts-includes-install.php
@@ -69,+69,@@ function pts_start_install($to_install, &$display_mode)
         
"\nEstimated Install Size: " pts_estimated_environment_size($tests) . " MB");
     }
     
pts_set_assignment("TEST_INSTALL_COUNT"$install_count);
+    
pts_set_assignment("DOWNLOAD_AVG_COUNT"pts_storage_object::read_from_file(PTS_CORE_STORAGE"download_average_count"));
+    
pts_set_assignment("DOWNLOAD_AVG_SPEED"pts_storage_object::read_from_file(PTS_CORE_STORAGE"download_average_speed"));

     
pts_module_process("__pre_install_process"$tests);
     
$failed_installs = array();
@@ -
79,+81,@@ function pts_start_install($to_install, &$display_mode)
     }
     
pts_module_process("__post_install_process"$tests);

+    
pts_storage_object::set_in_file(PTS_CORE_STORAGE"download_average_count"pts_read_and_clear_assignment("DOWNLOAD_AVG_COUNT"));
+    
pts_storage_object::set_in_file(PTS_CORE_STORAGE"download_average_speed"pts_read_and_clear_assignment("DOWNLOAD_AVG_SPEED"));
+
     if(!
pts_is_assignment("SILENCE_MESSAGES") && count($failed_installs) > && count($tests) > 1)
     {
         echo 
"\nThe following tests failed to install:\n\n";
@@ -
235,+240,@@ function pts_download_test_files($identifier, &$display_mode)
                         }

                         
$display_mode->test_install_download_file($download_package"DOWNLOAD");
+                        
$download_start time();
                         echo 
pts_download($url$download_destination_temp);
+                        
$download_end time();

                         if(!
pts_validate_md5_download_file($download_destination_temp$package_md5))
                         {
@@ -
274,+281,24 @@ function pts_download_test_files($identifier, &$display_mode)
                             }
                             
$file_downloaded true;
                             
$fail_count 0;
+
+                            if((
$download_size $download_package->get_filesize()) > 0)
+                            {
+                                
$download_speed floor($download_size / ($download_end $download_start)); // bytes per second
+
+                                if((
$c_s pts_read_assignment("DOWNLOAD_AVG_SPEED")) && ($c_c pts_read_assignment("DOWNLOAD_AVG_COUNT")))
+                                {
+                                    
$avg_speed floor((($c_s $c_c) + $download_speed) / ($c_c 1));
+
+                                    
pts_set_assignment("DOWNLOAD_AVG_SPEED"$avg_speed);
+                                    
pts_set_assignment("DOWNLOAD_AVG_COUNT", ($c_c 1));
+                                }
+                                else
+                                {
+                                    
pts_set_assignment("DOWNLOAD_AVG_SPEED"$download_speed);
+                                    
pts_set_assignment("DOWNLOAD_AVG_COUNT"1);
+                                }
+                            }
                         }

                         if(!
$try_again)
diff --git a/pts-core/objects/display_modes/pts_concise_display_mode.php b/pts-core/objects/display_modes/pts_concise_display_mode.php
index 96437cb
..3e8d244 100644
--- a/pts-core/objects/display_modes/pts_concise_display_mode.php
+++ b/pts-core/objects/display_modes/pts_concise_display_mode.php
@@ -51,+51,18 @@ class pts_concise_display_mode implements pts_display_mode_interface
     
{
         echo 
"\t\t" count($download_packages) . " File" . (isset($download_packages[1]) ? "s" "") . " Needed";

-        if((
$size pts_estimated_download_size($identifier)) > 0)
+        if((
$size pts_estimated_download_size($identifier1048576)) > 0)
         {
             echo 
" / " $size " MB";
+
+            
/*
+            // TODO: the below code is currently disabled as this size is taking into account download caches, etc. Need to take that out of there otherwise number is overinflated.
+            if(($avg_speed = pts_read_assignment("DOWNLOAD_AVG_SPEED")) > 0)
+            {
+                $avg_time = ($size * 1048576) / $avg_speed;
+                echo " / " . pts_format_time_string($avg_time, "SECONDS", true, 60);
+            }
+            */
         
}

         echo 
"\n";
@@ -
61,+70,@@ class pts_concise_display_mode implements pts_display_mode_interface
     
public function test_install_download_file(&$pts_test_file_download$process)
     {
         echo 
"\t\t" $pts_test_file_download->get_filename() . ": ";
+        
$expected_time 0;

         switch(
$process)
         {
@@ -
75,10 +85,17 @@ class pts_concise_display_mode implements pts_display_mode_interface
                 
break;
             case 
"DOWNLOAD":
                 echo 
"Downloading";
+
+                if((
$avg_speed pts_read_assignment("DOWNLOAD_AVG_SPEED")) > && ($this_size $pts_test_file_download->get_filesize()) > 0)
+                {
+                    
$expected_time $this_size $avg_speed;
+                }
                 break;
         }

-        echo 
" [" pts_trim_double($pts_test_file_download->get_filesize() / 10485761) . "MB]\n";
+        
$expected_time is_numeric($expected_time) && $expected_time pts_format_time_string($expected_time"SECONDS"false60) : null;
+
+        echo 
" [" pts_trim_double($pts_test_file_download->get_filesize() / 10485761) . "MB" . ($expected_time != null " / ~" $expected_time null) . "]\n";
     }
     public function 
test_install_process($identifier)
     {
diff --git a/pts/test-resources/x264/install.sh b/pts/test-resources/x264/install.sh
index 0807e7d
..8c91c70 100755
--- a/pts/test-resources/x264/install.sh
+++ b/pts/test-resources/x264/install.sh
@@ -12,+12,@@ cd ..
 
rm -rf x264-snapshot-20091118-2245/

 echo 
"#!/bin/sh
-./x264_/bin/x264 -o /dev/null soccer_4cif.y4m > \$LOG_FILE 2>&1
+./x264_/bin/x264 -o /dev/null --threads \$NUM_CPU_CORES soccer_4cif.y4m > \$LOG_FILE 2>&1
 echo \$? > ~/test-exit-status" 
x264
 chmod 
+ 
Phoronix.com
Linux Driver Forums
Copyright © 2010 by Phoronix Media