| | 1011 | =head1 THE SCOREBOARD |
| | 1012 | |
| | 1013 | The scoreboards can be used to monitor what the TheSchwartz::Worker subclasses are |
| | 1014 | currently working on. Once the scoreboard has been enabled in the workers with |
| | 1015 | C<set_scoreboard> method the C<thetop> utility (shipped with TheSchwartz distribuition |
| | 1016 | in the C<extras> directory) can be used to list all current jobs being worked on. |
| | 1017 | |
| | 1018 | =head2 C<< $client->set_scoreboard( $dir ) >> |
| | 1019 | |
| | 1020 | Enables the scoreboard. Setting this to C<1> or C<on> will cause TheSchwartz to create |
| | 1021 | a scoreboard file in a location it determines is optimal. |
| | 1022 | |
| | 1023 | Passing in any other option sets the directory the TheSchwartz scoreboard directory should |
| | 1024 | be created in. For example, if you set this to C</tmp> then this would create a directory |
| | 1025 | called C</tmp/theschwartz> and a scoreboard file C</tmp/theschwartz/scoreboard.pid> in it |
| | 1026 | (where pid is the current process pid.) |
| | 1027 | |
| | 1028 | =head2 C<< $client->scoreboard() >> |
| | 1029 | |
| | 1030 | Returns the path to the current scoreboard file. |
| | 1031 | |
| | 1032 | =head2 C<< $client->start_scoreboard() >> |
| | 1033 | |
| | 1034 | Writes the current job information to the scoreboard file (called by the worker |
| | 1035 | in work_safely before it actually starts working) |
| | 1036 | |
| | 1037 | =head2 C<< $client->end_scoreboard() >> |
| | 1038 | |
| | 1039 | Appends the current job duration to the end of the scoreboard file (called by |
| | 1040 | the worker in work_safely once work has been completed) |
| | 1041 | |
| | 1042 | =head2 C<< $client->clean_scoreboard() >> |
| | 1043 | |
| | 1044 | Removes the scoreboard file (but not the scoreboard directory.) Automatically |
| | 1045 | called by TheSchwartz during object destruction (i.e. when the instance goes |
| | 1046 | out of scope) |
| | 1047 | |