How to use perf_per_dollar class

Best Phoronix-test-suite code snippet using perf_per_dollar

perf_per_dollar.php

Source:perf_per_dollar.php Github

copy

Full Screen

...3 Phoronix Test Suite4 URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/5 Copyright (C) 2015 - 2017, Phoronix Media6 Copyright (C) 2015 - 2017, Michael Larabel7 perf_per_dollar.php: This module is derived from the system_monitor module8 This program is free software; you can redistribute it and/or modify9 it under the terms of the GNU General Public License as published by10 the Free Software Foundation; either version 3 of the License, or11 (at your option) any later version.12 This program is distributed in the hope that it will be useful,13 but WITHOUT ANY WARRANTY; without even the implied warranty of14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the15 GNU General Public License for more details.16 You should have received a copy of the GNU General Public License17 along with this program. If not, see <http://www.gnu.org/licenses/>.18*/19class perf_per_dollar extends pts_module_interface20{21 const module_name = 'Performance Per Dollar/Cost Calculator';22 const module_version = '0.2.0';23 const module_description = 'Setting the COST_PERF_PER_DOLLAR= environment variable to whatever value of the system cost/component you are running a comparison on will yield extra graphs that calculate the performance-per-dollar based on the test being run. The COST_PERF_PER_DOLLAR environment variable is applied just to the current test run identifier. Set the COST_PERF_PER_UNIT= environment variable if wishing to use a metric besides dollar/cost.';24 const module_author = 'Michael Larabel';25 private static $COST_PERF_PER_DOLLAR = 0;26 private static $COST_PERF_PER_UNIT = 'Dollar';27 private static $successful_test_run_request = null;28 private static $perf_per_dollar_collection;29 private static $result_identifier;30 public static function module_environmental_variables()31 {32 return array('COST_PERF_PER_DOLLAR', 'COST_PERF_PER_UNIT');33 }34 public static function module_info()35 {36 return null;37 }38 public static function __run_manager_setup(&$test_run_manager)39 {40 if(($d = getenv('COST_PERF_PER_DOLLAR')) > 0)41 {42 self::$COST_PERF_PER_DOLLAR = $d;43 echo PHP_EOL . 'The Phoronix Test Suite will generate performance-per-dollar graphs with an assumed value of $' . $d . '.' . PHP_EOL;44 self::$perf_per_dollar_collection = array();45 if(($d = getenv('COST_PERF_PER_UNIT')) != false)46 {47 self::$COST_PERF_PER_UNIT = $d;48 }49 }50 else51 {52 return pts_module::MODULE_UNLOAD; // This module doesn't have anything else to do53 }54 // This module won't be too useful if you're not saving the results to see the graphs55 $test_run_manager->force_results_save();56 }57 public static function __pre_run_process(&$test_run_manager)58 {59 self::$result_identifier = $test_run_manager->get_results_identifier();60 }61 public static function __post_test_run_success($test_run_request)62 {63 self::$successful_test_run_request = clone $test_run_request;64 }65 public static function __post_test_run_process(&$result_file)66 {67 if(self::$successful_test_run_request && self::$successful_test_run_request->test_profile->get_display_format() == 'BAR_GRAPH')68 {69 $result = 0;70 if(self::$successful_test_run_request->test_profile->get_result_proportion() == 'HIB')71 {72 $result = pts_math::set_precision(self::$successful_test_run_request->active->get_result() / self::$COST_PERF_PER_DOLLAR);73 $scale = $test_result->test_profile->get_result_scale() . ' Per ' . self::$COST_PERF_PER_UNIT;74 }75 else if(self::$successful_test_run_request->test_profile->get_result_proportion() == 'LIB')76 {77 $result = pts_math::set_precision(self::$successful_test_run_request->active->get_result() * self::$COST_PERF_PER_DOLLAR);78 $scale = $test_result->test_profile->get_result_scale() . ' x ' . self::$COST_PERF_PER_UNIT;79 }80 if($result != 0)81 {82 // This copy isn't needed but it's shorter and from port from system_monitor where there can be multiple items tracked83 $test_result = clone self::$successful_test_run_request;84 $test_result->test_profile->set_identifier(null);85 $test_result->set_used_arguments_description('Performance / Cost - ' . $test_result->get_arguments_description());86 $test_result->set_used_arguments('dollar comparison ' . $test_result->get_arguments());87 $test_result->test_profile->set_result_scale($scale);88 $test_result->test_result_buffer = new pts_test_result_buffer();89 $test_result->test_result_buffer->add_test_result(self::$result_identifier, $result, null, array('install-footnote' => '$' . self::$COST_PERF_PER_DOLLAR . ' reported cost.'));90 $result_file->add_result($test_result);91 self::$perf_per_dollar_collection[] = $test_result->active->get_result();92 }93 }94 self::$successful_test_run_request = null;95 }96 public static function __event_results_process(&$test_run_manager)97 {98 if(count(self::$perf_per_dollar_collection) > 2)99 {100 $avg = array_sum(self::$perf_per_dollar_collection) / count(self::$perf_per_dollar_collection);101 $avg_perf_dollar = $avg / self::$COST_PERF_PER_DOLLAR;102 $test_profile = new pts_test_profile();103 $test_result = new pts_test_result($test_profile);104 $test_result->test_profile->set_test_title('Meta Performance Per Dollar');105 $test_result->test_profile->set_identifier(null);106 $test_result->test_profile->set_version(null);107 $test_result->test_profile->set_result_proportion(null);108 $test_result->test_profile->set_display_format('BAR_GRAPH');109 $test_result->test_profile->set_result_scale('Performance Per Dollar');110 $test_result->test_profile->set_result_proportion('HIB');111 $test_result->set_used_arguments_description('Performance Per Dollar');112 $test_result->set_used_arguments('Per-Per-Dollar');113 $test_result->test_result_buffer = new pts_test_result_buffer();114 $test_result->test_result_buffer->add_test_result(self::$result_identifier, pts_math::set_precision($avg_perf_dollar), null, array('install-footnote' => '$' . self::$COST_PERF_PER_DOLLAR . ' reported cost. Average result: ' . pts_math::set_precision($avg) . '.'));...

Full Screen

Full Screen

perf_per_dollar

Using AI Code Generation

copy

Full Screen

1$test = new perf_per_dollar();2$test->test_name = '2.php';3$test->test_name = '2.php';4$test->test_version = '1.0.0';5$test->test_profile = '2.php';6$test->test_title = '2.php';7$test->test_description = '2.php';8$test->test_execution_time = '2.php';9$test->test_type = '2.php';10$test->test_result_type = '2.php';11$test->test_result_unit = '2.php';12$test->test_result_scale = '2.php';13$test->test_result_format = '2.php';14$test->test_result_pass = '2.php';15$test->test_result_min = '2.php';16$test->test_result_max = '2.php';17$test->test_result = '2.php';18$test->test_result_buffer = '2.php';19$test->test_result_append = '2.php';20$test->test_result_success = '2.php';21$test->test_result_fail = '2.php';22$test->test_result_error = '2.php';23$test->test_result_text = '2.php';24$test->test_result_json = '2.php';25$test->test_result_xml = '2.php';26$test->test_result_raw = '2.php';27$test->test_result_graph = '2.php';28$test->test_result_graph_title = '2.php';29$test->test_result_graph_type = '2.php';30$test->test_result_graph_min = '2.php';31$test->test_result_graph_max = '2.php';32$test->test_result_graph_scale = '2.php';33$test->test_result_graph_format = '2.php';34$test->test_result_graph_x_axis = '2.php';35$test->test_result_graph_y_axis = '2.php';36$test->test_result_graph_x_label = '2.php';37$test->test_result_graph_y_label = '2.php';38$test->test_result_graph_x_min = '2.php';39$test->test_result_graph_x_max = '2.php';40$test->test_result_graph_y_min = '2.php';41$test->test_result_graph_y_max = '2.php';42$test->test_result_graph_x_scale = '2.php';43$test->test_result_graph_y_scale = '2.php';

Full Screen

Full Screen

perf_per_dollar

Using AI Code Generation

copy

Full Screen

1require_once('phoronix-test-suite.php');2$perf_per_dollar = new perf_per_dollar();3$perf_per_dollar->run();4require_once('phoronix-test-suite.php');5$perf_per_watt = new perf_per_watt();6$perf_per_watt->run();7require_once('phoronix-test-suite.php');8$perf_per_watt_dollar = new perf_per_watt_dollar();9$perf_per_watt_dollar->run();10require_once('phoronix-test-suite.php');11$pts = new pts();12$pts->run();13require_once('phoronix-test-suite.php');14$pts_arrays = new pts_arrays();15$pts_arrays->run();16require_once('phoronix-test-suite.php');17$pts_arrays_results = new pts_arrays_results();18$pts_arrays_results->run();19require_once('phoronix-test-suite.php');20$pts_arrays_results_merge = new pts_arrays_results_merge();21$pts_arrays_results_merge->run();22require_once('phoronix-test-suite.php');23$pts_arrays_results_merge_results = new pts_arrays_results_merge_results();24$pts_arrays_results_merge_results->run();25require_once('ph

Full Screen

Full Screen

perf_per_dollar

Using AI Code Generation

copy

Full Screen

1require_once('pts-core/pts-core.php');2$perfdollar = new perf_per_dollar();3$perf = $perfdollar->get_perf();4$price = $perfdollar->get_price();5$perf_per_dollar = $perfdollar->get_perf_per_dollar($perf,$price);6echo $perf_per_dollar;

Full Screen

Full Screen

perf_per_dollar

Using AI Code Generation

copy

Full Screen

1require_once('phodevi/phodevi.php');2require_once('phodevi/perf/perf.php');3$perf = new pts_performancetest();4$perf->set_test_name('2.php');5$perf->set_test_result(1.0);6$perf->set_test_result(2.0);7$perf->set_test_result(3.0);8$perf->set_test_result(4.0);9$perf->set_test_result(5.0);10$perf->set_test_result(6.0);11$perf->set_test_result(7.0);12$perf->set_test_result(8.0);13$perf->set_test_result(9.0);14$perf->set_test_result(10.0);15$perf->set_test_result(1.0);16$perf->set_test_result(2.0);17$perf->set_test_result(3.0);18$perf->set_test_result(4.0);19$perf->set_test_result(5.0);20$perf->set_test_result(6.0);21$perf->set_test_result(7.0);22$perf->set_test_result(8.0);23$perf->set_test_result(9.0);24$perf->set_test_result(10.0);25$perf->set_test_result(1.0);26$perf->set_test_result(2.0);27$perf->set_test_result(3.0);28$perf->set_test_result(4.0);29$perf->set_test_result(5.0);30$perf->set_test_result(6.0);31$perf->set_test_result(7.0);32$perf->set_test_result(8.0);33$perf->set_test_result(9.0);34$perf->set_test_result(10.0);35$perf->set_test_result(1.0);36$perf->set_test_result(2.0);37$perf->set_test_result(3.0);38$perf->set_test_result(4.0);39$perf->set_test_result(5.0);40$perf->set_test_result(6.0);41$perf->set_test_result(7.0);42$perf->set_test_result(8.0);43$perf->set_test_result(9.0);44$perf->set_test_result(10.0);45$perf->set_test_result(1.0);

Full Screen

Full Screen

perf_per_dollar

Using AI Code Generation

copy

Full Screen

1require_once('phodevi/perf_per_dollar.php');2$perf = new perf_per_dollar();3echo $perf->get_perf_per_dollar();4I think you might be able to use the pts-core::get_results_object() method to get a results object. Then you could use the results object to get the cpu performance. The results object has a get_result() method that you could use to get the cpu performance. The get_result() method takes a result identifier as an argument. The result identifier is a string that identifies the result. For example, the result identifier for the cpu performance is 'CPU_PERFORMANCE'. So, you could use the following code to get the cpu performance:5require_once('phodevi/perf_per_dollar.php');6require_once('pts-core/pts-core.php');7$perf = new perf_per_dollar();8$results_object = pts_core::get_results_object();9$cpu_performance = $results_object->get_result('CPU_PERFORMANCE');10echo $cpu_performance;

Full Screen

Full Screen

Automation Testing Tutorials

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.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Phoronix-test-suite automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Run Selenium Automation Tests on LambdaTest Cloud Grid

Trigger Selenium automation tests on a cloud-based Grid of 3000+ real browsers and operating systems.

Test now for Free

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful