File: credit_test.php

package info (click to toggle)
boinc 7.14.2%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 111,132 kB
  • sloc: cpp: 163,589; php: 113,173; ansic: 49,284; pascal: 35,620; xml: 17,864; java: 13,521; python: 6,551; sh: 4,082; perl: 1,843; makefile: 1,796; objc: 1,543; sql: 959; csh: 126; lisp: 47
file content (30 lines) | stat: -rw-r--r-- 987 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php

// generate a data file for use by credit_test.php

require_once("../inc/boinc_db.inc");

db_init();

$min_claimed_credit = 0;
$max_claimed_credit = 5000;
$limit = 0;
$appid = 2;

$query = "select result.id, result.workunitid, result.appid, result.hostid, result.claimed_credit, result.app_version_id, result.elapsed_time, result.flops_estimate, result.cpu_time, workunit.rsc_fpops_est from result, workunit where workunit.id = result.workunitid and result.validate_state=1 and claimed_credit > $min_claimed_credit and claimed_credit < $max_claimed_credit and app_version_id<>0";

if ($appid) {
    $query .= " and result.appid = $appid";
}
if ($limit) {
    $query .= " limit $limit";
}

$r = _mysql_query($query);
$f = fopen("credit_test_data", "w");
while ($x = _mysql_fetch_object($r)) {
    fprintf($f, "$x->id $x->workunitid $x->appid $x->hostid $x->claimed_credit $x->app_version_id $x->elapsed_time $x->flops_estimate $x->cpu_time $x->rsc_fpops_est\n");
}
fclose($f);

?>