Stat type definitions separated from declarations to suppress compiler warnings
authorZdeněk Šustr <sustr4@cesnet.cz>
Thu, 23 Aug 2012 14:30:31 +0000 (14:30 +0000)
committerZdeněk Šustr <sustr4@cesnet.cz>
Thu, 23 Aug 2012 14:30:31 +0000 (14:30 +0000)
org.glite.lb.server/src/server_stats.c
org.glite.lb.server/src/server_stats.h

index a8006b9..31461b3 100644 (file)
@@ -16,6 +16,40 @@ static int serverStatisticsFD;
 static int stats_in_tmp = 0;
 static int msync_counter = 0;
 
+char *edg_wll_server_statistics_type_title[] = {
+        "gLite job regs",
+        "PBS job regs",
+        "Condor job regs",
+        "CREAM job regs",
+        "Sandbox regs",
+        "Job events",
+        "HTML accesses",
+        "Plain text accesses",
+        "RSS accesses",
+        "Notification regs (legacy interface)",
+        "Notification regs (msg interface)",
+        "Notifications sent (legacy)",
+        "Notifications sent (msg)",
+        "WS queries",
+        "L&B protocol accesses" };
+
+char *edg_wll_server_statistics_type_key[] = {
+        "glite_jobs",
+        "pbs_jobs",
+        "condor_jobs",
+        "cream_jobs",
+        "sb_ft_jobs",
+        "events",
+        "queries_html",
+        "queries_text",
+        "queries_rss",
+        "notif_regs_legacy",
+        "notif_regs_msg",
+        "notifs_legacy",
+        "notis_msg",
+        "queries_ws",
+        "queries_api" };
+
 int edg_wll_InitServerStatistics(edg_wll_Context ctx, char *prefix)
 {
        //TODO get file name from command line
@@ -97,7 +131,7 @@ int edg_wll_InitServerStatistics(edg_wll_Context ctx, char *prefix)
         return 0;
 }
 
-int edg_wll_ServerStatisticsIncrement(edg_wll_Context ctx, enum edg_wll_server_statistics_type type)
+int edg_wll_ServerStatisticsIncrement(edg_wll_Context ctx, edg_wll_server_statistics_type type)
 {
        if (! serverStatisticsMap)
                return -1;
@@ -119,7 +153,7 @@ int edg_wll_ServerStatisticsIncrement(edg_wll_Context ctx, enum edg_wll_server_s
        return 0;
 }
 
-int edg_wll_ServerStatisticsGetValue(edg_wll_Context ctx, enum edg_wll_server_statistics_type type)
+int edg_wll_ServerStatisticsGetValue(edg_wll_Context ctx, edg_wll_server_statistics_type type)
 {
        if (! serverStatisticsMap)
                return -1;
@@ -138,7 +172,7 @@ int edg_wll_ServerStatisticsGetValue(edg_wll_Context ctx, enum edg_wll_server_st
         return ret;
 }
 
-time_t* edg_wll_ServerStatisticsGetStart(edg_wll_Context ctx, enum edg_wll_server_statistics_type type)
+time_t* edg_wll_ServerStatisticsGetStart(edg_wll_Context ctx, edg_wll_server_statistics_type type)
 {
        if (! serverStatisticsMap)
                return NULL;
index 152e0d3..9e27404 100644 (file)
@@ -13,7 +13,7 @@ typedef struct _edg_wll_server_statistics{
        time_t start;
 } edg_wll_server_statistics;
 
-enum edg_wll_server_statistics_type{
+typedef enum _edg_wll_server_statistics_type{
        SERVER_STATS_GLITEJOB_REGS = 0,
        SERVER_STATS_PBSJOB_REGS,
        SERVER_STATS_CONDOR_REGS,
@@ -30,48 +30,18 @@ enum edg_wll_server_statistics_type{
        SERVER_STATS_WS_QUERIES,
        SERVER_STATS_LBPROTO,
        SERVER_STATISTICS_COUNT
-};
+} edg_wll_server_statistics_type;
 // Add new values in front of LAST and do not change order
+// Also for new vales, add text descriptions to server_stats.c
+extern char     *edg_wll_QueryAttrNames[];
+extern char     *edg_wll_QueryOpNames[];
 
-static const char *edg_wll_server_statistics_type_title[] = {
-       "gLite job regs",
-       "PBS job regs",
-       "Condor job regs",
-       "CREAM job regs",
-       "Sandbox regs",
-       "Job events",
-       "HTML accesses",
-       "Plain text accesses",
-       "RSS accesses",
-       "Notification regs (legacy interface)",
-       "Notification regs (msg interface)",
-       "Notifications sent (legacy)",
-       "Notifications sent (msg)",
-       "WS queries",
-       "L&B protocol accesses" };
-
-static const char *edg_wll_server_statistics_type_key[] = {
-       "glite_jobs",
-       "pbs_jobs",
-       "condor_jobs",
-       "cream_jobs",
-       "sb_ft_jobs",
-       "events",
-       "queries_html",
-       "queries_text",
-       "queries_rss",
-       "notif_regs_legacy",
-       "notif_regs_msg",
-       "notifs_legacy",
-       "notis_msg",
-       "queries_ws",
-       "queries_api" };
 
 int edg_wll_InitServerStatistics(edg_wll_Context ctx, char *prefix);
 
-int edg_wll_ServerStatisticsIncrement(edg_wll_Context ctx, enum edg_wll_server_statistics_type type);
-int edg_wll_ServerStatisticsGetValue(edg_wll_Context ctx, enum edg_wll_server_statistics_type type);
-time_t* edg_wll_ServerStatisticsGetStart(edg_wll_Context ctx, enum edg_wll_server_statistics_type type);
+int edg_wll_ServerStatisticsIncrement(edg_wll_Context ctx, edg_wll_server_statistics_type type);
+int edg_wll_ServerStatisticsGetValue(edg_wll_Context ctx, edg_wll_server_statistics_type type);
+time_t* edg_wll_ServerStatisticsGetStart(edg_wll_Context ctx, edg_wll_server_statistics_type type);
 int edg_wll_ServerStatisticsInTmp();
 
 #endif /* GLITE_LB_SERVER_STATS_H */