FACT++  1.0
void print_stats ( )

Definition at line 1499 of file dns.c.

References Curr_N_Conns, dim_print_date_time(), Dna_conns, Dns_conns, i, DNS_CONNECTION::n_services, Net_conns, SRC_DIC, and SRC_DIS.

Referenced by main().

1500 {
1501  int i;
1502  int n_conns = 0;
1503  int n_services = 0;
1504  int n_servers = 0;
1505  int n_clients = 0;
1506 
1508  printf(" Connection Statistics :\n");
1509  for(i = 0; i< Curr_N_Conns; i++)
1510  {
1511  switch(Dns_conns[i].src_type)
1512  {
1513  case SRC_DIS :
1514  printf("%d - Server %s@%s (PID %d) %d services\n",
1515  i, Dns_conns[i].task_name,
1516  Dns_conns[i].node_name,
1517  Dns_conns[i].pid, Dns_conns[i].n_services);
1518  fflush(stdout);
1519  n_services += Dns_conns[i].n_services;
1520  n_servers++;
1521  n_conns++;
1522  break;
1523  case SRC_DIC :
1524  printf("%d - Client %s@%s\n",
1525  i, Net_conns[i].task, Net_conns[i].node);
1526  fflush(stdout);
1527  n_conns++;
1528  n_clients++;
1529  break;
1530  default :
1531  if(Dna_conns[i].busy)
1532  {
1533  if(Net_conns[i].task[0] && Net_conns[i].node[0])
1534  printf("%d - Undefined %s@%s\n",
1535  i, Net_conns[i].task,
1536  Net_conns[i].node);
1537  else
1538  printf("%d - Undefined\n", i);
1539  fflush(stdout);
1540  n_conns++;
1541  }
1542  else
1543  {
1544  printf("%d - Empty\n", i);
1545  fflush(stdout);
1546  }
1547  }
1548  }
1549  printf("Number of Connections = %d : %d servers, %d clients\n", n_conns,
1550  n_servers, n_clients);
1551  printf("Number of Services = %d\n", n_services);
1552  fflush(stdout);
1553 }
Definition: dns.c:26
DllExp DIM_NOSHARE int Curr_N_Conns
Definition: conn_handler.c:33
DllExp DIM_NOSHARE DNS_CONNECTION * Dns_conns
Definition: conn_handler.c:29
int i
Definition: db_dim_client.c:21
DllExp DIM_NOSHARE NET_CONNECTION * Net_conns
Definition: conn_handler.c:32
int n_services
Definition: dim.h:440
DllExp DIM_NOSHARE DNA_CONNECTION * Dna_conns
Definition: conn_handler.c:31
void dim_print_date_time()
Definition: utilities.c:134

+ Here is the call graph for this function:

+ Here is the caller graph for this function: