count VM registrations in statistics (backward compatible)
authorJiří Filipovič <fila@ics.muni.cz>
Thu, 6 Sep 2012 10:24:36 +0000 (10:24 +0000)
committerJiří Filipovič <fila@ics.muni.cz>
Thu, 6 Sep 2012 10:24:36 +0000 (10:24 +0000)
org.glite.lb.server/src/jobstat.c
org.glite.lb.server/src/lb_proto.c
org.glite.lb.server/src/server_stats.c
org.glite.lb.server/src/server_stats.h

index 14a5679..7072ac7 100644 (file)
@@ -636,6 +636,8 @@ int edg_wll_intJobStatus(
                                 case EDG_WLL_STAT_FILE_TRANSFER_COLLECTION:
                                         edg_wll_ServerStatisticsIncrement(ctx, SERVER_STATS_SANDBOX_REGS);
                                         break;
+                               case EDG_WLL_STAT_VIRTUAL_MACHINE:
+                                       edg_wll_ServerStatisticsIncrement(ctx, SERVER_STATS_VM_REGS);
                                 default:
                                         glite_common_log(LOG_CATEGORY_LB_SERVER_REQUEST, LOG_PRIORITY_DEBUG, "Unknown job type, registration will not be counted in statistics.");
                                         break;
index 4e7b647..fa90960 100644 (file)
@@ -1139,7 +1139,7 @@ edg_wll_ErrorCode edg_wll_Proto(edg_wll_Context ctx,
                        isadm = ctx->noAuth || edg_wll_amIroot(ctx->peerName, ctx->fqans,&ctx->authz_policy);
                        if ( !isadm && ctx->count_server_stats == 2 ) {
                                ret = HTTP_UNAUTH;
-                               edg_wll_SetError(ctx, EPERM, "Only superusers can view server usage statistics on this particular server.");
+                               edg_wll_SetError(ctx, EPERM, "Only superusers can view server usage statistics on this server.");
                        }
                        else {
                                edg_wll_StatisticsToHTML(ctx, &message, text);
index 31461b3..0d7f2ea 100644 (file)
@@ -31,7 +31,8 @@ char *edg_wll_server_statistics_type_title[] = {
         "Notifications sent (legacy)",
         "Notifications sent (msg)",
         "WS queries",
-        "L&B protocol accesses" };
+        "L&B protocol accesses",
+       "VM regs" };
 
 char *edg_wll_server_statistics_type_key[] = {
         "glite_jobs",
@@ -48,7 +49,8 @@ char *edg_wll_server_statistics_type_key[] = {
         "notifs_legacy",
         "notis_msg",
         "queries_ws",
-        "queries_api" };
+        "queries_api",
+       "vm_jobs" };
 
 int edg_wll_InitServerStatistics(edg_wll_Context ctx, char *prefix)
 {
index da75575..48a2ef6 100644 (file)
@@ -13,6 +13,8 @@ typedef struct _edg_wll_server_statistics{
        time_t start;
 } edg_wll_server_statistics;
 
+// Add new values at the end of the enum (before SERVER_STATISTICS_COUNT)
+// Also for new vales, add text descriptions to server_stats.c
 typedef enum _edg_wll_server_statistics_type{
        SERVER_STATS_GLITEJOB_REGS = 0,
        SERVER_STATS_PBSJOB_REGS,
@@ -29,10 +31,10 @@ typedef enum _edg_wll_server_statistics_type{
        SERVER_STATS_NOTIF_MSG_SENT,
        SERVER_STATS_WS_QUERIES,
        SERVER_STATS_LBPROTO,
+       SERVER_STATS_VM_REGS,
        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_server_statistics_type_title[];
 extern char     *edg_wll_server_statistics_type_key[];