sstrncpy (vl.plugin_instance, plugin_instance,
sizeof (vl.plugin_instance));
+ sstrncpy (vl.type, type, sizeof (vl.type));
+
if (type_instance != NULL)
sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
- plugin_dispatch_values (type, &vl);
+ plugin_dispatch_values (&vl);
return (0);
} /* }}} int ascent_submit_gauge */
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 */
{
int status;
- status = snprintf (credentials, sizeof (credentials), "%s:%s",
+ status = ssnprintf (credentials, sizeof (credentials), "%s:%s",
user, (pass == NULL) ? "" : pass);
if (status >= sizeof (credentials))
{
"credentials have been truncated.");
return (-1);
}
- credentials[sizeof (credentials) - 1] = '\0';
curl_easy_setopt (curl, CURLOPT_USERPWD, credentials);
}