comment on max starting of count frequency
Some checks failed
Test And Build / Lint (push) Failing after 2s
Test And Build / Build (push) Failing after 2s

This commit is contained in:
2025-11-19 12:02:12 +01:00
parent 7865273707
commit 594bb6d320

View File

@@ -663,7 +663,7 @@ inline void asynStreamGeneratorDriver::queueForKafka(NormalisedEvent &ne) {
void asynStreamGeneratorDriver::processEvents() {
const char functionName[]{"processEvents"};
// const char functionName[]{"processEvents"};
// x * number of ids * max events in packet * event size
int bufferedEvents = 5 * 10 * 243;
@@ -704,6 +704,12 @@ void asynStreamGeneratorDriver::processEvents() {
// wait for mininmum packet frequency or enough packets to ensure we
// could potentially have at least 1 packet per mcpdid
// IMPORTANT: if you start counts faster than this poll period (so
// either the time or number of events incoming below), you will
// find that it doesn't have time to switch back to idle within
// this loop and so will just keep counting. If you need counts
// that are started more often than the below currently 250ms
// then that value will need to be adjusted.
while (queuedEvents < bufferedEvents &&
epicsTimeDiffInNS(&currentTime, &lastProcess) < 250'000'000ll) {
epicsThreadSleep(0.0001); // seconds
@@ -753,18 +759,10 @@ void asynStreamGeneratorDriver::processEvents() {
counts[i] = 0;
}
// asynPrint(
// pasynUserSelf, ASYN_TRACE_ERROR,
// "%s:%s: started %"PRIu64" %d\n",
// driverName, functionName, (uint64_t) counts[presetChannel], presetChannel);
}
if (currStatus == STATUS_COUNTING) {
// The elapsedSeconds are round differently depending on whether we
// are using them for comparison, or for showing to the user, to
// try and make sure the data we send to kafka is correct, while
// the measurement time also appears intuitive.
for (std::size_t i = 0; i < toProcess; ++i) {
counts[eventsA[i].source == 0 ? eventsA[i].pixelId
: this->num_channels - 1] += 1;
@@ -777,10 +775,6 @@ void asynStreamGeneratorDriver::processEvents() {
elapsedSeconds =
timePreset == 0 ? elapsedSeconds : timePreset;
// asynPrint(
// pasynUserSelf, ASYN_TRACE_ERROR,
// "%s:%s: counted %"PRIu64" %d\n",
// driverName, functionName, (uint64_t) counts[presetChannel], presetChannel);
break;
}