forked from menault/TD2_DEV51_Qualite_Algo
travail
This commit is contained in:
1
ping-report/diagrammes/better_set_stats_ping.mdj
Normal file
1
ping-report/diagrammes/better_set_stats_ping.mdj
Normal file
File diff suppressed because one or more lines are too long
@@ -270,6 +270,36 @@ void write_ping_log(char* new_ping){
|
||||
Return value :
|
||||
None
|
||||
*/
|
||||
void trop_de_ifs(char* read_line, int* nb_loss, double* ping, int* nb_ping, double* max, double* min, int* nb_high, double* sum){
|
||||
if(strcmp(read_line,"LOSS") == 0){
|
||||
(*nb_loss)++;
|
||||
}else{
|
||||
/* Evaluate the ping as a double */
|
||||
*ping = strtod(read_line,NULL);
|
||||
/* Test null ping */
|
||||
if(*ping < 0.1){
|
||||
/* Ignore null ping */
|
||||
}else{
|
||||
/* Number of ping readed (for mean calculation) */
|
||||
*nb_ping++;
|
||||
/* Max ping */
|
||||
if(*ping > *max){
|
||||
*max = *ping;
|
||||
}
|
||||
/* Min ping */
|
||||
if(*ping < *min){
|
||||
*min = *ping;
|
||||
}
|
||||
/* Number of ping above 100 ms */
|
||||
if(*ping > 100.0){
|
||||
*nb_high++;
|
||||
}
|
||||
/* Sum (for mean calculation) */
|
||||
sum += *ping;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void set_stats_ping(){
|
||||
|
||||
/* Variables */
|
||||
|
Reference in New Issue
Block a user