wiki:PerAppCredit

Version 2 (modified by davea, 10 years ago) (diff)

--

Per-app credit

By default, BOINC maintains the credit granted to teams, users, and hosts, both total and average. You can optionally maintain credit for teams and users on a per-application basis. This information is stored in DB tables credit_user and credit_team. Note: doing this will increase DB size and server load.

To maintain per-app credit, put

<credit_by_app/>

in your config.xml file.

Displaying per-app credit

Per-app credit is displayed and exported in terms of sub-projects. A sub-project is a named set of apps. Define your sup-projects in html/project/project.inc in the form

$sub_projects = array(
    array("name" => "Remote Test", "appids" => array(16)),
    array("name" => "Uppercase", "appids" => array(1, 25)),
);

To display per-app credit on your web site (in the user and team pages) you must supply functions

project_user_credit($user)
project_team_credit($team)

in your html/project/project.inc. These functions must generate table rows describing the credit granted to each app for the given user or team.

The example file boinc/html/project.sample/project.inc contains an example of how to do this. Remove the if(0) and change the sub-project specs to suit your project.

Exporting per-app credit

The script html/ops/export_credit_by_app.php exports per-app credit as two files user_work.gz and team_work.gz in your html/stats directory. Run this as a periodic task, with an entry of the form

<task>
   <cmd>run_in_ops ./export_credit_by_app.php</cmd>
   <period>24 hours</period>
   <output>export_credit_by_app.out</output>
</task>

in your config.xml