From a1e051e7f63240cf1aabbe5f275fa6a7c80eb501 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zden=C4=9Bk=20=C5=A0ustr?= Date: Thu, 23 Aug 2012 14:30:31 +0000 Subject: [PATCH] Stat type definitions separated from declarations to suppress compiler warnings --- org.glite.lb.server/src/server_stats.c | 40 ++++++++++++++++++++++++++--- org.glite.lb.server/src/server_stats.h | 46 ++++++---------------------------- 2 files changed, 45 insertions(+), 41 deletions(-) diff --git a/org.glite.lb.server/src/server_stats.c b/org.glite.lb.server/src/server_stats.c index a8006b9..31461b3 100644 --- a/org.glite.lb.server/src/server_stats.c +++ b/org.glite.lb.server/src/server_stats.c @@ -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; diff --git a/org.glite.lb.server/src/server_stats.h b/org.glite.lb.server/src/server_stats.h index 152e0d3..9e27404 100644 --- a/org.glite.lb.server/src/server_stats.h +++ b/org.glite.lb.server/src/server_stats.h @@ -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 */ -- 1.8.2.3