extended for any job state
authorAleš Křenek <ljocha@ics.muni.cz>
Wed, 27 May 2009 11:02:40 +0000 (11:02 +0000)
committerAleš Křenek <ljocha@ics.muni.cz>
Wed, 27 May 2009 11:02:40 +0000 (11:02 +0000)
org.glite.lb.client/examples/stats.c

index af6dcb1..3e68e4f 100644 (file)
@@ -1,4 +1,5 @@
 #include <stdio.h>
+#include <stdlib.h>
 #include <time.h>
 #include <string.h>
 
@@ -17,8 +18,8 @@ int main(int argc,char **argv)
 
        edg_wll_InitContext(&ctx);
 
-       if (argc != 2) { 
-               fprintf(stderr,"usage: %s <CE name>\n",argv[0]);
+       if (argc < 3) { 
+               fprintf(stderr,"usage: %s CE major [minor]\n",argv[0]);
                return 1;
        }       
 
@@ -58,7 +59,7 @@ int main(int argc,char **argv)
        to = now;
        from = now - 60;
 
-       if (edg_wll_StateRate(ctx,group,EDG_WLL_JOB_DONE,EDG_WLL_STAT_FAILED,
+       if (edg_wll_StateRate(ctx,group,atoi(argv[2]),argc >=4 ? atoi(argv[3]) : 0,
                                &from,&to,&val,&from_res,&to_res))
        {
                char    *et,*ed;