Best Phoronix-test-suite code snippet using pts_graph_ir_value
pts_ResultFileTable.php
Source:pts_ResultFileTable.php
...88 if($result_object_index != -1)89 {90 if(is_array($result_object_index))91 {92 $result_tests[$result_counter] = new pts_graph_ir_value($result_object->get_arguments_description());93 }94 else95 {96 $result_tests[$result_counter] = new pts_graph_ir_value('Results');97 }98 }99 else100 {101 $result_tests[$result_counter] = new pts_graph_ir_value($result_object->test_profile->get_identifier_base_name() . ': ' . $result_object->get_arguments_description());102 $result_tests[$result_counter]->set_attribute('title', $result_object->get_arguments_description());103 if($result_object->test_profile->get_identifier() != null)104 {105 $result_tests[$result_counter]->set_attribute('href', 'http://openbenchmarking.org/test/' . $result_object->test_profile->get_identifier());106 }107 }108 if($result_object->test_profile->get_identifier() == null)109 {110 if($result_object->test_profile->get_display_format() == 'BAR_GRAPH')111 {112 $result_tests[$result_counter]->set_attribute('alert', true);113 foreach($result_object->test_result_buffer->get_buffer_items() as $index => $buffer_item)114 {115 $identifier = $buffer_item->get_result_identifier();116 $value = $buffer_item->get_result_value();117 $result_table[$identifier][$result_counter] = new pts_graph_ir_value($value, array('alert' => true));118 }119 $result_counter++;120 }121 continue;122 }123 switch($result_object->test_profile->get_display_format())124 {125 case 'BAR_GRAPH':126 $best_value = 0;127 $worst_value = 0;128 if(!defined('PHOROMATIC_TRACKER') && count($result_object->test_result_buffer->get_values()) > 1)129 {130 switch($result_object->test_profile->get_result_proportion())131 {132 case 'HIB':133 $best_value = max($result_object->test_result_buffer->get_values());134 $worst_value = min($result_object->test_result_buffer->get_values());135 break;136 case 'LIB':137 $best_value = min($result_object->test_result_buffer->get_values());138 $worst_value = max($result_object->test_result_buffer->get_values());139 break;140 }141 }142 $prev_value = 0;143 $prev_identifier = null;144 $prev_identifier_0 = null;145 $values_in_buffer = $result_object->test_result_buffer->get_values();146 sort($values_in_buffer);147 $min_value_in_buffer = $values_in_buffer[0];148 if($min_value_in_buffer == 0)149 {150 // Go through the values until something not 0, otherwise down in the code will be a divide by zero151 for($i = 1; $i < count($values_in_buffer) && $min_value_in_buffer == 0; $i++)152 {153 $min_value_in_buffer = $values_in_buffer[$i];154 }155 }156 $max_value_in_buffer = $values_in_buffer[(count($values_in_buffer) - 1)];157 foreach($result_object->test_result_buffer->get_buffer_items() as $index => $buffer_item)158 {159 $identifier = $buffer_item->get_result_identifier();160 $value = $buffer_item->get_result_value();161 $raw_values = pts_strings::colon_explode($buffer_item->get_result_raw());162 $percent_std = pts_math::set_precision(pts_math::percent_standard_deviation($raw_values), 2);163 $std_error = pts_math::set_precision(pts_math::standard_error($raw_values), 2);164 $delta = 0;165 if(defined('PHOROMATIC_TRACKER'))166 {167 $identifier_r = pts_strings::colon_explode($identifier);168 if($identifier_r[0] == $prev_identifier_0 && $prev_value != 0)169 {170 $delta = pts_math::set_precision(abs(1 - ($value / $prev_value)), 4);171 if($delta > 0.02 && $delta > pts_math::standard_deviation($raw_values))172 {173 switch($result_object->test_profile->get_result_proportion())174 {175 case 'HIB':176 if($value < $prev_value)177 {178 $delta = 0 - $delta;179 }180 break;181 case 'LIB':182 if($value > $prev_value)183 {184 $delta = 0 - $delta;185 }186 break;187 }188 }189 else190 {191 $delta = 0;192 }193 }194 $prev_identifier_0 = $identifier_r[0];195 $highlight = false;196 $alert = false;197 }198 else199 {200 if($result_file->is_multi_way_comparison())201 {202 // TODO: make it work better for highlighting multiple winners in multi-way comparisons203 $highlight = false;204 $alert = false;205 // TODO: get this working right206 if(false && $index % 2 == 1 && $prev_value != 0)207 {208 switch($result_object->test_profile->get_result_proportion())209 {210 case 'HIB':211 if($value > $prev_value)212 {213 $highlight = true;214 }215 else216 {217 $result_table[$prev_identifier][$result_counter]->set_attribute('highlight', true);218 $result_table[$prev_identifier][$result_counter]->set_attribute('delta', -1);219 }220 break;221 case 'LIB':222 if($value < $prev_value)223 {224 $highlight = true;225 }226 else227 {228 $result_table[$prev_identifier][$result_counter]->set_attribute('highlight', true);229 $result_table[$prev_identifier][$result_counter]->set_attribute('delta', -1);230 }231 break;232 }233 }234 }235 else236 {237 $alert = $worst_value == $value;238 $highlight = $best_value == $value;239 }240 if($min_value_in_buffer != $max_value_in_buffer)241 {242 switch($result_object->test_profile->get_result_proportion())243 {244 case 'HIB':245 $delta = pts_math::set_precision($value / $min_value_in_buffer, 2);246 break;247 case 'LIB':248 $delta = pts_math::set_precision(1 - ($value / $max_value_in_buffer) + 1, 2);249 break;250 }251 }252 }253 $attributes = array(254 'std_percent' => $percent_std,255 'std_error' => $std_error,256 'delta' => $delta,257 'highlight' => $highlight,258 'alert' => $alert259 );260 if($delta > $percent_std && $flag_delta_results !== false)261 {262 $flag_delta_results[$ri] = $delta;263 }264 $result_table[$identifier][$result_counter] = new pts_graph_ir_value($value, $attributes);265 $prev_identifier = $identifier;266 $prev_value = $value;267 }268 break;269 case 'LINE_GRAPH':270 case 'FILLED_LINE_GRAPH':271 $result_tests[$result_counter] = new pts_graph_ir_value($result_object->test_profile->get_title() . ' (Avg)');272 foreach($result_object->test_result_buffer->get_buffer_items() as $index => $buffer_item)273 {274 $identifier = $buffer_item->get_result_identifier();275 $values = pts_strings::comma_explode($buffer_item->get_result_value());276 $avg_value = pts_math::set_precision(array_sum($values) / count($values), 2);277 $result_table[$identifier][$result_counter] = new pts_graph_ir_value($avg_value);278 }279 break;280 }281 $result_counter++;282 }283 if($result_counter == 1)284 {285 // This should provide some additional information under normal modes286 $has_written_std = false;287 $has_written_diff = false;288 $has_written_error = false;289 foreach($result_table as $identifier => $info)290 {291 if(!isset($info[($result_counter - 1)]))292 {293 continue;294 }295 $std_percent = $info[($result_counter - 1)]->get_attribute('std_percent');296 $std_error = $info[($result_counter - 1)]->get_attribute('std_error');297 $delta = $info[($result_counter - 1)]->get_attribute('delta');298 if($delta != 0)299 {300 $result_table[$identifier][] = new pts_graph_ir_value($delta . 'x');301 $has_written_diff = true;302 }303 if($std_error != 0)304 {305 $result_table[$identifier][] = new pts_graph_ir_value($std_error);306 $has_written_error = true;307 }308 if($std_percent != 0)309 {310 $result_table[$identifier][] = new pts_graph_ir_value($std_percent . '%');311 $has_written_std = true;312 }313 }314 if($has_written_diff)315 {316 $result_tests[] = new pts_graph_ir_value('Difference');317 }318 if($has_written_error)319 {320 $result_tests[] = new pts_graph_ir_value('Standard Error');321 }322 if($has_written_std)323 {324 $result_tests[] = new pts_graph_ir_value('Standard Deviation');325 }326 }327 if(defined('PHOROMATIC_TRACKER'))328 {329 // Resort the results by SYSTEM, then date330 $systems_table = array();331 $sorted_table = array();332 foreach($result_table as $system_identifier => &$identifier_table)333 {334 $identifier = pts_strings::colon_explode($system_identifier);335 if(!isset($systems_table[$identifier[0]]))336 {337 $systems_table[$identifier[0]] = array();338 }...
pts_graph_ir_value
Using AI Code Generation
1require_once('pts_graph_ir_value.php');2$graph = new pts_graph_ir_value();3$graph->set_title('Title of the graph');4$graph->set_x_label('X label');5$graph->set_y_label('Y label');6$graph->set_x_label_angle(90);7$graph->set_x_label_count(10);8$graph->set_x_label_font_size(10);9$graph->set_y_label_font_size(10);10$graph->set_x_label_font_color('black');11$graph->set_y_label_font_color('black');12$graph->set_x_label_font('Arial');13$graph->set_y_label_font('Arial');14$graph->set_x_label_font_weight('bold');15$graph->set_y_label_font_weight('bold');16$graph->set_x_label_font_style('italic');17$graph->set_y_label_font_style('italic');18$graph->set_x_label_font_decoration('underline');19$graph->set_y_label_font_decoration('underline');20$graph->set_x_label_font_color('red');21$graph->set_y_label_font_color('red');22$graph->set_x_label_font_color('green');23$graph->set_y_label_font_color('green');24$graph->set_x_label_font_color('blue');25$graph->set_y_label_font_color('blue');26$graph->set_x_label_font_color('yellow');27$graph->set_y_label_font_color('yellow');28$graph->set_x_label_font_color('black');29$graph->set_y_label_font_color('black');30$graph->set_x_label_font_color('gray');31$graph->set_y_label_font_color('gray');32$graph->set_x_label_font_color('white');33$graph->set_y_label_font_color('white');34$graph->set_x_label_font_color('brown');35$graph->set_y_label_font_color('brown');36$graph->set_x_label_font_color('purple');37$graph->set_y_label_font_color('purple');38$graph->set_x_label_font_color('orange');39$graph->set_y_label_font_color('orange');40$graph->set_x_label_font_color('cyan');41$graph->set_y_label_font_color('cyan');42$graph->set_x_label_font_color('magenta');43$graph->set_y_label_font_color('magenta');44$graph->set_x_label_font_color('pink');
pts_graph_ir_value
Using AI Code Generation
1require_once('pts_graph_ir_value.php');2$ir = new pts_graph_ir_value();3$ir->set_value(2);4echo $ir->get_value();5require_once('pts_graph_ir_value.php');6$ir = new pts_graph_ir_value();7$ir->set_value(3);8echo $ir->get_value();9require_once('pts_graph_ir_value.php');10$ir = new pts_graph_ir_value();11$ir->set_value(4);12echo $ir->get_value();13require_once('pts_graph_ir_value.php');14$ir = new pts_graph_ir_value();15$ir->set_value(5);16echo $ir->get_value();17require_once('pts_graph_ir_value.php');18$ir = new pts_graph_ir_value();19$ir->set_value(6);20echo $ir->get_value();21require_once('pts_graph_ir_value.php');22$ir = new pts_graph_ir_value();23$ir->set_value(7);24echo $ir->get_value();
pts_graph_ir_value
Using AI Code Generation
1require_once('pts-core/objects/pts_graph_ir_value.php');2$graph_ir_value = new pts_graph_ir_value();3$ir_value = $graph_ir_value->get_ir_value();4echo $ir_value;5require_once('pts-core/objects/pts_graph_ir_value.php');6$graph_ir_value = new pts_graph_ir_value();7$ir_value = $graph_ir_value->get_ir_value();8echo $ir_value;9require_once('pts-core/objects/pts_graph_ir_value.php');10$graph_ir_value = new pts_graph_ir_value();11$ir_value = $graph_ir_value->get_ir_value();12echo $ir_value;13require_once('pts-core/objects/pts_graph_ir_value.php');14$graph_ir_value = new pts_graph_ir_value();15$ir_value = $graph_ir_value->get_ir_value();16echo $ir_value;17require_once('pts-core/objects/pts_graph_ir_value.php');18$graph_ir_value = new pts_graph_ir_value();19$ir_value = $graph_ir_value->get_ir_value();20echo $ir_value;21require_once('pts-core/objects/pts_graph_ir_value.php');
pts_graph_ir_value
Using AI Code Generation
1require_once('pts_graph_ir_value.php');2$pts_graph_ir_value = new pts_graph_ir_value();3$pts_graph_ir_value->get_value();4$value = $pts_graph_ir_value->value;5echo $value;6{7 public $value = "0";8 public function get_value()9 {10 $this->value = "1";11 }12}
pts_graph_ir_value
Using AI Code Generation
1include_once('pts_graph_ir_value.php');2$graph = new pts_graph_ir_value();3$graph->set_data(array(1,2,3,4,5,6,7,8,9,10));4$graph->set_title('title');5$graph->set_subtitle('subtitle');6$graph->set_x_label('x axis');7$graph->set_y_label('y axis');8$graph->set_color('red');9$graph->set_size(800,600);10$graph->set_file_name('file_name');11$graph->set_file_format('png');12$graph->set_file_path('/home/username/');13$graph->save();14$graph->display();
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Trigger Selenium automation tests on a cloud-based Grid of 3000+ real browsers and operating systems.
Test now for FreeGet 100 minutes of automation test minutes FREE!!