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


PHP pts_arrays::unique_push方法代码示例

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


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

示例1: run

 public static function run($r)
 {
     $to_run = array();
     foreach (pts_types::identifiers_to_test_profile_objects($r, false, true) as $test_profile) {
         pts_arrays::unique_push($to_run, $test_profile);
     }
     pts_test_run_manager::standard_run($to_run);
 }
开发者ID:pchiruma,项目名称:phoronix-test-suite,代码行数:8,代码来源:run_tests_in_suite.php

示例2: __construct

 public function __construct($result_file)
 {
     $result_object = null;
     parent::__construct($result_object, $result_file);
     // System Identifiers
     if ($result_file->is_multi_way_comparison()) {
         // Multi way comparisons currently render the overview graph as blank
         $this->skip_graph = true;
         return;
     }
     $this->system_identifiers = $result_file->get_system_identifiers();
     if (count($this->system_identifiers) < 2) {
         // No point in generating this when there is only one identifier
         $this->skip_graph = true;
         return;
     }
     $result_objects = array();
     $test_titles = array();
     foreach ($result_file->get_result_objects() as $result_object) {
         if ($result_object->test_profile->get_display_format() == 'BAR_GRAPH') {
             array_push($result_objects, $result_object);
             array_push($test_titles, $result_object->test_profile->get_title());
             foreach ($result_object->test_result_buffer->buffer_items as &$buffer_item) {
                 pts_arrays::unique_push($this->graph_identifiers, $buffer_item->get_result_identifier());
             }
         }
     }
     $result_object_count = count($result_objects);
     if ($result_object_count < 3) {
         // No point in generating this if there aren't many tests
         $this->skip_graph = true;
         return;
     }
     $result_file->override_result_objects($result_objects);
     // Test Titles
     $this->i['identifier_size'] = 6.5;
     $this->i['graph_width'] = 1000;
     list($longest_title_width, $longest_title_height) = pts_svg_dom::estimate_text_dimensions(pts_strings::find_longest_string($test_titles), $this->i['identifier_size']);
     $this->i['left_start'] += 20;
     $this->graphs_per_row = min(count($this->system_identifiers) > 10 ? 6 : 10, floor(($this->i['graph_width'] - $this->i['left_start'] - $this->i['left_end_right']) / ($longest_title_width + 4)));
     $this->graph_item_width = floor(($this->i['graph_width'] - $this->i['left_start'] - $this->i['left_end_right']) / $this->graphs_per_row);
     $this->graph_row_count = ceil($result_object_count / $this->graphs_per_row);
     $this->i['top_start'] += 20 + count($this->system_identifiers) / 3 * $this->i['identifier_size'];
     $height = $this->i['top_start'] + $this->graph_row_count * ($this->graph_row_height + 15);
     $this->graph_title = $result_file->get_title();
     $this->graph_y_title = null;
     $this->i['graph_proportion'] = 'HIB';
     $this->i['show_background_lines'] = true;
     $this->update_graph_dimensions($this->i['graph_width'], $height, true);
     $this->result_file = $result_file;
     return true;
 }
开发者ID:ptzafrir,项目名称:phoronix-test-suite,代码行数:52,代码来源:pts_OverviewGraph.php

示例3: add_test_profile

 public function add_test_profile($test_profile)
 {
     $added = false;
     if (($e = pts_client::read_env('SKIP_TESTS')) != false && (in_array($test_profile->get_identifier(false), pts_strings::comma_explode($e)) || in_array($test_profile->get_identifier(true), pts_strings::comma_explode($e)))) {
         //pts_client::$display->test_install_error($test_profile->get_identifier() . ' is being skipped from installation.');
     } else {
         if (($e = pts_client::read_env('SKIP_TESTING_SUBSYSTEMS')) != false && in_array(strtolower($test_profile->get_test_hardware_type()), pts_strings::comma_explode(strtolower($e)))) {
             //pts_client::$display->test_install_error($test_profile->get_identifier() . ' is being skipped from installation.');
         } else {
             $added = pts_arrays::unique_push($this->tests_to_install, new pts_test_install_request($test_profile));
         }
     }
     return $added;
 }
开发者ID:numerant,项目名称:phoronix-test-suite,代码行数:14,代码来源:pts_test_install_manager.php

示例4: __pre_run_process

 public static function __pre_run_process(&$test_run_manager)
 {
     self::$result_identifier = $test_run_manager->get_results_identifier();
     self::$individual_monitoring = pts_module::read_variable('MONITOR_INDIVIDUAL') !== '0';
     self::$to_monitor = array();
     $to_show = pts_strings::comma_explode(pts_module::read_variable('MONITOR'));
     if (pts_module::read_variable('PERFORMANCE_PER_WATT')) {
         // We need to ensure the system power consumption is being tracked to get performance-per-Watt
         pts_arrays::unique_push($to_show, 'sys.power');
         self::$individual_monitoring = true;
         echo PHP_EOL . 'To Provide Performance-Per-Watt Outputs.' . PHP_EOL;
     }
     $monitor_all = in_array('all', $to_show);
     foreach (phodevi::supported_sensors() as $sensor) {
         if ($monitor_all || in_array(phodevi::sensor_identifier($sensor), $to_show) || in_array('all.' . $sensor[0], $to_show)) {
             array_push(self::$to_monitor, $sensor);
             pts_module::save_file('logs/' . phodevi::sensor_identifier($sensor));
         }
     }
     if (in_array('i915_energy', $to_show) && is_readable('/sys/kernel/debug/dri/0/i915_energy')) {
         // For now the Intel monitoring is a special case separate from the rest
         // of the unified sensor monitoring since we're not polling it every time but just pre/post test.
         self::$monitor_i915_energy = true;
     }
     if (count(self::$to_monitor) > 0) {
         echo PHP_EOL . 'Sensors To Be Logged:';
         foreach (self::$to_monitor as &$sensor) {
             echo PHP_EOL . '   - ' . phodevi::sensor_name($sensor);
         }
         echo PHP_EOL;
         if (pts_module::read_variable('MONITOR_INTERVAL') != null) {
             $proposed_interval = pts_module::read_variable('MONITOR_INTERVAL');
             if (is_numeric($proposed_interval) && $proposed_interval >= 1) {
                 self::$sensor_monitoring_frequency = $proposed_interval;
             }
         }
         // Pad some idling sensor results at the start
         sleep(self::$sensor_monitoring_frequency * 8);
     }
     pts_module::pts_timed_function('pts_monitor_update', self::$sensor_monitoring_frequency);
 }
开发者ID:pchiruma,项目名称:phoronix-test-suite,代码行数:41,代码来源:system_monitor.php

示例5: report_test_notes_to_graph

 protected static function report_test_notes_to_graph(&$graph, &$result_object)
 {
     // do some magic here to report any test notes....
     $json = array();
     $unique_compiler_data = array();
     foreach ($result_object->test_result_buffer->get_buffer_items() as $buffer_item) {
         $result_json = $buffer_item->get_result_json();
         if (!empty($result_json)) {
             $json[$buffer_item->get_result_identifier()] = $result_json;
             if (isset($result_json['compiler-options']) && !empty($result_json['compiler-options'])) {
                 pts_arrays::unique_push($unique_compiler_data, $result_json['compiler-options']);
             }
         }
         // report against graph with $graph->addTestNote($note, $hover_title = null);
     }
     if (empty($json)) {
         // no JSON data being reported to look at...
         return false;
     }
     if (isset($unique_compiler_data[0]['compiler-type']) && isset($unique_compiler_data[0]['compiler'])) {
         $compiler_options_string = '(' . strtoupper($unique_compiler_data[0]['compiler-type']) . ') ' . $unique_compiler_data[0]['compiler'] . ' options: ';
     } else {
         $compiler_options_string = null;
     }
     switch (count($unique_compiler_data)) {
         case 0:
             break;
         case 1:
             if ($unique_compiler_data[0]['compiler-options'] != null) {
                 $graph->addTestNote($compiler_options_string . $unique_compiler_data[0]['compiler-options'], $unique_compiler_data[0]['compiler-options']);
             }
             break;
         default:
             $diff = call_user_func_array('array_diff', $unique_compiler_data);
             if (count($diff) == 1) {
                 $key = array_keys($diff);
                 $key = array_pop($key);
             }
             if (isset($key) && isset($diff[$key])) {
                 $unique_compiler_data = array();
                 foreach ($json as $identifier => &$data) {
                     if (isset($data['compiler-options'][$key])) {
                         $d = explode(' ', $data['compiler-options'][$key]);
                         if (!in_array($d, $unique_compiler_data)) {
                             $unique_compiler_data[$identifier] = $d;
                         }
                     }
                 }
                 if (empty($unique_compiler_data)) {
                     break;
                 }
                 if ($key == 'compiler-options') {
                     $intersect = count($unique_compiler_data) == 1 ? reset($unique_compiler_data) : call_user_func_array('array_intersect', $unique_compiler_data);
                     $graph->addTestNote($compiler_options_string . implode(' ', $intersect));
                 }
                 if (count($unique_compiler_data) > 1) {
                     foreach ($json as $identifier => &$data) {
                         if (isset($data['compiler-options'][$key])) {
                             $options = explode(' ', $data['compiler-options'][$key]);
                             $diff = implode(' ', array_diff($options, $intersect));
                             if ($diff) {
                                 $graph->addGraphIdentifierNote($identifier, $diff);
                             }
                         }
                     }
                 }
             }
             break;
     }
     foreach ($json as $identifier => &$data) {
         // TODO XXX: Ultimately merge this data into the SE +/- line...
         if (isset($data['min-result'])) {
             if (isset($data['max-result'])) {
                 $graph->addGraphIdentifierNote($identifier, 'MIN: ' . $data['min-result'] . ' / MAX: ' . $data['max-result']);
             } else {
                 $graph->addGraphIdentifierNote($identifier, 'MIN: ' . $data['min-result']);
             }
         }
         if (isset($data['install-footnote']) && $data['install-footnote'] != null) {
             $graph->addTestNote($identifier . ': ' . $data['install-footnote']);
             //$graph->addGraphIdentifierNote($identifier, $data['install-footnote']);
         }
     }
 }
开发者ID:ptzafrir,项目名称:phoronix-test-suite,代码行数:84,代码来源:pts_render.php

示例6: compact_result_file_test_object


//.........这里部分代码省略.........
         }
     }
     if ($is_tracking) {
         $prev_date_r = explode(' ', $prev_date);
         if (count($prev_date_r) == 2 && ctype_alpha($prev_date_r[0])) {
             // This check should make it so when like testing every Ubuntu releases (Ubuntu 11.04, Ubuntu 11.10, etc) it's not in a line graph
             $is_tracking = false;
         }
     } else {
         if ($is_tracking == false && $sha1_short_count > 5) {
             // It's probably actually tracking..... based upon Stefan's Wine 1.4 example on 15 March 2012
             $is_tracking = true;
         }
     }
     foreach (array_keys($days) as $day_key) {
         $days[$day_key] = $systems;
     }
     $raw_days = $days;
     $json_days = $days;
     foreach ($mto->test_result_buffer->get_buffer_items() as $buffer_item) {
         $identifier = array_map('trim', explode(':', $buffer_item->get_result_identifier()));
         switch (count($identifier)) {
             case 2:
                 $system = $identifier[$system_index];
                 $date = $identifier[$date_index];
                 break;
             case 1:
                 $system = 0;
                 $date = $identifier[0];
                 break;
             default:
                 return;
                 break;
         }
         $days[$date][$system] = $buffer_item->get_result_value();
         $raw_days[$date][$system] = $buffer_item->get_result_raw();
         $json_days[$date][$system] = $buffer_item->get_result_json();
         if (!is_numeric($days[$date][$system])) {
             return;
         }
     }
     $mto->test_result_buffer = new pts_test_result_buffer();
     $day_keys = array_keys($days);
     if ($condense_multi_way) {
         $mto->set_used_arguments_description($mto->get_arguments_description() . ' | Composite Of: ' . implode(' - ', array_keys($days)));
         foreach (array_keys($systems) as $system_key) {
             $sum = 0;
             $count = 0;
             foreach ($day_keys as $day_key) {
                 $sum += $days[$day_key][$system_key];
                 $count++;
             }
             $mto->test_result_buffer->add_test_result($system_key, $sum / $count);
         }
     } else {
         $mto->test_profile->set_result_scale($mto->test_profile->get_result_scale() . ' | ' . implode(',', array_keys($days)));
         if ($is_tracking && $buffer_count < 16 && $result_file && pts_result_file_analyzer::analyze_result_file_intent($result_file) == false) {
             // It can't be a tracker if the result file is comparing hardware/software, etc
             $is_tracking = false;
         }
         switch ($mto->test_profile->get_display_format()) {
             //case 'HORIZONTAL_BOX_PLOT':
             //	$mto->test_profile->set_display_format('HORIZONTAL_BOX_PLOT_MULTI');
             //	break;
             case 'SCATTER_PLOT':
                 break;
             default:
                 $line_graph_type = 'LINE_GRAPH';
                 $mto->test_profile->set_display_format(!isset($extra_attributes['force_tracking_line_graph']) && (count($days) < 5 || $is_tracking == false && !isset($extra_attributes['force_line_graph_compact'])) ? 'BAR_ANALYZE_GRAPH' : $line_graph_type);
                 break;
         }
         foreach (array_keys($systems) as $system_key) {
             $results = array();
             $raw_results = array();
             $json_results = array();
             foreach ($day_keys as $day_key) {
                 array_push($results, $days[$day_key][$system_key]);
                 array_push($raw_results, $raw_days[$day_key][$system_key]);
                 pts_arrays::unique_push($json_results, $json_days[$day_key][$system_key]);
             }
             // TODO XXX: Make JSON data work for multi-way comparisons!
             if (count($json_results) == 1) {
                 $json = array_shift($json_results);
             } else {
                 $json = null;
             }
             $mto->test_result_buffer->add_test_result($system_key, implode(',', $results), implode(',', $raw_results), $json);
         }
     }
     if ($result_table !== false) {
         foreach (array_keys($systems) as $system_key) {
             foreach ($day_keys as $day_key) {
                 if (!isset($result_table[$system_key][$day_key])) {
                     $result_table[$system_key][$day_key] = array();
                 }
                 array_push($result_table[$system_key][$day_key], $days[$day_key][$system_key], $raw_days[$day_key][$system_key]);
             }
         }
     }
 }
开发者ID:xorgy,项目名称:phoronix-test-suite,代码行数:101,代码来源:pts_render.php

示例7: render_page_process

    public static function render_page_process($PATH)
    {
        $main = null;
        if (isset($PATH[0])) {
            $upload_ids = explode(',', $PATH[0]);
            foreach ($upload_ids as $i => $upload_id) {
                if (isset($upload_id[5]) && substr($upload_id, 0, 2) == 'S:') {
                    $t = explode(':', $upload_id);
                    $stmt = phoromatic_server::$db->prepare('SELECT UploadID, UploadTime FROM phoromatic_results WHERE AccountID = :account_id AND ScheduleID = :schedule_id ORDER BY UploadTime DESC');
                    $stmt->bindValue(':account_id', $_SESSION['AccountID']);
                    $stmt->bindValue(':schedule_id', $t[1]);
                    $test_result_result = $stmt->execute();
                    $cutoff_time = is_numeric($t[2]) ? strtotime('today -' . $t[2] . ' days') : false;
                    while ($test_result_row = $test_result_result->fetchArray()) {
                        if ($cutoff_time !== false && strtotime($test_result_row['UploadTime']) < $cutoff_time) {
                            break;
                        }
                        $upload_ids[] = $test_result_row['UploadID'];
                    }
                    unset($upload_ids[$i]);
                }
            }
            $upload_ids = array_unique($upload_ids);
            $result_files = array();
            $display_rows = array();
            $system_types = array();
            $schedule_types = array();
            $trigger_types = array();
            $upload_times = array();
            $benchmark_tickets = array();
            $xml_result_hash = array();
            $tickets = array();
            foreach ($upload_ids as $id) {
                $result_share_opt = phoromatic_server::read_setting('force_result_sharing') ? '1 = 1' : 'AccountID = (SELECT AccountID FROM phoromatic_account_settings WHERE LetOtherGroupsViewResults = "1" AND AccountID = phoromatic_results.AccountID)';
                $stmt = phoromatic_server::$db->prepare('SELECT * FROM phoromatic_results WHERE PPRID = :pprid AND (AccountID = :account_id OR ' . $result_share_opt . ') LIMIT 1');
                $stmt->bindValue(':pprid', $id);
                $stmt->bindValue(':account_id', $_SESSION['AccountID']);
                $result = $stmt->execute();
                $row = $result->fetchArray();
                if (false && empty($row)) {
                    // TODO XXX
                    // XXX this code is ultimately dead
                    $stmt = phoromatic_server::$db->prepare('SELECT * FROM phoromatic_results WHERE AccountID = :account_id AND UploadID = :upload_id LIMIT 1');
                    $stmt->bindValue(':account_id', $_SESSION['AccountID']);
                    $stmt->bindValue(':upload_id', $id);
                    $result = $stmt->execute();
                    $row = $result->fetchArray();
                }
                if (empty($row)) {
                    continue;
                }
                $composite_xml = phoromatic_server::phoromatic_account_result_path($row['AccountID'], $row['UploadID']) . 'composite.xml';
                if (!is_file($composite_xml)) {
                    echo 'File Not Found: ' . $composite_xml;
                    return false;
                }
                $display_rows[$composite_xml] = $row;
                pts_arrays::unique_push($benchmark_tickets, $row['BenchmarkTicketID']);
                pts_arrays::unique_push($upload_times, $row['UploadTime']);
                pts_arrays::unique_push($xml_result_hash, $row['XmlUploadHash']);
                pts_arrays::unique_push($system_types, $row['SystemID']);
                pts_arrays::unique_push($schedule_types, $row['ScheduleID']);
                pts_arrays::unique_push($trigger_types, $row['Trigger']);
                pts_arrays::unique_push($tickets, $row['BenchmarkTicketID']);
                // Update view counter
                $stmt_view = phoromatic_server::$db->prepare('UPDATE phoromatic_results SET TimesViewed = (TimesViewed + 1) WHERE AccountID = :account_id AND UploadID = :upload_id');
                $stmt_view->bindValue(':account_id', $_SESSION['AccountID']);
                $stmt_view->bindValue(':upload_id', $row['UploadID']);
                $stmt_view->execute();
            }
            $result_file_title = null;
            if (count($system_types) == 1) {
                $result_file_title = phoromatic_system_id_to_name($system_types[0]) . ' Tests';
            }
            if (!empty($tickets) && $tickets[0] != null) {
                $system_name_format = 'ORIGINAL_DATA';
            } else {
                if (count($trigger_types) == 1 && $trigger_types[0] != null && $benchmark_tickets[0] != null && count($display_rows) > 1) {
                    $system_name_format = 'TRIGGER_AND_SYSTEM';
                } else {
                    if (empty($schedule_types[0])) {
                        $system_name_format = 'ORIGINAL_DATA';
                    } else {
                        if (count($display_rows) == 1) {
                            $system_name_format = 'SYSTEM_NAME';
                        } else {
                            if (count($schedule_types) == 1 && count($system_types) == 1) {
                                $system_name_format = 'TRIGGER';
                                $result_file_title = phoromatic_schedule_id_to_name($schedule_types[0]);
                            } else {
                                if (count($schedule_types) == 1) {
                                    $system_name_format = 'TRIGGER_AND_SYSTEM';
                                } else {
                                    if (false && count($trigger_types) == 1) {
                                        // TODO XXX: this approach yields garbage strings generally without refining the selector
                                        // i.e. first make sure all the schedules match or are comparable
                                        $system_name_format = 'SYSTEM_AND_SCHEDULE';
                                    } else {
                                        $system_name_format = null;
                                    }
//.........这里部分代码省略.........
开发者ID:pacificIT,项目名称:phoronix-test-suite,代码行数:101,代码来源:phoromatic_result.php

示例8: generate_result_export_dump

 public static function generate_result_export_dump($account_id)
 {
     pts_file_io::mkdir(self::phoromatic_path() . 'result-export/');
     $export_path = self::phoromatic_path() . 'result-export/' . $account_id . '/';
     pts_file_io::mkdir($export_path);
     $stmt = phoromatic_server::$db->prepare('SELECT * FROM phoromatic_schedules WHERE AccountID = :account_id AND State = 1 AND (SELECT COUNT(*) FROM phoromatic_schedules_tests WHERE AccountID = :account_id AND ScheduleID = phoromatic_schedules.ScheduleID) > 0 AND (SELECT COUNT(*) FROM phoromatic_results WHERE AccountID = :account_id AND ScheduleID = phoromatic_schedules.ScheduleID) > 4 ORDER BY Title ASC');
     $stmt->bindValue(':account_id', $account_id);
     $result = $stmt->execute();
     $exported_result_index = array('phoromatic' => array());
     while ($result && ($row = $result->fetchArray())) {
         $id = str_replace(' ', '-', strtolower($row['Title']));
         $triggers = array();
         $stmt2 = phoromatic_server::$db->prepare('SELECT * FROM phoromatic_results WHERE AccountID = :account_id AND ScheduleID = :schedule_id ORDER BY UploadTime DESC');
         $stmt2->bindValue(':account_id', $row['AccountID']);
         $stmt2->bindValue(':schedule_id', $row['ScheduleID']);
         $result2 = $stmt2->execute();
         pts_file_io::mkdir($export_path);
         while ($result2 && ($row2 = $result2->fetchArray())) {
             $composite_xml = phoromatic_server::phoromatic_account_result_path($row2['AccountID'], $row2['UploadID']) . 'composite.xml';
             if (is_file($composite_xml)) {
                 pts_file_io::mkdir($export_path . $id . '/' . $row2['Trigger']);
                 pts_file_io::mkdir($export_path . $id . '/' . $row2['Trigger'] . '/' . phoromatic_server::system_id_to_name($row2['SystemID'], $row2['AccountID']));
                 copy($composite_xml, $export_path . $id . '/' . $row2['Trigger'] . '/' . phoromatic_server::system_id_to_name($row2['SystemID'], $row2['AccountID']) . '/composite.xml');
             }
             pts_arrays::unique_push($triggers, $row2['Trigger']);
         }
         $exported_result_index['phoromatic'][$id] = array('title' => $row['Title'], 'id' => $id, 'description' => $row['Description'], 'triggers' => $triggers);
     }
     $exported_result_index = json_encode($exported_result_index, JSON_PRETTY_PRINT);
     file_put_contents($export_path . '/export-index.json', $exported_result_index);
 }
开发者ID:pacificIT,项目名称:phoronix-test-suite,代码行数:31,代码来源:phoromatic_server.php

示例9: subsystems_under_test

 public function subsystems_under_test()
 {
     $subsystems_to_test = array();
     foreach ($this->tests_to_run as $test_run_request) {
         pts_arrays::unique_push($subsystems_to_test, $test_run_request->test_profile->get_test_hardware_type());
     }
     return $subsystems_to_test;
 }
开发者ID:Jeni4,项目名称:phoronix-test-suite,代码行数:8,代码来源:pts_test_run_manager.php

示例10: generate_results_var

 protected function generate_results_var()
 {
     if ($this->is_multi_way_comparison) {
         $this->results = array();
         foreach ($this->test_result->test_result_buffer->buffer_items as &$buffer_item) {
             $identifier = array_map('trim', explode(':', $buffer_item->get_result_identifier()));
             if (true) {
                 $identifier = array_reverse($identifier);
             }
             switch (count($identifier)) {
                 case 2:
                     $system = $identifier[0];
                     $date = $identifier[1];
                     break;
                 case 1:
                     $system = 0;
                     $date = $identifier[0];
                     break;
                 default:
                     continue;
                     break;
             }
             $buffer_item->reset_result_identifier($system);
             if (!isset($this->results[$date])) {
                 $this->results[$date] = array();
             }
             array_push($this->results[$date], $buffer_item);
             pts_arrays::unique_push($this->graph_identifiers, $system);
         }
         if (count($this->results) == 1) {
             $this->is_multi_way_comparison = false;
         }
     } else {
         $this->results = array($this->test_result->test_result_buffer->buffer_items);
         foreach ($this->test_result->test_result_buffer->buffer_items as &$buffer_item) {
             array_push($this->graph_identifiers, $buffer_item->get_result_identifier());
         }
     }
 }
开发者ID:xorgy,项目名称:phoronix-test-suite,代码行数:39,代码来源:phx_graph_core.php

示例11: generate_test_notes

 public static function generate_test_notes(&$test_result_objects)
 {
     // TODO XXX: Integrate with system table notes
     static $check_processes = null;
     $test_types = array();
     $test_tags = array();
     foreach ($test_result_objects as $test_result) {
         pts_arrays::unique_push($test_types, $test_result->test_profile->get_test_hardware_type());
         foreach ($test_result->test_profile->get_internal_tags() as $tag) {
             pts_arrays::unique_push($test_tags, $tag);
         }
     }
     if (in_array('Java', $test_tags)) {
         self::add_note(phodevi::read_property('system', 'java-version'));
     }
     if (in_array('Python', $test_tags)) {
         self::add_note(phodevi::read_property('system', 'python-version'));
     }
     if (in_array('Wine', $test_tags)) {
         self::add_note(phodevi::read_property('system', 'wine-version'));
     }
     if (in_array('OpenCL', $test_tags)) {
         $cores = phodevi::read_property('gpu', 'compute-cores');
         if ($cores > 0) {
             self::add_note('GPU Compute Cores: ' . $cores);
         }
     }
     /*
     if(phodevi::is_bsd() == false)
     {
     	if(empty($check_processes))
     	{
     		$check_processes = array(
     			'Compiz' => array('compiz', 'compiz.real'),
     			'Firefox' => array('firefox', 'mozilla-firefox', 'mozilla-firefox-bin'),
     			'Thunderbird' => array('thunderbird', 'mozilla-thunderbird', 'thunderbird-bin'),
     			'BOINC' => array('boinc', 'boinc_client')
     			);
     	}
     
     	self::add_note(self::process_running_string($check_processes));
     }
     */
     // Check if Security Enhanced Linux was enforcing, permissive, or disabled
     if (is_readable('/etc/sysconfig/selinux')) {
         if (stripos(file_get_contents('/etc/sysconfig/selinux'), 'selinux=disabled') === false) {
             self::add_note('SELinux: Enabled');
         }
     } else {
         if (isset(phodevi::$vfs->cmdline)) {
             if (stripos(phodevi::$vfs->cmdline, 'selinux=1') != false) {
                 self::add_note('SELinux: Enabled');
             }
         }
     }
     /*
     // Encrypted file-system?
     if(phodevi::is_linux() && is_readable('/sys/fs/ecryptfs/version'))
     {
     	self::add_note('eCryptfs was active.');
     }
     */
     self::add_note(phodevi::read_property('motherboard', 'power-mode'));
     if (in_array('Graphics', $test_types) || in_array('System', $test_types)) {
         $aa_level = phodevi::read_property('gpu', 'aa-level');
         $af_level = phodevi::read_property('gpu', 'af-level');
         if (!empty($aa_level)) {
             self::add_note('Antialiasing: ' . $aa_level);
         }
         if (!empty($af_level)) {
             self::add_note('Anisotropic Filtering: ' . $af_level);
         }
     }
     $notes_string = trim(implode('. ', self::$notes));
     if ($notes_string != null) {
         $notes_string .= '.';
     }
     self::$notes = array();
     return $notes_string;
 }
开发者ID:pacificIT,项目名称:phoronix-test-suite,代码行数:80,代码来源:pts_test_notes_manager.php

示例12: generate_results_var

 protected function generate_results_var()
 {
     $this->results = array();
     if ($this->is_multi_way_comparison) {
         foreach ($this->test_result->test_result_buffer->buffer_items as $i => &$buffer_item) {
             if ($buffer_item->get_result_value() === null) {
                 unset($this->test_result->test_result_buffer->buffer_items[$i]);
                 continue;
             }
             $identifier = array_map('trim', explode(':', $buffer_item->get_result_identifier()));
             if ($this->i['multi_way_comparison_invert_default']) {
                 $identifier = array_reverse($identifier);
             }
             switch (count($identifier)) {
                 case 2:
                     $system = $identifier[0];
                     $date = $identifier[1];
                     break;
                 case 1:
                     $system = 0;
                     $date = $identifier[0];
                     break;
                 default:
                     continue;
                     break;
             }
             $buffer_item->reset_result_identifier($system);
             if (!isset($this->results[$date])) {
                 $this->results[$date] = array();
             }
             $this->results[$date][] = $buffer_item;
             pts_arrays::unique_push($this->graph_identifiers, $system);
         }
         if (count($this->results) == 1) {
             $this->is_multi_way_comparison = false;
         }
     } else {
         if (isset($this->test_result->test_result_buffer)) {
             foreach ($this->test_result->test_result_buffer->buffer_items as $i => &$buffer_item) {
                 if ($buffer_item->get_result_value() === null) {
                     unset($this->test_result->test_result_buffer->buffer_items[$i]);
                     continue;
                 }
                 $this->graph_identifiers[] = $buffer_item->get_result_identifier();
             }
             $this->results = array($this->test_result->test_result_buffer->buffer_items);
         }
     }
 }
开发者ID:numerant,项目名称:phoronix-test-suite,代码行数:49,代码来源:pts_graph_core.php

示例13: array

 $schedule_types = array();
 $trigger_types = array();
 foreach ($result_ids as $upload_id) {
     $stmt = phoromatic_server::$db->prepare('SELECT * FROM phoromatic_results WHERE PPRID = :pprid LIMIT 1');
     $stmt->bindValue(':pprid', $upload_id);
     $result = $stmt->execute();
     $row = $result->fetchArray();
     $composite_xml = phoromatic_server::phoromatic_account_result_path($row['AccountID'], $row['UploadID']) . 'composite.xml';
     if (!is_file($composite_xml)) {
         echo 'File Not Found: ' . $composite_xml;
         return false;
     }
     $display_rows[$composite_xml] = $row;
     pts_arrays::unique_push($system_types, $row['SystemID']);
     pts_arrays::unique_push($schedule_types, $row['ScheduleID']);
     pts_arrays::unique_push($trigger_types, $row['Trigger']);
     // Update view counter
     $stmt_view = phoromatic_server::$db->prepare('UPDATE phoromatic_results SET TimesViewed = (TimesViewed + 1) WHERE AccountID = :account_id AND UploadID = :upload_id');
     $stmt_view->bindValue(':account_id', $account_id);
     $stmt_view->bindValue(':upload_id', $upload_id);
     $stmt_view->execute();
 }
 $result_file_title = null;
 if (empty($schedule_types[0])) {
     $system_name_format = 'ORIGINAL_DATA';
 } else {
     if (count($display_rows) == 1) {
         $system_name_format = 'SYSTEM_NAME';
     } else {
         if (count($schedule_types) == 1 && count($system_types) == 1) {
             $system_name_format = 'TRIGGER';
开发者ID:ShaolongHu,项目名称:phoronix-test-suite,代码行数:31,代码来源:public.php

示例14: create_single_sensor_instance

 private static function create_single_sensor_instance($sensor, $instance, $param)
 {
     if ($sensor[0] === 'cgroup') {
         $cgroup_controller = call_user_func(array($sensor[2], 'get_cgroup_controller'));
         pts_arrays::unique_push(self::$cgroup_enabled_controllers, $cgroup_controller);
         self::cgroup_create(self::$cgroup_name, $cgroup_controller);
         $param = self::$cgroup_name;
     }
     if (call_user_func(array($sensor[2], 'parameter_check'), $param) === true) {
         $sensor_object = new $sensor[2]($instance, $param);
         self::$to_monitor[] = $sensor_object;
         pts_module::save_file('logs/' . phodevi::sensor_object_identifier($sensor_object));
     }
 }
开发者ID:numerant,项目名称:phoronix-test-suite,代码行数:14,代码来源:system_monitor.php


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