static int uc_insert(metric_t const *m, char const *key) {
/* `cache_lock' has been locked by `uc_update' */
-
char *key_copy = strdup(key);
if (key_copy == NULL) {
ERROR("uc_insert: strdup failed.");
int uc_get_percentile_by_name(const char *name, gauge_t *ret_values,
double percent) {
+ if (percent < 0 || percent > 100) {
+ ERROR("uc_get_percentile_by_name: Illegal percent %lf.", percent);
+ return -1;
+ }
+
cache_entry_t *ce = NULL;
int status = 0;
return -1;
}
+ if (percent < 0 || percent > 100) {
+ ERROR("uc_get_percentile: Illegal percent %lf.", percent);
+ return -1;
+ }
+
strbuf_t buf = STRBUF_CREATE;
int status = metric_identity(&buf, m);
if (status != 0) {