@@ -136,7 +136,7 @@ extern char *optarg;
136136extern int opterr , optind ;
137137
138138#define APPNAME basename(argv[0])
139- #define VERSION "1.1 .0"
139+ #define VERSION "1.2 .0"
140140#define OPTSTR "i:v:t:h"
141141#define USAGE_FMT "%s -i <file.ini> [-v] [-h] [-t testname]\n"
142142
@@ -301,7 +301,7 @@ int main(int argc, char *argv[])
301301 // Read statistics
302302 for (int i = 0 ; i < get_app_count (); i ++ )
303303 {
304- stats_read_from_file (i );
304+ stats_read_from_file (i , get_app_name ( i ) );
305305 }
306306
307307 // data buffer
@@ -346,11 +346,17 @@ int main(int argc, char *argv[])
346346 {
347347 if (process_is_started (i ))
348348 {
349+ // Update resource usage stats (1 min)
350+ if ((get_uptime () % 60 ) == 0 && process_is_running (i ))
351+ {
352+ stats_update_resource_usage (i , get_app_pid (i ));
353+ }
354+
349355 // Update stats files periodically (15 mins)
350356 if ((get_uptime () % (15 * 60 )) == 0 )
351357 {
352- stats_write_to_file (i );
353- stats_print_to_file (i );
358+ stats_write_to_file (i , get_app_name ( i ) );
359+ stats_print_to_file (i , get_app_name ( i ) );
354360 }
355361
356362 if (!process_is_running (i ))
@@ -435,8 +441,8 @@ int main(int argc, char *argv[])
435441 for (int i = 0 ; i < get_app_count (); i ++ )
436442 {
437443 // Update stats files
438- stats_write_to_file (i );
439- stats_print_to_file (i );
444+ stats_write_to_file (i , get_app_name ( i ) );
445+ stats_print_to_file (i , get_app_name ( i ) );
440446 // Kill running applications
441447 process_kill (i );
442448
0 commit comments