Mapper
stats_utilities.c
Go to the documentation of this file.
1 /*
2  ---------------------------------------------------------------------
3 
4  NAME
5  stats_utilities
6 
7  PURPOSE
8  Collection of functions to be used with the shef_decode to
9  account for statistics.
10 
11  VERSION and UPDATES
12  1.0 Feb 95 David G. Brandon
13  1.1 SEP 95 DGB
14  Use 'strstr' for routines when accounting for type/source.
15  1.2 OCT 95 DGB
16  Read only directory in shef_.files_log and not the
17  directory and the filename. Filename now always 'stats'.
18  Add arrays of TS and TSNAMEs to automatically construct
19  headers. This is is utility, stats_print. Change
20  stats_read to use strtok for more robust reading of
21  file. Add the stop/start time in number of seconds
22  for easier manipulation.
23  1.3 JUL 15 96 DGB
24  Add a few exit(0) statements on file open errors.
25  1.4 JUL 20 96 DGB
26  Change SAO to MTR for metar reports.
27  1.5 AUG 9 96 DGB
28  Change RS to RO for ASOS type obs. Add FA and FU
29  (future model adjusted and future model unadjusted)
30  to type source list.
31  1.6 AUG 12 96 DGB
32  Remove check for MTR/SAO products changing all to RV.
33  Now RV and RO are separate and distinguishable.
34  1.7 SEP 10 96 DGB
35  Hold on a little partner...change MTR to RV for
36  stats purposes until everything can be settled in
37  the database.
38  1.8 SEP 22 96 DGB
39  Include shef_structs_external from a file instead of
40  hard coded.
41  Include new option to log and print out the time
42  of the last posting by TS codes. For example, the
43  last time that a domsat report was posted, or a metar
44  report was posted.
45  1.9 NOV 04 96 DGB
46  Make changes to the quality flag fiddling around
47  utilitity for accounting of domsat and hads reports..
48  i.e. change checking of lwal flag from S to D and
49  from F to A.
50  2.0 MAR 18 97 DGB
51  Add checking stats for PE codes and TS codes that
52  are recevied but not located in the *.cfg file.
53  Any unknown PE code will be summed in 'ZZ' and
54  and unknown TS code will be summed in 'TS'.
55  2.1x SEP 10 97 DGB
56  Add the use of MAX_SHEF_INPUT so that the input line can
57  be longer than 80 characters.
58  2.2 JAN 3 99 DGB
59  Change quality 'A' to 'Y'.
60  2.3 OCT 21 2000 DGB
61  Add two new array values, stats_.parse[4] and stats_.parse[5]
62  These will contain the number of Inserts and Updates
63  respectively. Individual posting of values in the arrays
64  will remain as before.
65  Add check_pets function.
66  2.4 JUN 19 01 DGB
67  Add three TS values, PE, HE, FU
68  2.5 OCT 3 02 DGB
69  change strcpy to strncpy
70  ---------------------------------------------------------------------
71  */
72 #define _POSIX_SOURCE
73 #include <stdio.h>
74 #include <stdlib.h>
75 #include <ctype.h>
76 #include <dirent.h>
77 #include <unistd.h>
78 #include <math.h>
79 #include <string.h>
80 #include <fcntl.h>
81 #include <time.h>
82 #include <sys/stat.h>
83 #include "shef_structs_external.h"
84 
85 
86 void stats_init( char * logname )
87 {
88  int i, k, ii, flag;
89  char buff_temp[MAX_SHEF_INPUT], buffer[MAX_SHEF_INPUT]; /* dgb:09/10/97 */
90  struct tm current, start;
91  struct stat buf;
92 
93  /*
94  * Get/set time variables.
95  */
96  if ( DEBUG )
97  {
98  printf("\n begin stats_init");
99  fflush(stdout);
100  }
101  stats_.time_current = time(NULL);
102  current = *gmtime(&stats_.time_current);
103 
104  strftime(buff_temp,sizeof(buff_temp),
105  "/stats.%m%d.000000",
106  gmtime(&stats_.time_current));
107  sprintf(buffer,"%s%s",logname,buff_temp); /* dgb:10/01/95 add stats name */
108 
109  /* See if file exists..if yes open it. If not */
110  /* open a new file with the new day. */
111 
112  /* Open previous stats file */
113  if ( stat(buffer, &buf) != -1 )
114  {
115 
116  if ( (fp_postlog = fopen(buffer,"r+w+")) == NULL )
117  {
118  fprintf(stdout,"shef_decode:error on opening stats file->%s",
119  buffer);
120  exit(0); /* dgb:07/15/96 */
121  }
122  /* Read in previous stats file */
123  stats_.flag = 1;
124  stats_read();
125  stats_print();
126  }
127  else
128  {
129  /* Open a new file for the day */
130 
131  if ( (fp_postlog = fopen(buffer,"wr")) == NULL )
132  {
135  stats_.flag = 0;
136  stats_print();
137  fprintf(stdout,"shef_decode:error on opening stats file->%s",
138  buffer);
139  exit(0); /* dgb: 07/15/96 */
140  }
142 
143  for ( k = 0; k < stats_.num_ts; k++) /* dgb:09/22/96 */
144  strncpy(&stats_.ts_post_time[k][0]," 00:00",sizeof( &stats_.ts_post_time[k][0])); /* dgb:10/03/02 */
145 
146  /* Clear stats arrays */
147  for ( i = 0; i < MAX_ACCEPTABLE_PE+1; i++)
148  {
149  for ( k = 0; k < MAX_ACCEPTABLE_TS+1; k++ )
150  stats_.post_stats[ i ][ k ] = 0;
151  }
152 
153  for ( k = 0; k < MAX_ACCEPTABLE_CATEGORIES+1; k++)
154  stats_.parse_stats[ k ] = 0;
155  }
156  }
157 
159 {
160  char *ts[40], *tsname[40];
161  int i, k, flag;
162  char buff_temp[200];
163 
164  char *tsname_default = "UNKNWN";
165  fpos_t position;
166  long endfil;
167  struct tm current, start;
168 
169  ts[0] = "RM"; tsname[0] = "SNOTEL";
170  ts[1] = "RG"; tsname[1] = "S.DOM";
171  ts[2] = "RF"; tsname[2] = "R.DOM";
172  ts[3] = "RH"; tsname[3] = "HADS";
173  ts[4] = "RO"; tsname[4] = "ASOS"; /* dgb:08/09/96 */
174  ts[5] = "RV"; tsname[5] = "MTR"; /* dgb:07/20/96 */
175  ts[6] = "R4"; tsname[6] = "ROSA";
176  ts[7] = "RR"; tsname[7] = "ALERT#1";
177  ts[8] = "RP"; tsname[8] = "LARCS"; /* dgb:11/04/96 */
178  ts[9] = "R1"; tsname[9] = "RR #";
179  ts[10]= "FZ"; tsname[10]= "FUTURE";
180  ts[11]= "RZ"; tsname[11]= "DEFAULT";
181  ts[12]= "1M"; tsname[12]= "P1SNOW";
182  ts[13]= "2M"; tsname[13]= "P2SNOW";
183  ts[14]= "3M"; tsname[14]= "P3SNOW";
184  ts[15]= "1G"; tsname[15]= "P1GOES";
185  ts[16]= "2G"; tsname[16]= "P2GOES";
186  ts[17]= "3G"; tsname[17]= "P3GOES";
187  ts[18]= "FA"; tsname[18]= "F ADDJ1"; /* dgb:08/09/96 */
188  ts[19]= "FU"; tsname[19]= "F UADJ1"; /* dgb:08/09/96 */
189  ts[20]= "FE"; tsname[20]= "F PUBL";
190  ts[21]= "FW"; tsname[21]= "F UADJ3";
191  ts[22]= "RS"; tsname[22]= "ALERT#2";
192  ts[23]= "1Z"; tsname[23]= "1DEFALT";
193  ts[24]= "1P"; tsname[24]= "lLARC";
194  ts[25]= "1R"; tsname[25]= "1ALERT";
195  ts[26]= "PE"; tsname[26]= "HIS SIM"; /* dgb:06/19/01 */
196  ts[27]= "HE"; tsname[27]= "HIS OBS"; /* dgb:06/19/01 */
197  ts[28]= "FU"; tsname[28]= "CON SIM"; /* dgb:06/19/01 */
198  ts[29]= NULL;
199  ts[30]= NULL;
200  ts[31]= NULL;
201  ts[32]= NULL;
202  ts[33]= NULL;
203  ts[34]= NULL;
204  ts[35]= NULL;
205  ts[36]= NULL;
206  ts[37]= NULL;
207  ts[38]= NULL;
208  ts[39]= NULL;
209 
210  /* Place file pointer at the beginning of the log */
211 
212  rewind(fp_postlog);
213  stats_.time_current = time(NULL);
214  current = *gmtime(&stats_.time_current);
215 
216 
217  fprintf(fp_postlog,"\n LOG FOR SHEF PARSING & POSTING - Program: %s ",
218  pname);
219  if ( stats_.flag == 1 )
220  {
221  strftime(buff_temp,sizeof(buff_temp),
222  "%H:%M %D",gmtime(&stats_.time_start_log));
224  "\n LOG_START_TIME-------------> %s (%ld)",
225  buff_temp, stats_.time_start_log);
226  }
227  else
228  {
229  strftime(buff_temp,sizeof(buff_temp),"%H:%M %D",
230  gmtime(&stats_.time_start_log));
232  "\n LOG_START_TIME-------------> %s (%ld)",
233  buff_temp, stats_.time_start_log);
234  }
235  strftime(buff_temp,sizeof(buff_temp),"%H:%M %D",
236  gmtime(&stats_.time_current));
237  fprintf(fp_postlog,"\n LOG_CURRENT_TIME-----------> %s (%ld)",
238  buff_temp, stats_.time_current);
239 
240  fprintf(fp_postlog,"\n\n< PARSING STATISTICS >");
241  fprintf(fp_postlog,"\n #PRODUCTS #RECORDS #ERRORS #WARNINGS");
242  fprintf(fp_postlog,"\n %8ld %8ld %8ld %8ld",
243  stats_.parse_stats[0],
244  stats_.parse_stats[1],
245  stats_.parse_stats[2],
246  stats_.parse_stats[3]);
247 
248  fprintf(fp_postlog,"\n\n< INSERT/UPDATE RECORDS STATISTICS >"); /* dgb:10/21/00 */
249  fprintf(fp_postlog,"\n #INSERTS #UPDATES"); /* dgb:10/21/00 */
250  fprintf(fp_postlog,"\n %8ld %8ld",
251  stats_.parse_stats[4],
252  stats_.parse_stats[5]); /* dgb:10/21/00 */
253 
254 
255  fprintf(fp_postlog,"\n\n< ARRAY POSTING STATISTICS >\n "); /* dgb:10/21/00 */
256 
257  for ( i = 0; i < stats_.num_ts; i++ )
258  {
259  flag = 0;
260  k = 0;
261  while ( ts[k] != NULL )
262  {
263  if ( strcmp(stats_.acceptable_ts[i],ts[k]) == 0 )
264  {
265  flag = 1;
266  break;
267  }
268  k++;
269  }
270 
271  if ( !flag )
272  fprintf(fp_postlog," %s",tsname_default);
273  else
274  fprintf(fp_postlog,"%7.7s",tsname[k]);
275 
276  flag = 0;
277 
278  }
279 
280  fprintf(fp_postlog,"\nPE ");
281 
282 
283  for ( i = 0; i < stats_.num_ts; i++ )
285  fprintf(fp_postlog," TOTALS");
286 
287  for ( i = 0; i < stats_.num_pe; i++ )
288  {
289 
291  fprintf(fp_postlog,"\n%-3.3s", stats_.acceptable_pe[i]);
292  for ( k = 0; k < stats_.num_ts; k++)
293  {
296  stats_.post_stats[i][k];
297  fprintf(fp_postlog," %6ld", stats_.post_stats[i][k]);
298  }
299 
301  }
302 
303  for ( i = 0; i < stats_.num_ts+1; i++ )
304  {
306  for ( k = 0; k < stats_.num_pe; k++)
307  {
310  stats_.post_stats[k][i];
311  }
312  }
313 
314  fprintf(fp_postlog,"\n ");
315 
316  for ( k = 0; k < stats_.num_ts; k++)
319 
320 
321  /* print last post update-time in Zulu for each TS */
322  /* following code was added dgb:09/22/96 */
323  fprintf(fp_postlog,"\n\n ");
324  for ( k = 0; k < stats_.num_ts; k++)
325  fprintf(fp_postlog,"%-7.7s",&stats_.ts_post_time[k][0]);
326  fprintf(fp_postlog,"\n");
327 
328  /* set file pointer to end of file */
329  fseek(fp_postlog,0L,SEEK_END);
330 }
331 
332 int stats_updates( char kodp, char kode, char kodd, char kodt, char kods )
333 {
334  int i, k, len;
335  int found; /* dgb:03/18/97 */
336  char buff_pe[PE_SIZE], buff_ts[TS_SIZE];
337  char buff_temp[10]; /* dgb:09/22/96 */
338 
339 
340  if ( DEBUG )
341  {
342  fprintf(stdout,"\n stats_updates:begin");
343  fprintf(stdout,
344  "\n kodp = %c kode = %c kodd = %c kodt = %c kods = %c", kodp,kode,kodd,kodt,kods);
345  }
346 
347  buff_pe[0] = kodp;
348  buff_pe[1] = kode;
349  buff_pe[2] = kodd;
350  buff_pe[3] = 0;
351  buff_ts[0] = kodt;
352  buff_ts[1] = kods;
353  buff_ts[2] = 0;
354 
355  /* look to see if pe is in list...if not assign it ZZ */
356  found = 0;
357  for ( i = 0; i < stats_.num_pe; i++)
358  {
359  if ( strlen(stats_.acceptable_pe[i]) == 3 )
360  len = 3;
361  else
362  len = 2;
363  if ( strncmp(stats_.acceptable_pe[i],buff_pe,len) == 0 )
364  {
365  found = 1;
366  i = stats_.num_pe;
367  }
368  }
369  if ( !found )
370  {
371  buff_pe[0] = 90;
372  buff_pe[1] = 90;
373  buff_pe[2] = 90;
374  buff_pe[3] = 0;
375  }
376 
377  for ( i = 0; i < stats_.num_pe; i++)
378  {
379  if ( strlen(stats_.acceptable_pe[i]) == 3 ) /* dgb:10/26/95 */
380  len = 3;
381  else
382  len = 2;
383 
384  if ( strncmp(stats_.acceptable_pe[i],buff_pe,len) == 0 )
385  {
386 
387  found = 0;
388  for ( k = 0; k < stats_.num_ts; k++ )
389  {
390  if ( strcmp(stats_.acceptable_ts[k],buff_ts) == 0 )
391  {
392  stats_.post_stats[i][k]++;
393  strftime(buff_temp,sizeof(buff_temp)," %H:%M", gmtime(&stats_.time_current));
394  strncpy(&stats_.ts_post_time[k][0],buff_temp,sizeof(&stats_.ts_post_time[k][0] )); /* dgb:10/03/02 */
395  found = 1; /* dgb:03/18/97 */
396  k = stats_.num_ts; /* dgb:03/18/97 */
397  }
398  }
399  if ( !found ) /* dgb:03/18/97 */
400  {
401  strncpy(buff_ts,"RZ",sizeof(buff_ts)); /* dgb:10/03/02 */
402  for ( k = 0; k < stats_.num_ts; k++ )
403  {
404  if ( strcmp(stats_.acceptable_ts[k],buff_ts) == 0 )
405  {
406  stats_.post_stats[i][k]++;
407  strftime(buff_temp,sizeof(buff_temp)," %H:%M", gmtime(&stats_.time_current));
408  strncpy(&stats_.ts_post_time[k][0],buff_temp,sizeof(&stats_.ts_post_time[k][0] )); /* dgb:10/03/02 */
409  return(0);
410  }
411  }
412  }
413  return(0);
414  }
415  }
416 
417 return(0);
418 
419 }
420 
422 
423 {
424  int i, k, month, day, year, ztime, find_data;
425  char buffer[200];
426  char zbuff[8];
427  char *c, *str1, *str2;
428  fpos_t position;
429  long endfil;
430  struct tm tempdate;
431 
432  /* Place file pointer at the beginning of the log */
433  memset(stats_.dtg,0,sizeof(stats_.dtg));
434 
435 
436  find_data = 0;
437  /* find start at string -> .begin */
438  while ( fgets(buffer,sizeof(buffer),fp_postlog) != NULL )
439  {
440 
441  if ( strstr(buffer,"START_") != NULL )
442  {
443  if ( (c = strchr(buffer,'(')) != NULL )
444  {
445  stats_.time_start_log = atol(c+1);
446  strftime(stats_.dtg,sizeof(stats_.dtg),
447  "%H:%M %D",gmtime(&stats_.time_start_log));
448 
449  }
450  }
451  if ( strstr(buffer,"#PROD") != NULL )
452  {
453  if ( fgets(buffer,sizeof(buffer),fp_postlog) == NULL )
454  break;
455  else
456  {
457  sscanf(buffer,"%ld %ld %ld %ld",
458  &stats_.parse_stats[0],
459  &stats_.parse_stats[1],
460  &stats_.parse_stats[2],
461  &stats_.parse_stats[3]);
462  }
463  }
464  if ( strstr(buffer,"#INSER") != NULL ) /* DGB:10/21/00 */
465  {
466  if ( fgets(buffer,sizeof(buffer),fp_postlog) == NULL )
467  break;
468  else
469  {
470  sscanf(buffer,"%ld %ld",
471  &stats_.parse_stats[4],
472  &stats_.parse_stats[5]);
473  }
474  }
475  if ( strstr(buffer,"PE ") != NULL )
476  {
477  for ( i = 0; i < stats_.num_pe; i++ )
478  {
479  fgets(buffer,sizeof(buffer),fp_postlog);
480  str2 = buffer;
481  for ( k = 0; k < stats_.num_ts + 1 ; k++)
482  {
483  str1=strtok(str2," \t\n\r");
484  str2=0;
485  if ( k != 0 )
486  stats_.post_stats[i][k-1] = atoi(str1);
487  }
488  }
489 
490  /* read update times each TS */
491  /* following code was added dgb:09/22/96 */
492  memset(buffer,0,sizeof(buffer));
493 
494  fgets(buffer,sizeof(buffer),fp_postlog);
495  fgets(buffer,sizeof(buffer),fp_postlog);
496  fgets(buffer,sizeof(buffer),fp_postlog);
497 
498  str2 = buffer;
499  for ( k = 0; k < stats_.num_ts; k++)
500  {
501  str1 = strtok(str2," \t\n\r");
502  str2 = 0;
503  sprintf(&stats_.ts_post_time[k][0]," %-5.5s",str1);
504  }
505  }
506  }
507 }
508 
509 void stats_ts( char *t, char *s , char *lwal)
510 {
511 
512 
513  if ( DEBUG )
514  {
515  fprintf(stdout,"\n stats_ts:begin");
516  fprintf(stdout,"\n t = %c s = %c q = %c",*t,*s,*lwal);
517  }
518 
519  /*
520  Play around with type/source and possibly change base
521  upon the product name in which the data are received.
522  This is necessary, since some systems/sensors send
523  only the default type/source codes.
524 
525  */
526 
527 
528  /*
529  GOES data ... keep routine reports as 'RG'
530  for accounting purposes, convert random transmissions
531  to 'RF'.
532  */
533 
534 
535  if ( *t == 'R' && *s == 'G' )
536  {
537  if ( *lwal == 'Y' ) /* dgb:01/03/99 */
538  *s = 'F';
539  else
540  if ( *lwal == 'D' ) /* dgb:11/04 96 */
541  *s = 'G';
542  else
543  *s = 'H';
544  }
545 
546  else
547 
548  /* MTR for METAR Products */
549  if ( strstr(stats_.product_name,"out.") != 0 )
550  {
551  *t = 'R';
552  *s = 'V';
553  }
554 
555 
556  /* RR1 Data products */
557  if ( strstr(stats_.product_name,"RR1") != 0 ) /* dgb:09/26/95 change to strstr */
558  {
559  *t = 'R';
560  *s = '1';
561  }
562 
563  else
564 
565  /* RR2 Data products */
566  if ( strstr(stats_.product_name,"RR2") != 0 ) /* dgb:09/26/95 change to strstr */
567  {
568  *t = 'R';
569  *s = '1';
570  }
571 
572  else
573  /* ROSA RR3 Data products */
574  if ( strstr(stats_.product_name,"RR3") != 0 ) /* dgb:09/26/95 change to strstr */
575  {
576  *t = 'R';
577  *s = '4';
578  }
579 
580  else
581  /* ROSA RR4 Data products */
582  if ( strstr(stats_.product_name,"RR4") != 0 ) /* dgb:09/26/95 change to strstr */
583  {
584  *t = 'R';
585  *s = '4';
586  }
587 
588  else
589  /* ASOS RR6 Data products */
590  if ( strstr(stats_.product_name,"RR6") != 0 ) /* dgb:09/26/95 change to strstr */
591  {
592  *t = 'R';
593  *s = 'S';
594  }
595 
596  else
597 
598  /* ASOS RR7 Data products */
599  if ( strstr(stats_.product_name,"RR7") != 0 ) /* dgb:09/26/95 change to strstr */
600  {
601  *t = 'R';
602  *s = 'S';
603  }
604 
605  else
606  /* RR8 products */
607  if ( strstr(stats_.product_name,"RR8SLR") != 0 ) /* dgb:09/26/95 change to strstr */
608  {
609  *t = 'R';
610  *s = 'V';
611  }
612 }
613 
614 check_pets( int flag )
615 {
616 int i,j;
617 char buffer[300];
618 char buffer1[300];
619 char *c;
620 
621 /*
622 flag = 1
623  open and read file into array
624 flag = 2
625  update array of PE and TS
626 flag = 3
627  open and re-save array to file
628 */
629 
630  if ( flag == 1 )
631  {
632  if ( (pets_.fp_pets = fopen(pets_.name,"r")) == NULL )
633  return(-1);
634 
635  fgets(pets_.pe,sizeof(buffer),pets_.fp_pets);
636  fgets(pets_.ts,sizeof(buffer),pets_.fp_pets);
637  if ( (c = strchr(pets_.pe,10)) != NULL )
638  memset(c,0,1);
639  if ( (c = strchr(pets_.ts,10)) != NULL )
640  memset(c,0,1);
641  if ( pets_.fp_pets != NULL )
642  {
643  fclose(pets_.fp_pets);
644  pets_.fp_pets = 0;
645  }
646  }
647  else if ( flag == 2 )
648  {
649 
650 
651  pets_.pes[0] = pets_.kodp;
652  pets_.pes[1] = pets_.kode;
653  pets_.pes[2] = 0;
654  pets_.tss[0] = pets_.kodt;
655  pets_.tss[1] = pets_.kods;
656 
657  j = strlen(pets_.pe);
658  if (i = strpat(pets_.pe,pets_.pes,'%','%',NULL,NULL, j ) < 0 )
659  {
660 
661  strncpy(&pets_.pe[j],pets_.pes,2);
662  memset(&pets_.pe[j+2],32,1);
663 
664  }
665 
666  j = strlen(pets_.ts);
667  if (i = strpat(pets_.ts,pets_.tss,'%','%',NULL,NULL, j ) < 0 )
668  {
669  strncpy(&pets_.ts[j],pets_.tss,2);
670  memset(&pets_.ts[j+2],32,1);
671  }
672  }
673  else if ( flag == 3 )
674  {
675  if ( (pets_.fp_pets = fopen(pets_.name,"w")) == NULL )
676  return(-1);
677 
678 
679  memset(&pets_.pe[strlen(pets_.pe)],10,1);
680  fputs(pets_.pe,pets_.fp_pets);
681 
682  memset(&pets_.ts[strlen(pets_.ts)],10,1);
683 
684  fputs(pets_.ts,pets_.fp_pets);
685 
686 
687  if ( pets_.fp_pets != NULL )
688  {
690  pets_.fp_pets = 0;
691  }
692  }
693 }
694 
695 
696 
static int i
int day
Definition: display_data.c:26
int year
Definition: display_data.c:26
int month
Definition: display_data.c:26
int DEBUG
Definition: shef_structs.h:248
struct stat buf
Definition: is_file_closed.c:8
fclose(fp)
sprintf(fbuf,"/usr/mapper/nexrad/ngrid.%02d-%02d-%02d-%02d", year, month, day, hour)
printf("fbuf is %s\n", fbuf)
fprintf(fp,"%d %d %d %d 1\n", iminx, iminy, maxi, maxj)
int j
Definition: mapp2h.h:48
int k
Definition: mapp2h.h:48
#define MAX_ACCEPTABLE_CATEGORIES
Definition: shef.h:29
#define MAX_ACCEPTABLE_TS
Definition: shef.h:27
#define PE_SIZE
Definition: shef.h:24
#define MAX_SHEF_INPUT
Definition: shef.h:38
#define TS_SIZE
Definition: shef.h:25
#define MAX_ACCEPTABLE_PE
Definition: shef.h:26
struct t_stats_ stats_
char * pname
Definition: shef_structs.h:264
FILE * fp_postlog
Definition: shef_structs.h:262
struct pets_check pets_
stats_read(void)
check_pets(int flag)
void stats_ts(char *t, char *s, char *lwal)
int stats_updates(char kodp, char kode, char kodd, char kodt, char kods)
void stats_init(char *logname)
stats_print()
strpat(char buffer[], char token[], int numtemp, int chartemp)
Definition: strpat.c:30
char name[200]
Definition: shef_structs.h:241
char pes[3]
Definition: shef_structs.h:243
char ts[MAX_BUFF_CFG_LINE]
Definition: shef_structs.h:242
char tss[3]
Definition: shef_structs.h:243
char pe[MAX_BUFF_CFG_LINE]
Definition: shef_structs.h:242
FILE * fp_pets
Definition: shef_structs.h:240
int parse_stats[MAX_ACCEPTABLE_CATEGORIES+1]
Definition: shef_structs.h:201
long time_start_log
Definition: shef_structs.h:195
char product_name[30]
Definition: shef_structs.h:208
char dtg[40]
Definition: shef_structs.h:206
int post_stats[MAX_ACCEPTABLE_PE+1][MAX_ACCEPTABLE_TS+1]
Definition: shef_structs.h:199
char acceptable_ts[MAX_ACCEPTABLE_TS+1][TS_SIZE]
Definition: shef_structs.h:203
char ts_post_time[MAX_ACCEPTABLE_TS+1][8]
Definition: shef_structs.h:200
long time_current
Definition: shef_structs.h:194
char acceptable_pe[MAX_ACCEPTABLE_PE+1][PE_SIZE]
Definition: shef_structs.h:202
long time_stop_log
Definition: shef_structs.h:196
Definition: misc_new.h:35