diff --git a/src/core/store.c b/src/core/store.c
index ea30da90116d9925cd148e39f7577e346503ba42..bf12a9378eb228e811a87ea268eb8fa403991672 100644 (file)
--- a/src/core/store.c
+++ b/src/core/store.c
sdb_timeseries_t *ts;
+ int status = 0;
+
if ((! hostname) || (! metric) || (! opts) || (! buf))
return -1;
sdb_log(SDB_LOG_ERR, "store: Failed to fetch time-series '%s/%s' "
"- no data-store configured for the stored metric",
hostname, metric);
+ sdb_object_deref(SDB_OBJ(m));
pthread_rwlock_unlock(&host_lock);
return -1;
}
sdb_log(SDB_LOG_ERR, "store: Failed to fetch time-series '%s/%s' "
"- %s fetcher callback returned no data for '%s'",
hostname, metric, type, id);
- return -1;
+ status = -1;
}
}
ts_tojson(ts, buf);
+ sdb_object_deref(SDB_OBJ(m));
sdb_timeseries_destroy(ts);
- return 0;
+ return status;
} /* sdb_store_fetch_timeseries */
int
if (! res)
return 0;
return sdb_data_copy(res, &ATTR(obj)->value);
+ case SDB_FIELD_TIMESERIES:
+ if (obj->type != SDB_METRIC)
+ return -1;
+ tmp.type = SDB_TYPE_BOOLEAN;
+ tmp.data.boolean = METRIC(obj)->store.type != NULL;
default:
return -1;
}