Merge branch 'ok/disk' into collectd-4.4
[collectd.git] / src / ascent.c
index b63f73e..94691d6 100644 (file)
 static char *races_list[] = /* {{{ */
 {
   NULL,
-  "Warrior", /*  1 */
-  "Paladin", /*  2 */
-  "Hunter",  /*  3 */
-  "Rogue",   /*  4 */
-  "Priest",  /*  5 */
-  NULL,
-  "Shaman",  /*  7 */
-  "Mage",    /*  8 */
-  "Warlock", /*  9 */
-  NULL,
-  "Druid"    /* 11 */
-}; /* }}} */
-#define RACES_LIST_LENGTH STATIC_ARRAY_SIZE (races_list)
-
-static char *classes_list[] = /* {{{ */
-{
-  NULL,
   "Human",    /*  1 */
   "Orc",      /*  2 */
   "Dwarf",    /*  3 */
@@ -59,6 +42,23 @@ static char *classes_list[] = /* {{{ */
   "Bloodelf", /* 10 */
   "Draenei"   /* 11 */
 }; /* }}} */
+#define RACES_LIST_LENGTH STATIC_ARRAY_SIZE (races_list)
+
+static char *classes_list[] = /* {{{ */
+{
+  NULL,
+  "Warrior", /*  1 */
+  "Paladin", /*  2 */
+  "Hunter",  /*  3 */
+  "Rogue",   /*  4 */
+  "Priest",  /*  5 */
+  NULL,
+  "Shaman",  /*  7 */
+  "Mage",    /*  8 */
+  "Warlock", /*  9 */
+  NULL,
+  "Druid"    /* 11 */
+}; /* }}} */
 #define CLASSES_LIST_LENGTH STATIC_ARRAY_SIZE (classes_list)
 
 static char *genders_list[] = /* {{{ */
@@ -193,11 +193,12 @@ static int ascent_submit_players (player_stats_t *ps) /* {{{ */
     value = ((double) ps->level_sum) / ((double) ps->level_num);
   ascent_submit_gauge (NULL, "gauge", "avg-level", value);
 
+  /* Latency is in ms, but we store seconds. */
   if (ps->latency_num <= 0)
     value = NAN;
   else
-    value = ((double) ps->latency_sum) / ((double) ps->latency_num);
-  ascent_submit_gauge (NULL, "gauge", "avg-latency", value);
+    value = ((double) ps->latency_sum) / (1000.0 * ((double) ps->latency_num));
+  ascent_submit_gauge (NULL, "latency", "average", value);
 
   return (0);
 } /* }}} int ascent_submit_players */
@@ -392,6 +393,22 @@ static int ascent_xml_status (xmlDoc *doc, xmlNode *node) /* {{{ */
       ascent_xml_submit_gauge (doc, child, NULL, "players", "horde");
     else if (xmlStrcmp ((const xmlChar *) "qplayers", child->name) == 0)
       ascent_xml_submit_gauge (doc, child, NULL, "players", "queued");
+    else if ((xmlStrcmp ((const xmlChar *) "acceptedconns", child->name) == 0)
+        || (xmlStrcmp ((const xmlChar *) "avglat", child->name) == 0)
+        || (xmlStrcmp ((const xmlChar *) "cdbquerysize", child->name) == 0)
+        || (xmlStrcmp ((const xmlChar *) "cpu", child->name) == 0)
+        || (xmlStrcmp ((const xmlChar *) "fthreads", child->name) == 0)
+        || (xmlStrcmp ((const xmlChar *) "gmcount", child->name) == 0)
+        || (xmlStrcmp ((const xmlChar *) "lastupdate", child->name) == 0)
+        || (xmlStrcmp ((const xmlChar *) "ontime", child->name) == 0)
+        || (xmlStrcmp ((const xmlChar *) "oplayers", child->name) == 0)
+        || (xmlStrcmp ((const xmlChar *) "peakcount", child->name) == 0)
+        || (xmlStrcmp ((const xmlChar *) "platform", child->name) == 0)
+        || (xmlStrcmp ((const xmlChar *) "ram", child->name) == 0)
+        || (xmlStrcmp ((const xmlChar *) "threads", child->name) == 0)
+        || (xmlStrcmp ((const xmlChar *) "uptime", child->name) == 0)
+        || (xmlStrcmp ((const xmlChar *) "wdbquerysize", child->name) == 0))
+      /* ignore */;
     else
     {
       WARNING ("ascent plugin: ascent_xml_status: Unknown tag: %s", child->name);