Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
9.2.2023: Due to updates GitLab will be unavailable for some minutes between 9:00 and 11:00.
Open sidebar
dcdb
dcdb
Commits
2fc4a776
Commit
2fc4a776
authored
Nov 11, 2019
by
Micha Müller
Browse files
CollectAgent: Add option for special benchmark mode which discards all messages
parent
78cce230
Changes
1
Hide whitespace changes
Inline
Side-by-side
collectagent/collectagent.cpp
View file @
2fc4a776
...
...
@@ -73,6 +73,13 @@
#define __STDC_FORMAT_MACROS
#include
<inttypes.h>
/**
* Uncomment and recompile to activate CollectAgent's special benchmark mode.
* In this mode, all received messages will be discarded and no data is stored
* in the storage backend.
*/
//#define BENCHMARK_MODE
using
namespace
std
;
int
keepRunning
;
...
...
@@ -236,6 +243,8 @@ int mqttCallback(SimpleMQTTMessage *msg)
if
(
msg
->
isPublish
())
pmsgCtr
++
;
#ifndef BENCHMARK_MODE
uint64_t
len
;
/*
* Decode the message and put into the database.
...
...
@@ -406,15 +415,12 @@ int mqttCallback(SimpleMQTTMessage *msg)
readingCtr
+=
readings
.
size
();
//mySensorCache.dump();
}
else
{
LOG
(
error
)
<<
"Message with empty topic received"
;
}
#if 1
else
{
cout
<<
"Wrong topic format: "
<<
msg
->
getTopic
()
<<
"
\n
"
;
return
1
;
}
#endif
}
}
#endif
return
0
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment