2
* This program is free software; you can redistribute it and/or modify
3
* it under the terms of the GNU General Public License as published by
4
* the Free Software Foundation; either version 2 of the License, or
5
* (at your option) any later version.
7
* This program is distributed in the hope that it will be useful,
8
* but WITHOUT ANY WARRANTY; without even the implied warranty of
9
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
* GNU General Public License for more details.
12
* You should have received a copy of the GNU General Public License
13
* along with this program; if not, write to the Free Software
14
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
* Author : Richard GAYRAUD - 04 Nov 2003
21
* Francois-Xavier Kowalski
23
* From Hewlett Packard Company.
28
* Guillaume Teissier from FTR&D
31
* Charles P Wright from IBM Research
35
class stattask *stattask::instance = NULL;
36
class screentask *screentask::instance = NULL;
38
void stattask::initialize() {
39
assert(instance == NULL);
40
if (dumpInFile || useCountf || rate_increase) {
41
instance = new stattask();
45
void screentask::initialize() {
46
assert(instance == NULL);
48
instance = new screentask();
52
void stattask::dump() {
53
WARNING("Statistics reporting task.");
55
void screentask::dump() {
56
WARNING("Screen update task.");
59
void screentask::report(bool last) {
60
print_statistics(last);
61
display_scenario->stats->computeStat(CStat::E_RESET_PD_COUNTERS);
62
last_report_time = getmilliseconds();
66
bool screentask::run() {
72
if (getmilliseconds() - last_report_time >= report_freq) {
80
unsigned int screentask::wake() {
81
return last_report_time + report_freq;
84
void stattask::report() {
86
main_scenario->stats->dumpData();
89
print_count_file(countf, 0);
92
main_scenario->stats->computeStat(CStat::E_RESET_PL_COUNTERS);
93
last_dump_time = clock_tick;
96
bool stattask::run() {
97
/* Statistics Logs. */
98
if((getmilliseconds() - last_dump_time) >= report_freq_dumpLog) {
100
rate += rate_increase;
101
if (rate_max && (rate > rate_max)) {
107
opentask::set_rate(rate);
115
unsigned int stattask::wake() {
116
return last_dump_time + report_freq_dumpLog;