Changeset 974:2091bf698fb1 in freeDiameter for extensions/test_app
- Timestamp:
- Mar 15, 2013, 2:14:35 AM (11 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- extensions/test_app
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/test_app/ta_bench.c
r928 r974 236 236 237 237 /* Now, display the statistics */ 238 fd_log_debug( "------- app_test Benchmark result --------- \n");238 fd_log_debug( "------- app_test Benchmark result ---------"); 239 239 if (now.tv_nsec >= end_time.tv_nsec) { 240 fd_log_debug( " Executing for: %d.%06ld sec \n",240 fd_log_debug( " Executing for: %d.%06ld sec", 241 241 (int)(now.tv_sec + ta_conf->bench_duration - end_time.tv_sec), 242 242 (long)(now.tv_nsec - end_time.tv_nsec) / 1000); 243 243 } else { 244 fd_log_debug( " Executing for: %d.%06ld sec \n",244 fd_log_debug( " Executing for: %d.%06ld sec", 245 245 (int)(now.tv_sec + ta_conf->bench_duration - 1 - end_time.tv_sec), 246 246 (long)(now.tv_nsec + 1000000000 - end_time.tv_nsec) / 1000); 247 247 } 248 fd_log_debug( " %llu messages sent \n", end.nb_sent - start.nb_sent);249 fd_log_debug( " %llu error(s) received \n", end.nb_errs - start.nb_errs);250 fd_log_debug( " %llu answer(s) received \n", end.nb_recv - start.nb_recv);251 fd_log_debug( " Overall: \n");252 fd_log_debug( " fastest: %ld.%06ld sec. \n", end.shortest / 1000000, end.shortest % 1000000);253 fd_log_debug( " slowest: %ld.%06ld sec. \n", end.longest / 1000000, end.longest % 1000000);254 fd_log_debug( " Average: %ld.%06ld sec. \n", end.avg / 1000000, end.avg % 1000000);255 fd_log_debug( " Throughput: %llu messages / sec \n", (end.nb_recv - start.nb_recv) / (( now.tv_sec + ta_conf->bench_duration - end_time.tv_sec ) + ((now.tv_nsec - end_time.tv_nsec) / 1000000000)));256 fd_log_debug( "------------------------------------- \n");248 fd_log_debug( " %llu messages sent", end.nb_sent - start.nb_sent); 249 fd_log_debug( " %llu error(s) received", end.nb_errs - start.nb_errs); 250 fd_log_debug( " %llu answer(s) received", end.nb_recv - start.nb_recv); 251 fd_log_debug( " Overall:"); 252 fd_log_debug( " fastest: %ld.%06ld sec.", end.shortest / 1000000, end.shortest % 1000000); 253 fd_log_debug( " slowest: %ld.%06ld sec.", end.longest / 1000000, end.longest % 1000000); 254 fd_log_debug( " Average: %ld.%06ld sec.", end.avg / 1000000, end.avg % 1000000); 255 fd_log_debug( " Throughput: %llu messages / sec", (end.nb_recv - start.nb_recv) / (( now.tv_sec + ta_conf->bench_duration - end_time.tv_sec ) + ((now.tv_nsec - end_time.tv_nsec) / 1000000000))); 256 fd_log_debug( "-------------------------------------"); 257 257 258 258 } -
extensions/test_app/ta_conf.l
r740 r974 81 81 if (ret != 1) { 82 82 /* No matching: an error occurred */ 83 fd_log_debug("Unable to convert the value '%s' to a valid number: %s \n", yytext, strerror(errno));83 fd_log_debug("Unable to convert the value '%s' to a valid number: %s", yytext, strerror(errno)); 84 84 return LEX_ERROR; /* trig an error in yacc parser */ 85 85 /* Maybe we could REJECT instead of failing here? */ … … 93 93 yylval->string = strdup(yytext+1); 94 94 if (!yylval->string) { 95 fd_log_debug("Unable to copy the string '%s': %s \n", yytext, strerror(errno));95 fd_log_debug("Unable to copy the string '%s': %s", yytext, strerror(errno)); 96 96 TRACE_DEBUG(INFO, "strdup failed"); 97 97 return LEX_ERROR; /* trig an error in yacc parser */ … … 163 163 /* Unrecognized sequence, if it did not match any previous pattern */ 164 164 [^[:space:]"*=>;\n]+ { 165 fd_log_debug("Unrecognized text on line %d col %d: '%s'. \n", yylloc->first_line, yylloc->first_column, yytext);165 fd_log_debug("Unrecognized text on line %d col %d: '%s'.", yylloc->first_line, yylloc->first_column, yytext); 166 166 return LEX_ERROR; 167 167 } -
extensions/test_app/ta_conf.y
r740 r974 72 72 if (ta_confin == NULL) { 73 73 ret = errno; 74 fd_log_debug("Unable to open extension configuration file %s for reading: %s \n", conffile, strerror(ret));74 fd_log_debug("Unable to open extension configuration file %s for reading: %s", conffile, strerror(ret)); 75 75 TRACE_DEBUG (INFO, "Error occurred, message logged -- configuration file."); 76 76 return ret; … … 98 98 99 99 if (ploc->first_line != ploc->last_line) 100 fd_log_debug("%s:%d.%d-%d.%d : %s \n", conffile, ploc->first_line, ploc->first_column, ploc->last_line, ploc->last_column, s);100 fd_log_debug("%s:%d.%d-%d.%d : %s", conffile, ploc->first_line, ploc->first_column, ploc->last_line, ploc->last_column, s); 101 101 else if (ploc->first_column != ploc->last_column) 102 fd_log_debug("%s:%d.%d-%d : %s \n", conffile, ploc->first_line, ploc->first_column, ploc->last_column, s);102 fd_log_debug("%s:%d.%d-%d : %s", conffile, ploc->first_line, ploc->first_column, ploc->last_column, s); 103 103 else 104 fd_log_debug("%s:%d.%d : %s \n", conffile, ploc->first_line, ploc->first_column, s);104 fd_log_debug("%s:%d.%d : %s", conffile, ploc->first_line, ploc->first_column, s); 105 105 } 106 106 -
extensions/test_app/ta_serv.c
r741 r974 47 47 TRACE_ENTRY("%p %p %p %p", msg, avp, sess, act); 48 48 49 fd_log_debug("Unexpected message received! \n");49 fd_log_debug("Unexpected message received!"); 50 50 51 51 return ENOTSUP; -
extensions/test_app/test_app.c
r741 r974 72 72 if (!TRACE_BOOL(INFO)) 73 73 return; 74 fd_log_debug( "------- app_test configuration dump: --------- \n");75 fd_log_debug( " Vendor Id .......... : %u \n", ta_conf->vendor_id);76 fd_log_debug( " Application Id ..... : %u \n", ta_conf->appli_id);77 fd_log_debug( " Command Id ......... : %u \n", ta_conf->cmd_id);78 fd_log_debug( " AVP Id ............. : %u \n", ta_conf->avp_id);79 fd_log_debug( " Mode ............... : %s%s%s \n", ta_conf->mode & MODE_SERV ? "Serv" : "", ta_conf->mode & MODE_CLI ? "Cli" : "", ta_conf->mode & MODE_BENCH ? " (Benchmark)" : "");80 fd_log_debug( " Destination Realm .. : %s \n", ta_conf->dest_realm ?: "- none -");81 fd_log_debug( " Destination Host ... : %s \n", ta_conf->dest_host ?: "- none -");82 fd_log_debug( " Signal ............. : %i \n", ta_conf->signal);83 fd_log_debug( "------- /app_test configuration dump --------- \n");74 fd_log_debug( "------- app_test configuration dump: ---------"); 75 fd_log_debug( " Vendor Id .......... : %u", ta_conf->vendor_id); 76 fd_log_debug( " Application Id ..... : %u", ta_conf->appli_id); 77 fd_log_debug( " Command Id ......... : %u", ta_conf->cmd_id); 78 fd_log_debug( " AVP Id ............. : %u", ta_conf->avp_id); 79 fd_log_debug( " Mode ............... : %s%s%s", ta_conf->mode & MODE_SERV ? "Serv" : "", ta_conf->mode & MODE_CLI ? "Cli" : "", ta_conf->mode & MODE_BENCH ? " (Benchmark)" : ""); 80 fd_log_debug( " Destination Realm .. : %s", ta_conf->dest_realm ?: "- none -"); 81 fd_log_debug( " Destination Host ... : %s", ta_conf->dest_host ?: "- none -"); 82 fd_log_debug( " Signal ............. : %i", ta_conf->signal); 83 fd_log_debug( "------- /app_test configuration dump ---------"); 84 84 } 85 85 … … 107 107 108 108 /* Now, display everything */ 109 fd_log_debug( "------- app_test statistics --------- \n");109 fd_log_debug( "------- app_test statistics ---------"); 110 110 if (now.tv_nsec >= start.tv_nsec) { 111 fd_log_debug( " Executing for: %d.%06ld sec \n",111 fd_log_debug( " Executing for: %d.%06ld sec", 112 112 (int)(now.tv_sec - start.tv_sec), 113 113 (long)(now.tv_nsec - start.tv_nsec) / 1000); 114 114 } else { 115 fd_log_debug( " Executing for: %d.%06ld sec \n",115 fd_log_debug( " Executing for: %d.%06ld sec", 116 116 (int)(now.tv_sec - 1 - start.tv_sec), 117 117 (long)(now.tv_nsec + 1000000000 - start.tv_nsec) / 1000); … … 119 119 120 120 if (ta_conf->mode & MODE_SERV) { 121 fd_log_debug( " Server: %llu message(s) echoed \n", copy.nb_echoed);121 fd_log_debug( " Server: %llu message(s) echoed", copy.nb_echoed); 122 122 } 123 123 if (ta_conf->mode & MODE_CLI) { 124 fd_log_debug( " Client: \n");125 fd_log_debug( " %llu message(s) sent \n", copy.nb_sent);126 fd_log_debug( " %llu error(s) received \n", copy.nb_errs);127 fd_log_debug( " %llu answer(s) received \n", copy.nb_recv);128 fd_log_debug( " fastest: %ld.%06ld sec. \n", copy.shortest / 1000000, copy.shortest % 1000000);129 fd_log_debug( " slowest: %ld.%06ld sec. \n", copy.longest / 1000000, copy.longest % 1000000);130 fd_log_debug( " Average: %ld.%06ld sec. \n", copy.avg / 1000000, copy.avg % 1000000);124 fd_log_debug( " Client:"); 125 fd_log_debug( " %llu message(s) sent", copy.nb_sent); 126 fd_log_debug( " %llu error(s) received", copy.nb_errs); 127 fd_log_debug( " %llu answer(s) received", copy.nb_recv); 128 fd_log_debug( " fastest: %ld.%06ld sec.", copy.shortest / 1000000, copy.shortest % 1000000); 129 fd_log_debug( " slowest: %ld.%06ld sec.", copy.longest / 1000000, copy.longest % 1000000); 130 fd_log_debug( " Average: %ld.%06ld sec.", copy.avg / 1000000, copy.avg % 1000000); 131 131 } 132 fd_log_debug( "------------------------------------- \n");132 fd_log_debug( "-------------------------------------"); 133 133 } 134 134
Note: See TracChangeset
for help on using the changeset viewer.