当前位置: 首页>>代码示例>>PHP>>正文


PHP pts_openbenchmarking::clone_openbenchmarking_result方法代码示例

本文整理汇总了PHP中pts_openbenchmarking::clone_openbenchmarking_result方法的典型用法代码示例。如果您正苦于以下问题:PHP pts_openbenchmarking::clone_openbenchmarking_result方法的具体用法?PHP pts_openbenchmarking::clone_openbenchmarking_result怎么用?PHP pts_openbenchmarking::clone_openbenchmarking_result使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pts_openbenchmarking的用法示例。


在下文中一共展示了pts_openbenchmarking::clone_openbenchmarking_result方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: run

 public static function run($args)
 {
     $result_files = array();
     foreach ($args as $id) {
         $xml = pts_openbenchmarking::clone_openbenchmarking_result($id, true);
         array_push($result_files, new pts_result_file($xml));
     }
     $writer = new pts_result_file_writer(null);
     pts_merge::merge_test_results_process($writer, $result_files);
     pts_client::save_test_result($args[0] . '/composite.xml', $writer->get_xml(), true);
     echo PHP_EOL . 'Result Saved To: ' . PTS_SAVE_RESULTS_PATH . $args[0] . '/composite.xml' . PHP_EOL;
 }
开发者ID:pchiruma,项目名称:phoronix-test-suite,代码行数:12,代码来源:clone_openbenchmarking_result.php

示例2: run

 public static function run($args)
 {
     $result_files = array();
     foreach ($args as $id) {
         $xml = pts_openbenchmarking::clone_openbenchmarking_result($id, true);
         if ($xml) {
             $result_file = new pts_result_file($xml);
             pts_client::save_test_result($id . '/composite.xml', $result_file->get_xml(), true);
             echo PHP_EOL . 'Result Saved To: ' . PTS_SAVE_RESULTS_PATH . $id . '/composite.xml' . PHP_EOL;
         }
     }
 }
开发者ID:ShaolongHu,项目名称:phoronix-test-suite,代码行数:12,代码来源:clone_openbenchmarking_result.php

示例3: run

 public static function run($r)
 {
     $compare_tests = array();
     $compare_subsystems = array();
     foreach ($r as $test_object) {
         $test_object = pts_types::identifier_to_object($test_object);
         if ($test_object instanceof pts_test_profile) {
             array_push($compare_tests, $test_object->get_identifier(false));
             if (!isset($compare_subsystems[$test_object->get_test_hardware_type()])) {
                 $compare_subsystems[$test_object->get_test_hardware_type()] = 1;
             } else {
                 $compare_subsystems[$test_object->get_test_hardware_type()] += 1;
             }
         }
     }
     if (empty($compare_tests)) {
         $subsystem_under_test = pts_user_io::prompt_text_menu('Sub-System To Test', array('Processor', 'Graphics', 'Disk'));
     } else {
         arsort($compare_subsystems);
         $compare_subsystems = array_keys($compare_subsystems);
         $subsystem_under_test = array_shift($compare_subsystems);
     }
     $system_info = array_merge(phodevi::system_hardware(false), phodevi::system_software(false));
     $to_include = array();
     $to_exclude = array();
     if (isset($system_info[$subsystem_under_test])) {
         $compare_component = $system_info[$subsystem_under_test];
     } else {
         return;
     }
     switch ($subsystem_under_test) {
         case 'Processor':
             self::system_component_to_format($system_info, $to_include, array('OS', 'Compiler', 'Kernel', 'Motherboard'), true);
             break;
         case 'Graphics':
             self::system_component_to_format($system_info, $to_include, array('OS', 'Display Driver', 'OpenGL', 'Processor', 'Kernel', 'Desktop'), true);
             break;
         case 'OS':
             self::system_component_to_format($system_info, $to_include, array('Processor', 'Motherboard', 'Graphics', 'Disk'), true);
             self::system_component_to_format($system_info, $to_exclude, array('OS'));
             break;
         case 'Disk':
             self::system_component_to_format($system_info, $to_include, array('Processor', 'OS', 'Chipset', 'Motherboard', 'Kernel'), true);
             break;
     }
     $payload = array('subsystem_under_test' => $subsystem_under_test, 'component_under_test' => $compare_component, 'include_components' => implode(',', $to_include), 'exclude_components' => implode(',', $to_exclude), 'include_tests' => implode(',', $compare_tests));
     echo PHP_EOL . 'Querying test data from OpenBenchmarking.org...' . PHP_EOL;
     $json = pts_openbenchmarking::make_openbenchmarking_request('auto_generate_comparison', $payload);
     $json = json_decode($json, true);
     if (isset($json['auto_compare']['public_ids']) && isset($json['auto_compare']['count']) && $json['auto_compare']['count'] > 0) {
         echo 'Found ' . $json['auto_compare']['count'] . ' comparable results on OpenBenchmarking.org with a ' . $json['auto_compare']['accuracy'] . '% accuracy.' . PHP_EOL;
         $compare_results = array();
         foreach ($json['auto_compare']['public_ids'] as $public_id) {
             $result_xml = pts_openbenchmarking::clone_openbenchmarking_result($public_id, true);
             if ($result_xml) {
                 $result_file = new pts_result_file($result_xml);
                 $result_objects = $result_file->get_result_objects();
                 foreach ($result_objects as $i => &$result_object) {
                     if (!empty($compare_tests)) {
                         if (!in_array($result_object->test_profile->get_identifier(false), $compare_tests)) {
                             unset($result_objects[$i]);
                         }
                     } else {
                         if ($result_object->test_profile->get_test_hardware_type() != $subsystem_under_test) {
                             unset($result_objects[$i]);
                         }
                     }
                 }
                 if (count($result_objects) == 0) {
                     continue;
                 }
                 $result_file->override_result_objects($result_objects);
                 array_push($compare_results, $result_file);
             }
         }
         if (count($compare_results) > 0) {
             $result_xml = pts_merge::merge_test_results_array($compare_results);
             if (count($compare_results) > 2) {
                 $result_file = new pts_result_file($result_xml);
                 $result_objects = $result_file->get_result_objects();
                 $system_count = $result_file->get_system_count();
                 $result_count = count($result_objects);
                 $result_match_count = array();
                 if ($result_count > 3) {
                     foreach ($result_objects as $i => &$result_object) {
                         $result_match_count[$i] = $result_object->test_result_buffer->get_count();
                     }
                     arsort($result_match_count);
                     $biggest_size = pts_arrays::first_element($result_match_count);
                     if ($biggest_size == $system_count || $biggest_size > 3) {
                         foreach ($result_match_count as $key => $value) {
                             if ($value < 2) {
                                 unset($result_objects[$key]);
                             }
                         }
                     }
                     $result_file->override_result_objects($result_objects);
                     $result_xml = pts_merge::merge_test_results_array(array($result_file));
                 }
             }
//.........这里部分代码省略.........
开发者ID:pchiruma,项目名称:phoronix-test-suite,代码行数:101,代码来源:auto_compare.php

示例4: identifiers_to_objects

 public static function identifiers_to_objects($identifiers, &$archive_unknown_objects = false)
 {
     // Provide an array containing the location(s) of all test(s) for the supplied object name
     $objects = array();
     foreach (pts_arrays::to_array($identifiers) as $identifier_item) {
         if ($identifier_item instanceof pts_test_profile || $identifier_item instanceof pts_test_suite || $identifier_item instanceof pts_result_file) {
             array_push($objects, $identifier_item);
         } else {
             if (PTS_IS_CLIENT && $identifier_item instanceof pts_virtual_test_queue) {
                 // Object is a virtual suite
                 array_push($objects, $identifier_item);
             } else {
                 if ($tp_identifier = pts_test_profile::is_test_profile($identifier_item)) {
                     // Object is a test
                     array_push($objects, new pts_test_profile($tp_identifier));
                 } else {
                     if (pts_test_suite::is_suite($identifier_item)) {
                         // Object is a suite
                         array_push($objects, new pts_test_suite($identifier_item));
                     } else {
                         if (pts_result_file::is_test_result_file($identifier_item)) {
                             // Object is a saved results file
                             array_push($objects, new pts_result_file($identifier_item));
                         } else {
                             if (pts_openbenchmarking::is_openbenchmarking_result_id($identifier_item)) {
                                 // Object is an OpenBenchmarking.org result
                                 // Clone it locally so it's just handled like a pts_result_file
                                 $success = pts_openbenchmarking::clone_openbenchmarking_result($identifier_item);
                                 if ($success) {
                                     array_push($objects, new pts_result_file($identifier_item));
                                 }
                             } else {
                                 if (PTS_IS_CLIENT && pts_virtual_test_suite::is_virtual_suite($identifier_item)) {
                                     // Object is a virtual suite
                                     array_push($objects, new pts_virtual_test_suite($identifier_item));
                                 } else {
                                     if (pts_suite_nye_XmlReader::is_temporary_suite($identifier_item)) {
                                         // Object is a suite
                                         array_push($objects, new pts_test_suite($identifier_item));
                                     } else {
                                         if (is_array($archive_unknown_objects)) {
                                             // Unknown / nothing / broken
                                             array_push($archive_unknown_objects, $identifier_item);
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     return $objects;
 }
开发者ID:ShaolongHu,项目名称:phoronix-test-suite,代码行数:55,代码来源:pts_types.php


注:本文中的pts_openbenchmarking::clone_openbenchmarking_result方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。