2.12.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

Commit b8e1afc1 authored by Michael Ott's avatar Michael Ott
Browse files

Make parameters to SensorDataStore functions const where possible. Requires...

Make parameters to SensorDataStore functions const where possible. Requires recompiling of binaries that depend on libdcdb!
parent 419e47c2
......@@ -219,7 +219,7 @@ void CARestAPI::POST_write(endpointArgs) {
DCDB::SensorId sid;
if (sid.mqttTopicConvert(mqttTopic)) {
_sensorCache->storeSensor(sid, ts.getRaw(), value);
_sensorDataStore->insert(&sid, ts.getRaw(), value);
_sensorDataStore->insert(sid, ts.getRaw(), value);
_influxCounter++;
if (_influxSettings->publish && (_influxSensors.find(sid.getId()) == _influxSensors.end())) {
......
......@@ -96,7 +96,7 @@ public:
#endif
SensorDataStoreReading();
SensorDataStoreReading(SensorId& sid, uint64_t ts, int64_t value);
SensorDataStoreReading(const SensorId& sid, const uint64_t ts, const int64_t value);
virtual ~SensorDataStoreReading();
};
......@@ -118,7 +118,7 @@ public:
* @param value The value of the sensor reading
* @param ttl Time to live (in seconds) for the inserted reading
*/
void insert(SensorId* sid, uint64_t ts, int64_t value, int64_t ttl=-1);
void insert(const SensorId& sid, const uint64_t ts, const int64_t value, const int64_t ttl=-1);
/**
* @brief This function inserts a single sensor reading into
......@@ -126,7 +126,7 @@ public:
* @param reading A SensorDataStoreReading object
* @param ttl Time to live (in seconds) for the inserted reading
*/
void insert(SensorDataStoreReading& reading, int64_t ttl=-1);
void insert(const SensorDataStoreReading& reading, const int64_t ttl=-1);
/**
* @brief This function inserts a single sensor reading into
......@@ -134,19 +134,19 @@ public:
* @param readings A list of SensorDataStoreReading object
* @param ttl Time to live (in seconds) for the inserted readings
*/
void insertBatch(std::list<SensorDataStoreReading>& readings, int64_t ttl=-1);
void insertBatch(const std::list<SensorDataStoreReading>& readings, const int64_t ttl=-1);
/**
* @brief Set the TTL for newly inserted sensor data.
* @param ttl The TTL for the sensor data in seconds.
*/
void setTTL(uint64_t ttl);
void setTTL(const uint64_t ttl);
/**
* @brief Enables or disables logging of Cassandra insert errors
* @param dl true to enable logging, false otherwise
*/
void setDebugLog(bool dl);
void setDebugLog(const bool dl);
/**
* @brief This function queries a sensor's values in
......@@ -156,7 +156,7 @@ public:
* @param start Start of the time series.
* @param end End of the time series.
*/
void query(std::list<SensorDataStoreReading>& result, SensorId& sid, TimeStamp& start, TimeStamp& end, QueryAggregate aggregate=AGGREGATE_NONE);
void query(std::list<SensorDataStoreReading>& result, const SensorId& sid, const TimeStamp& start, const TimeStamp& end, const QueryAggregate aggregate=AGGREGATE_NONE);
/**
* @brief This function queries a the values of
......@@ -169,7 +169,7 @@ public:
* @param end End of the time series.
* @param storeSid If true, Sensor IDs will be retrieved for each reading.
*/
void query(std::list<SensorDataStoreReading>& result, std::list<SensorId>& sids, TimeStamp& start, TimeStamp& end, QueryAggregate aggregate=AGGREGATE_NONE, bool storeSids=true);
void query(std::list<SensorDataStoreReading>& result, const std::list<SensorId>& sids, const TimeStamp& start, const TimeStamp& end, const QueryAggregate aggregate=AGGREGATE_NONE, const bool storeSids=true);
/**
* @brief This function performs a fuzzy query and returns the
......@@ -179,7 +179,7 @@ public:
* @param ts The target timestamp.
* @param tol_ns Tolerance of the fuzzy query in nanoseconds.
*/
void fuzzyQuery(std::list<SensorDataStoreReading>& result, SensorId& sid, TimeStamp& ts, uint64_t tol_ns=3600000000000);
void fuzzyQuery(std::list<SensorDataStoreReading>& result, const SensorId& sid, const TimeStamp& ts, const uint64_t tol_ns=3600000000000);
/**
* @brief This function performs a fuzzy query and returns the closest
......@@ -192,7 +192,7 @@ public:
* @param tol_ns Tolerance of the fuzzy query in nanoseconds.
* @param storeSid If true, Sensor IDs will be retrieved for each reading.
*/
void fuzzyQuery(std::list<SensorDataStoreReading>& result, std::list<SensorId>& sids, TimeStamp& ts, uint64_t tol_ns=3600000000000, bool storeSids=true);
void fuzzyQuery(std::list<SensorDataStoreReading>& result, const std::list<SensorId>& sids, const TimeStamp& ts, const uint64_t tol_ns=3600000000000, const bool storeSids=true);
typedef void (*QueryCbFunc)(SensorDataStoreReading& reading, void* userData);
/**
......@@ -204,14 +204,14 @@ public:
* @param start Start of the time series.
* @param end End of the time series.
*/
void queryCB(QueryCbFunc cbFunc, void* userData, SensorId& sid, TimeStamp& start, TimeStamp& end, QueryAggregate aggregate=AGGREGATE_NONE);
void queryCB(QueryCbFunc cbFunc, void* userData, const SensorId& sid, const TimeStamp& start, const TimeStamp& end, const QueryAggregate aggregate=AGGREGATE_NONE);
/**
* @brief This function truncates all sensor data that is older than
* the specified week.
* @param weekStamp The 16-bit weekstamp generated from a cut-off date
*/
void truncBeforeWeek(uint16_t weekStamp);
void truncBeforeWeek(const uint16_t weekStamp);
/**
* @brief A shortcut constructor for a SensorDataStore object
......
......@@ -90,7 +90,7 @@ public:
* @param value The sensor reading as 64-bit integer
* @param ttl Time to live (in seconds) for the inserted reading
*/
void insert(SensorId* sid, uint64_t ts, int64_t value, int64_t ttl=-1);
void insert(const SensorId& sid, const uint64_t ts, const int64_t value, const int64_t ttl=-1);
/**
* @brief This function inserts a single sensor reading into
......@@ -98,7 +98,7 @@ public:
* @param reading A SensorDataStoreReading object
* @param ttl Time to live (in seconds) for the inserted reading
*/
void insert(SensorDataStoreReading& reading, int64_t ttl=-1);
void insert(const SensorDataStoreReading& reading, const int64_t ttl=-1);
/**
* @brief This function inserts a single sensor reading into
......@@ -106,19 +106,19 @@ public:
* @param readings A list of SensorDataStoreReading object
* @param ttl Time to live (in seconds) for the inserted readings
*/
void insertBatch(std::list<SensorDataStoreReading>& readings, int64_t ttl=-1);
void insertBatch(const std::list<SensorDataStoreReading>& readings, const int64_t ttl=-1);
/**
* @brief This function sets the TTL of newly inserted readings.
* @param ttl The TTL to be used for new inserts in seconds.
*/
void setTTL(uint64_t ttl);
void setTTL(const uint64_t ttl);
/**
* @brief Enables or disables logging of Cassandra insert errors
* @param dl true to enable logging, false otherwise
*/
void setDebugLog(bool dl);
void setDebugLog(const bool dl);
/**
* @brief This function queries a sensor's values in
......@@ -128,7 +128,7 @@ public:
* @param start Start of the time series.
* @param end End of the time series.
*/
void query(std::list<SensorDataStoreReading>& result, SensorId& sid, TimeStamp& start, TimeStamp& end, QueryAggregate aggregate);
void query(std::list<SensorDataStoreReading>& result, const SensorId& sid, const TimeStamp& start, const TimeStamp& end, const QueryAggregate aggregate);
/**
* @brief This function queries a the values of
......@@ -141,7 +141,7 @@ public:
* @param end End of the time series.
* @param storeSid If true, Sensor IDs will be retrieved for each reading.
*/
void query(std::list<SensorDataStoreReading>& result, std::list<SensorId>& sids, TimeStamp& start, TimeStamp& end, QueryAggregate aggregate, bool storeSids);
void query(std::list<SensorDataStoreReading>& result, const std::list<SensorId>& sids, const TimeStamp& start, const TimeStamp& end, const QueryAggregate aggregate, const bool storeSids);
/**
* @brief This function performs a fuzzy query and returns the
......@@ -151,7 +151,7 @@ public:
* @param ts The target timestamp.
* @param tol_ns Tolerance of the fuzzy query in nanoseconds.
*/
void fuzzyQuery(std::list<SensorDataStoreReading>& result, SensorId& sid, TimeStamp& ts, uint64_t tol_ns=3600000000000);
void fuzzyQuery(std::list<SensorDataStoreReading>& result, const SensorId& sid, const TimeStamp& ts, const uint64_t tol_ns=3600000000000);
/**
* @brief This function performs a fuzzy query and returns the closest
......@@ -164,7 +164,7 @@ public:
* @param tol_ns Tolerance of the fuzzy query in nanoseconds.
* @param storeSid If true, Sensor IDs will be retrieved for each reading.
*/
void fuzzyQuery(std::list<SensorDataStoreReading>& result, std::list<SensorId>& sids, TimeStamp& ts, uint64_t tol_ns=3600000000000, bool storeSids=true);
void fuzzyQuery(std::list<SensorDataStoreReading>& result, const std::list<SensorId>& sids, const TimeStamp& ts, const uint64_t tol_ns=3600000000000, const bool storeSids=true);
/**
* @brief This function queries a sensor's values in
......@@ -175,20 +175,20 @@ public:
* @param start Start of the time series.
* @param end End of the time series.
*/
void queryCB(SensorDataStore::QueryCbFunc cbFunc, void* userData, SensorId& sid, TimeStamp& start, TimeStamp& end, QueryAggregate aggregate);
void queryCB(SensorDataStore::QueryCbFunc cbFunc, void* userData, const SensorId& sid, const TimeStamp& start, const TimeStamp& end, const QueryAggregate aggregate);
/**
* @brief This function truncates all sensor data that is older than
* the specified week.
* @param weekStamp The 16-bit weekstamp generated from a cut-off date
*/
void truncBeforeWeek(uint16_t weekStamp);
void truncBeforeWeek(const uint16_t weekStamp);
/**
* @brief This function deletes a row from the sensordatastore.
* @param sid SensorId object that identifies the row to be deleted.
*/
void deleteRow(SensorId& sid);
void deleteRow(const SensorId& sid);
/**
* @brief This is the standard constructor of the SensorDataStoreImpl class.
......
......@@ -68,7 +68,7 @@ using namespace DCDB;
SensorDataStoreReading::SensorDataStoreReading() {
}
SensorDataStoreReading::SensorDataStoreReading(SensorId& sid, uint64_t ts, int64_t value) {
SensorDataStoreReading::SensorDataStoreReading(const SensorId& sid, const uint64_t ts, const int64_t value) {
this->sensorId = sid;
this->timeStamp = TimeStamp(ts);
this->value = value;
......@@ -83,7 +83,7 @@ SensorDataStoreReading::~SensorDataStoreReading() {
* insert CQL query in advance and only bind it on the actual
* insert.
*/
void SensorDataStoreImpl::prepareInsert(uint64_t ttl)
void SensorDataStoreImpl::prepareInsert(const uint64_t ttl)
{
CassError rc = CASS_OK;
CassFuture* future = NULL;
......@@ -142,7 +142,7 @@ void SensorDataStoreImpl::prepareInsert(uint64_t ttl)
* Applications should not call this function directly, but
* use the insert function provided by the SensorDataStore class.
*/
void SensorDataStoreImpl::insert(SensorId* sid, uint64_t ts, int64_t value, int64_t ttl)
void SensorDataStoreImpl::insert(const SensorId& sid, const uint64_t ts, const int64_t value, const int64_t ttl)
{
#if 0
std::cout << "Inserting@SensorDataStoreImpl (" << sid->raw[0] << " " << sid->raw[1] << ", " << ts << ", " << value << ")" << std::endl;
......@@ -150,12 +150,11 @@ void SensorDataStoreImpl::insert(SensorId* sid, uint64_t ts, int64_t value, int6
/* Calculate and insert week number */
uint16_t week = ts / 604800000000000;
sid->setRsvd(week);
int64_t ttlReal = (ttl<0 ? defaultTTL : ttl);
std::string sidStr = sid.getId();
CassStatement* statement = cass_prepared_bind(ttlReal<=0 ? preparedInsert_noTTL : preparedInsert);
cass_statement_bind_string_by_name(statement, "sid", sid->getId().c_str());
cass_statement_bind_string_by_name(statement, "sid", sidStr.c_str());
cass_statement_bind_int16_by_name(statement, "ws", week);
cass_statement_bind_int64_by_name(statement, "ts", ts);
cass_statement_bind_int64_by_name(statement, "value", value);
......@@ -169,19 +168,18 @@ void SensorDataStoreImpl::insert(SensorId* sid, uint64_t ts, int64_t value, int6
cass_future_free(future);
}
void SensorDataStoreImpl::insert(SensorDataStoreReading& reading, int64_t ttl) {
insert(&reading.sensorId, reading.timeStamp.getRaw(), reading.value, ttl);
void SensorDataStoreImpl::insert(const SensorDataStoreReading& reading, const int64_t ttl) {
insert(reading.sensorId, reading.timeStamp.getRaw(), reading.value, ttl);
}
void SensorDataStoreImpl::insertBatch(std::list<SensorDataStoreReading>& readings, int64_t ttl) {
void SensorDataStoreImpl::insertBatch(const std::list<SensorDataStoreReading>& readings, const int64_t ttl) {
CassBatch* batch = cass_batch_new(CASS_BATCH_TYPE_UNLOGGED);
int64_t ttlReal = (ttl<0 ? defaultTTL : ttl);
for (auto r: readings) {
/* Calculate and insert week number */
/* Calculate week number */
uint16_t week = r.timeStamp.getRaw() / 604800000000000;
r.sensorId.setRsvd(week);
/* Add insert statement to batch */
CassStatement* statement = cass_prepared_bind(ttlReal<=0 ? preparedInsert_noTTL : preparedInsert);
......@@ -211,7 +209,7 @@ void SensorDataStoreImpl::insertBatch(std::list<SensorDataStoreReading>& reading
* This function updates the prepared statement for inserts
* with the new TTL value.
*/
void SensorDataStoreImpl::setTTL(uint64_t ttl)
void SensorDataStoreImpl::setTTL(const uint64_t ttl)
{
prepareInsert(ttl);
}
......@@ -220,7 +218,7 @@ void SensorDataStoreImpl::setTTL(uint64_t ttl)
* @brief Enables or disables logging of Cassandra insert errors
* @param dl true to enable logging, false otherwise
*/
void SensorDataStoreImpl::setDebugLog(bool dl)
void SensorDataStoreImpl::setDebugLog(const bool dl)
{
debugLog = dl;
}
......@@ -231,7 +229,7 @@ void SensorDataStoreImpl::setDebugLog(bool dl)
* and creates a SensorDataStoreReading object for each
* entry which is stored in the result list.
*/
void SensorDataStoreImpl::query(std::list<SensorDataStoreReading>& result, SensorId& sid, TimeStamp& start, TimeStamp& end, QueryAggregate aggregate) {
void SensorDataStoreImpl::query(std::list<SensorDataStoreReading>& result, const SensorId& sid, const TimeStamp& start, const TimeStamp& end, const QueryAggregate aggregate) {
CassError rc = CASS_OK;
CassStatement* statement = NULL;
CassFuture *future = NULL;
......@@ -328,7 +326,7 @@ void SensorDataStoreImpl::query(std::list<SensorDataStoreReading>& result, Senso
* and creates a SensorDataStoreReading object for each
* entry which is stored in the result list.
*/
void SensorDataStoreImpl::query(std::list<SensorDataStoreReading>& result, std::list<SensorId>& sids, TimeStamp& start, TimeStamp& end, QueryAggregate aggregate, bool storeSids) {
void SensorDataStoreImpl::query(std::list<SensorDataStoreReading>& result, const std::list<SensorId>& sids, const TimeStamp& start, const TimeStamp& end, const QueryAggregate aggregate, const bool storeSids) {
if(sids.empty())
return;
......@@ -445,7 +443,7 @@ void SensorDataStoreImpl::query(std::list<SensorDataStoreReading>& result, std::
* picking a single sensor readings that is closest to
* the one given as input
*/
void SensorDataStoreImpl::fuzzyQuery(std::list<SensorDataStoreReading>& result, SensorId& sid, TimeStamp& ts, uint64_t tol_ns) {
void SensorDataStoreImpl::fuzzyQuery(std::list<SensorDataStoreReading>& result, const SensorId& sid, const TimeStamp& ts, const uint64_t tol_ns) {
/* Find the readings before time t */
CassError rc = CASS_OK;
CassStatement* statement = NULL;
......@@ -508,7 +506,7 @@ void SensorDataStoreImpl::fuzzyQuery(std::list<SensorDataStoreReading>& result,
* picking readings from a set of sensors that are closest to
* the timestamp given as input
*/
void SensorDataStoreImpl::fuzzyQuery(std::list<SensorDataStoreReading>& result, std::list<SensorId>& sids, TimeStamp& ts, uint64_t tol_ns, bool storeSids) {
void SensorDataStoreImpl::fuzzyQuery(std::list<SensorDataStoreReading>& result, const std::list<SensorId>& sids, const TimeStamp& ts, const uint64_t tol_ns, const bool storeSids) {
if(sids.empty())
return;
......@@ -600,7 +598,7 @@ void SensorDataStoreImpl::fuzzyQuery(std::list<SensorDataStoreReading>& result,
* This function issues a regular query to the data store
* and calls cbFunc for every reading.
*/
void SensorDataStoreImpl::queryCB(SensorDataStore::QueryCbFunc cbFunc, void* userData, SensorId& sid, TimeStamp& start, TimeStamp& end, QueryAggregate aggregate)
void SensorDataStoreImpl::queryCB(SensorDataStore::QueryCbFunc cbFunc, void* userData, const SensorId& sid, const TimeStamp& start, const TimeStamp& end, const QueryAggregate aggregate)
{
CassError rc = CASS_OK;
CassStatement* statement = NULL;
......@@ -682,7 +680,7 @@ void SensorDataStoreImpl::queryCB(SensorDataStore::QueryCbFunc cbFunc, void* use
* This function deletes all data from the sensordata store
* that is older than weekStamp-1 weeks.
*/
void SensorDataStoreImpl::truncBeforeWeek(uint16_t weekStamp)
void SensorDataStoreImpl::truncBeforeWeek(const uint16_t weekStamp)
{
/* List of rows that should be deleted */
std::list<SensorId> deleteList;
......@@ -742,7 +740,7 @@ void SensorDataStoreImpl::truncBeforeWeek(uint16_t weekStamp)
* @details
* Deleting entire rows is rather efficient compared to deleting individual columns.
*/
void SensorDataStoreImpl::deleteRow(SensorId& sid)
void SensorDataStoreImpl::deleteRow(const SensorId& sid)
{
CassError rc = CASS_OK;
CassStatement* statement = NULL;
......@@ -815,17 +813,17 @@ SensorDataStoreImpl::~SensorDataStoreImpl()
* forwards to the insert function of the SensorDataStoreImpl
* class.
*/
void SensorDataStore::insert(SensorId* sid, uint64_t ts, int64_t value, int64_t ttl)
void SensorDataStore::insert(const SensorId& sid, const uint64_t ts, const int64_t value, const int64_t ttl)
{
impl->insert(sid, ts, value, ttl);
}
void SensorDataStore::insert(SensorDataStoreReading& reading, int64_t ttl)
void SensorDataStore::insert(const SensorDataStoreReading& reading, const int64_t ttl)
{
impl->insert(reading, ttl);
}
void SensorDataStore::insertBatch(std::list<SensorDataStoreReading>& readings, int64_t ttl) {
void SensorDataStore::insertBatch(const std::list<SensorDataStoreReading>& readings, const int64_t ttl) {
impl->insertBatch(readings, ttl);
}
......@@ -835,7 +833,7 @@ void SensorDataStore::insertBatch(std::list<SensorDataStoreReading>& readings, i
* forwards to the insert function of the SensorDataStoreImpl
* class.
*/
void SensorDataStore::setTTL(uint64_t ttl)
void SensorDataStore::setTTL(const uint64_t ttl)
{
impl->setTTL(ttl);
}
......@@ -844,7 +842,7 @@ void SensorDataStore::setTTL(uint64_t ttl)
* @brief Enables or disables logging of Cassandra insert errors
* @param dl true to enable logging, false otherwise
*/
void SensorDataStore::setDebugLog(bool dl)
void SensorDataStore::setDebugLog(const bool dl)
{
impl->setDebugLog(dl);
}
......@@ -855,7 +853,7 @@ void SensorDataStore::setDebugLog(bool dl)
* forwards to the insert function of the SensorDataStoreImpl
* class.
*/
void SensorDataStore::query(std::list<SensorDataStoreReading>& result, SensorId& sid, TimeStamp& start, TimeStamp& end, QueryAggregate aggregate)
void SensorDataStore::query(std::list<SensorDataStoreReading>& result, const SensorId& sid, const TimeStamp& start, const TimeStamp& end, const QueryAggregate aggregate)
{
impl->query(result, sid, start, end, aggregate);
}
......@@ -866,7 +864,7 @@ void SensorDataStore::query(std::list<SensorDataStoreReading>& result, SensorId&
* forwards to the insert function of the SensorDataStoreImpl
* class.
*/
void SensorDataStore::query(std::list<SensorDataStoreReading>& result, std::list<SensorId>& sids, TimeStamp& start, TimeStamp& end, QueryAggregate aggregate, bool storeSids)
void SensorDataStore::query(std::list<SensorDataStoreReading>& result, const std::list<SensorId>& sids, const TimeStamp& start, const TimeStamp& end, const QueryAggregate aggregate, const bool storeSids)
{
impl->query(result, sids, start, end, aggregate, storeSids);
}
......@@ -877,7 +875,7 @@ void SensorDataStore::query(std::list<SensorDataStoreReading>& result, std::list
* forwards to the insert function of the SensorDataStoreImpl
* class.
*/
void SensorDataStore::fuzzyQuery(std::list<SensorDataStoreReading>& result, SensorId& sid, TimeStamp& ts, uint64_t tol_ns) {
void SensorDataStore::fuzzyQuery(std::list<SensorDataStoreReading>& result, const SensorId& sid, const TimeStamp& ts, const uint64_t tol_ns) {
impl->fuzzyQuery(result, sid, ts, tol_ns);
}
......@@ -887,7 +885,7 @@ void SensorDataStore::fuzzyQuery(std::list<SensorDataStoreReading>& result, Sens
* forwards to the insert function of the SensorDataStoreImpl
* class.
*/
void SensorDataStore::fuzzyQuery(std::list<SensorDataStoreReading>& result, std::list<SensorId>& sids, TimeStamp& ts, uint64_t tol_ns, bool storeSids) {
void SensorDataStore::fuzzyQuery(std::list<SensorDataStoreReading>& result, const std::list<SensorId>& sids, const TimeStamp& ts, const uint64_t tol_ns, const bool storeSids) {
impl->fuzzyQuery(result, sids, ts, tol_ns, storeSids);
}
......@@ -897,7 +895,7 @@ void SensorDataStore::fuzzyQuery(std::list<SensorDataStoreReading>& result, std:
* forwards to the insert function of the SensorDataStoreImpl
* class.
*/
void SensorDataStore::queryCB(SensorDataStore::QueryCbFunc cbFunc, void* userData, SensorId& sid, TimeStamp& start, TimeStamp& end, QueryAggregate aggregate)
void SensorDataStore::queryCB(SensorDataStore::QueryCbFunc cbFunc, void* userData, const SensorId& sid, const TimeStamp& start, const TimeStamp& end, const QueryAggregate aggregate)
{
return impl->queryCB(cbFunc, userData, sid, start, end, aggregate);
}
......@@ -908,7 +906,7 @@ void SensorDataStore::queryCB(SensorDataStore::QueryCbFunc cbFunc, void* userDat
* forwards to the insert function of the SensorDataStoreImpl
* class.
*/
void SensorDataStore::truncBeforeWeek(uint16_t weekStamp)
void SensorDataStore::truncBeforeWeek(const uint16_t weekStamp)
{
return impl->truncBeforeWeek(weekStamp);
}
......
......@@ -129,7 +129,7 @@ void DBAction::doInsert(std::string sidstr, std::string timestr, std::string val
return;
}
ds.insert(&sid, ts.getRaw(), value);
ds.insert(sid, ts.getRaw(), value);
}
/*
......
......@@ -287,7 +287,7 @@ int main(int argc, char** argv)
DCDB::SensorId sid(sensor->topic);
uint64_t val = std::stoll(*i);
if (!dropConstantValues || val != sensor->prev) {
sensorDataStore.insert(&sid, ts.getRaw(), val);
sensorDataStore.insert(sid, ts.getRaw(), val);
sensor->count++;
sensor->prev = val;
count++;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment