本文整理汇总了PHP中phodevi::sensor_identifier方法的典型用法代码示例。如果您正苦于以下问题:PHP phodevi::sensor_identifier方法的具体用法?PHP phodevi::sensor_identifier怎么用?PHP phodevi::sensor_identifier使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类phodevi
的用法示例。
在下文中一共展示了phodevi::sensor_identifier方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process_perf_per_watt
private static function process_perf_per_watt(&$result_file)
{
$sensor = array('sys', 'power');
$sensor_results = self::parse_monitor_log('logs/' . phodevi::sensor_identifier($sensor) . '.0', self::$individual_test_run_offsets[phodevi::sensor_identifier($sensor) . '.0']);
if (count($sensor_results) > 2 && self::$successful_test_run_request) {
// Copy the value each time as if you are directly writing the original data, each succeeding time in the loop the used arguments gets borked
$test_result = clone self::$successful_test_run_request;
$process_perf_per_watt = true;
$watt_average = array_sum($sensor_results) / count($sensor_results);
switch (phodevi::read_sensor_unit($sensor)) {
case 'Milliwatts':
$watt_average = $watt_average / 1000;
case 'Watts':
break;
default:
$process_perf_per_watt = false;
}
if ($process_perf_per_watt && $watt_average > 0 && $test_result->test_profile->get_display_format() == 'BAR_GRAPH') {
$test_result->test_profile->set_identifier(null);
//$test_result->set_used_arguments_description(phodevi::sensor_name('sys.power') . ' Monitor');
//$test_result->set_used_arguments(phodevi::sensor_name('sys.power') . ' ' . $test_result->get_arguments());
$test_result->test_result_buffer = new pts_test_result_buffer();
if ($test_result->test_profile->get_result_proportion() == 'HIB') {
$test_result->test_profile->set_result_scale($test_result->test_profile->get_result_scale() . ' Per Watt');
$test_result->test_result_buffer->add_test_result(self::$result_identifier, pts_math::set_precision($test_result->active->get_result() / $watt_average));
$result_file->add_result($test_result);
} else {
if ($test_result->test_profile->get_result_proportion() == 'LIB') {
$test_result->test_profile->set_result_proportion('HIB');
$test_result->test_profile->set_result_scale('Performance Per Watt');
$test_result->test_result_buffer->add_test_result(self::$result_identifier, pts_math::set_precision(1 / $test_result->active->get_result() / $watt_average));
$result_file->add_result($test_result);
}
}
self::$perf_per_watt_collection[] = $test_result->active->get_result();
}
}
}
示例2: render_page_process
//.........这里部分代码省略.........
<h3>Test Run Identifier:</h3>
<p>The test run identifier is the per-system name for the system(s) being benchmarked. The following variables may be used: <strong>.SYSTEM</strong>, <strong>.GROUP</strong>. Any custom per-user system variables set via the individual system pages can also be used.</p>
<p><input type="text" name="benchmark_identifier" value="' . (!$is_new ? $e_schedule['Identifier'] : null) . '" /></p>
<h3>Test Suite To Run:</h3>
<p><a href="?build_suite">Build a suite</a> to add/select more tests to run or <a href="?local_suites">view local suites</a> for more information on a particular suite. A test suite is a set of test profiles to run in a pre-defined manner.</p>';
$main .= '<p><select name="suite_to_run">';
foreach ($local_suites as $xml_path) {
$id = basename(dirname($xml_path));
$test_suite = new pts_test_suite($xml_path);
$main .= '<option value="' . $id . '">' . $test_suite->get_title() . ' - ' . $id . '</option>';
}
$main .= '</select></p>';
$main .= '<h3>Description:</h3>
<p>The description is an optional way to add more details about the intent or objective of this test run.</p>
<p><textarea name="benchmark_description" id="benchmark_description" cols="50" rows="3">' . (!$is_new ? $e_schedule['Description'] : null) . '</textarea></p>
<hr /><h3>System Targets:</h3>
<p>Select the systems that should be benchmarked at their next earliest convenience.</p>
<p style="white-space: nowrap;">';
$stmt = phoromatic_server::$db->prepare('SELECT Title, SystemID FROM phoromatic_systems WHERE AccountID = :account_id AND State >= 0 ORDER BY Title ASC');
$stmt->bindValue(':account_id', $_SESSION['AccountID']);
$result = $stmt->execute();
if (!$is_new) {
$e_schedule['RunTargetSystems'] = explode(',', $e_schedule['RunTargetSystems']);
$e_schedule['RunTargetGroups'] = explode(',', $e_schedule['RunTargetGroups']);
}
if ($row = $result->fetchArray()) {
$main .= '<h4>Systems: ';
do {
$main .= '<input type="checkbox" name="run_on_systems[]" value="' . $row['SystemID'] . '" ' . (!$is_new && in_array($row['SystemID'], $e_schedule['RunTargetSystems']) ? 'checked="checked" ' : null) . '/> ' . $row['Title'] . ' ';
} while ($row = $result->fetchArray());
$main .= '</h4>';
}
$stmt = phoromatic_server::$db->prepare('SELECT GroupName FROM phoromatic_groups WHERE AccountID = :account_id ORDER BY GroupName ASC');
$stmt->bindValue(':account_id', $_SESSION['AccountID']);
$result = $stmt->execute();
if ($row = $result->fetchArray()) {
$main .= '<h4>Groups: ';
do {
$main .= '<input type="checkbox" name="run_on_groups[]" value="' . $row['GroupName'] . '" ' . (!$is_new && in_array($row['GroupName'], $e_schedule['RunTargetGroups']) ? 'checked="checked" ' : null) . '/> ' . $row['GroupName'] . ' ';
} while ($row = $result->fetchArray());
$main .= '</h4>';
}
$main .= '</p>
<hr /><h3>Environment Options</h3>
<h4>Stress Testing</h4>
<p>If you wish to test systems for stability/reliability rather than performance, use this option and specify the number of tests to run concurrently (two or more) and (optionally) for the total period of time to continue looping the benchmarks. These options are intended to just stress the system and will not record any benchmark results. From the command-line this testing mode can be used via the <em>phoronix-test-suite stress-run</em> sub-command.</p>
<p><strong>Concurrent Number Of Test Processes:</strong> <select name="PTS_CONCURRENT_TEST_RUNS"><option value="0">Disabled</option>';
for ($i = 2; $i <= 24; $i++) {
$main .= '<option value="' . $i . '">' . $i . '</option>';
}
$main .= '</select></p>
<p><strong>Force Loop Time:</strong> <select name="TOTAL_LOOP_TIME"><option value="0">Disabled</option>';
$s = true;
for ($i = 60; $i <= 60 * 24 * 90; $i += 60) {
if ($i > 10080) {
// 7 days
if ($i % 1440 != 0) {
continue;
}
} else {
if ($i > 480) {
$s = !$s;
if (!$s) {
continue;
}
}
}
$main .= '<option value="' . $i . '">' . pts_strings::format_time($i, 'MINUTES') . '</option>';
}
$main .= '</select></p>
<h4>System Monitoring</h4>
<p>The Phoronix Test Suite system monitor module allows for select hardware/software sensors to be logged in real-time while running the selected test suite. The supported sensors are then shown within the result file upon the test\'s completion.</p>';
foreach (phodevi::available_sensors() as $sensor) {
$main .= '<input type="checkbox" name="MONITOR" value="' . phodevi::sensor_identifier($sensor) . '" /> ' . phodevi::sensor_name($sensor) . ' ';
}
$main .= '<hr /><p align="left"><input name="submit" value="' . ($is_new ? 'Run' : 'Edit') . ' Benchmark" type="submit" onclick="return pts_rmm_validate_schedule();" /></p>
</form>';
}
}
}
$stmt = phoromatic_server::$db->prepare('SELECT * FROM phoromatic_benchmark_tickets WHERE AccountID = :account_id AND State >= 0 AND TicketIssueTime > :time_cutoff ORDER BY TicketIssueTime DESC LIMIT 30');
$stmt->bindValue(':account_id', $_SESSION['AccountID']);
$stmt->bindValue(':time_cutoff', time() - 60 * 60 * 24 * 14);
$result = $stmt->execute();
$right = '<ul><li>Benchmark Tickets</li>';
if ($result) {
$row = $result->fetchArray();
if (!empty($row)) {
do {
$right .= '<li><a href="?benchmark/' . $row['TicketID'] . '">' . $row['Title'] . '</a></li>';
} while ($row = $result->fetchArray());
}
}
$right .= '<li><em><a href="?benchmark/all">View All Past Tickets</a></em></li>';
$right .= '</ul>';
echo phoromatic_webui_header_logged_in();
echo phoromatic_webui_main($main, phoromatic_webui_right_panel_logged_in($right));
echo phoromatic_webui_footer();
}
示例3: read_sensor_results
public function read_sensor_results($sensor, $offset = 0)
{
$results = $this->read_sensor_data($sensor, $offset);
if (empty($results)) {
return false;
}
return array('id' => phodevi::sensor_identifier($sensor), 'name' => phodevi::sensor_name($sensor), 'results' => $results, 'unit' => phodevi::read_sensor_unit($sensor));
}
示例4: monitor_arguments
private static function monitor_arguments()
{
$args = array('all');
foreach (phodevi::available_sensors() as $sensor) {
if (!in_array('all.' . $sensor[0], $args)) {
array_push($args, 'all.' . $sensor[0]);
}
array_push($args, phodevi::sensor_identifier($sensor));
}
return $args;
}