From 0565005ad3fe6a76a55d50abeaf7bb031da06022 Mon Sep 17 00:00:00 2001 From: schied Date: Tue, 17 Sep 2024 12:34:46 +0200 Subject: [PATCH] Ajout du compte-rendu et des diagrammes. --- compterendu.md | 47 +++++++++++++++++++++++++++ diagrammes/get_ping_from_temp_log.svg | 4 +++ diagrammes/set_stats_ping.svg | 4 +++ 3 files changed, 55 insertions(+) create mode 100644 compterendu.md create mode 100644 diagrammes/get_ping_from_temp_log.svg create mode 100644 diagrammes/set_stats_ping.svg diff --git a/compterendu.md b/compterendu.md new file mode 100644 index 0000000..ec2bf7d --- /dev/null +++ b/compterendu.md @@ -0,0 +1,47 @@ +# Compte-rendu TP +###### Groupe SCHIED Killian, LANDRIN Dylan +## Fichier "deamon.c" +#### Détails +##### create_deamon() +Complexité Cyclomatique : 4 +##### ping_request() +Complexité Cyclomatique : 2 +##### send_check() +Complexité Cyclomatique : 4 +##### check_keep_working() +Complexité Cyclomatique : 4 +##### daemon_work() +Complexité Cyclomatique : 3 +## Fichier "db-sqlite.c" +#### Détails +##### db_connect() +Complexité Cyclomatique : 1 +##### db_disconnect() +Complexité Cyclomatique : 1 +##### insert_hourly_report() +Complexité Cyclomatique : 1 +## Fichier "ping-report.c" +#### Détails +##### main() +Complexité Cyclomatique : 4 +## Fichier "stats.c" +### Avant modification +#### Détails +##### get_ping_from_temp_log() +Complexité Cyclomatique : 15 +##### write_ping_log() +Complexité Cyclomatique : 4 +##### set_stats_ping() +Complexité Cyclomatique : 25 +### Après modification +#### Détails +##### get_ping_from_temp_log() +Complexité Cyclomatique : ? +##### set_stats_ping() +Complexité Cyclomatique : ? +## Fichier "utils.c" +#### Détails +##### write_pid_file() +Complexité Cyclomatique : 2 +##### remove_file() +Complexité Cyclomatique : 1 \ No newline at end of file diff --git a/diagrammes/get_ping_from_temp_log.svg b/diagrammes/get_ping_from_temp_log.svg new file mode 100644 index 0000000..0e1e447 --- /dev/null +++ b/diagrammes/get_ping_from_temp_log.svg @@ -0,0 +1,4 @@ + + + +
if(p_reg == NULL)
if(fd == NULL)
if(regcomp(p_reg,"time=(.*) ms",REG_EXTENDED) != 0)
if(p_reg != NULL)
if(pmatch == NULL)
while(getline(&read_line,&n,fd) != -1)
if(read_line == NULL)
get_ping_from_temp_log()
Sortie
if(regexec(p_reg,read_line,nmatch,pmatch,0) == 0)
if(read_line != NULL)
if(read_line != NULL)
if(ping == NULL)
if(read_line != NULL)
if(read_line != NULL)
Oui                                         Non
Oui                                         Non
Oui                                         Non
Oui                                         Non
Oui                                         Non
Oui                                         Non
Oui                                         Non
Oui                                  Non
Oui                                                       Non
Oui                                             Non
Oui                                             Non
Oui                                             Non
Oui                                 Non
\ No newline at end of file diff --git a/diagrammes/set_stats_ping.svg b/diagrammes/set_stats_ping.svg new file mode 100644 index 0000000..9b0f1a1 --- /dev/null +++ b/diagrammes/set_stats_ping.svg @@ -0,0 +1,4 @@ + + + +
if(fd != NULL)
set_stats_ping()
Oui                                         Non
while(getline(&read_line,&n,fd) != -1)
Oui                                         Non
if(read_line == NULL)
Oui                                         Non
if(read_line != NULL)
Oui                                         Non
Sortie
if(strcmp(read_line,"LOSS") == 0)
Oui                                         Non
if(read_line != NULL)
Oui                                         Non
if(ping < 0.1)
Oui                                         Non
if(read_line != NULL)
Oui                                         Non
if(ping > max)
Oui                                         Non
if(ping < min)
Oui                                         Non
if(ping < min)
Oui                                         Non
if(ping < min)
Oui                                         Non
if(read_line != NULL)
Oui                                         Non
if(read_line != NULL)
Oui                                         Non
if(read_line != NULL)
Oui                                         Non
if(read_line != NULL)
Oui                                         Non
if(ping < min)
Oui                                         Non
if(ping < min)
Oui                                         Non
if(ping < min)
Oui                                         Non
if(read_line != NULL)
Oui                                         Non
if(read_line != NULL)
Oui                                         Non
if(read_line != NULL)
Oui                                         Non
if(read_line != NULL)
Oui                                         Non
\ No newline at end of file