Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
dcdb
dcdb
Commits
2fc4a776
Commit
2fc4a776
authored
Nov 11, 2019
by
Micha Müller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CollectAgent: Add option for special benchmark mode which discards all messages
parent
78cce230
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
collectagent/collectagent.cpp
collectagent/collectagent.cpp
+12
-6
No files found.
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
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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