Skip to content

Commit 83399b4

Browse files
committed
stfb tfid publish
1 parent cdda52b commit 83399b4

File tree

6 files changed

+20
-10
lines changed

6 files changed

+20
-10
lines changed

doc/releaseNotes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,3 +340,6 @@ This file describes the main feature changes for each readout.exe released versi
340340

341341
## v2.2.0 - 07/05/2021
342342
- Added rate limit for eventDump: see consumer-zmq.maxRate and consumer-zmq.pagesPerBurst.
343+
344+
## next version
345+
- consumer-stats: publish/print the current timeframe Id sent to STFB.

src/ConsumerFMQchannel.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,7 @@ class ConsumerFMQchannel : public Consumer
646646
messagesToSend.clear();
647647
gReadoutStats.counters.bytesFairMQ += messagesToSendSize;
648648
messagesToSendSize = 0;
649+
gReadoutStats.counters.timeframeIdFairMQ = stfHeader->timeframeId;
649650
} else {
650651
theLog.log(LogErrorSupport_(3233), "Sending failed");
651652
}

src/ConsumerStats.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ class ConsumerStats : public Consumer
127127
gReadoutStats.counters.pagesPendingFairMQtime = 0;
128128
gReadoutStats.counters.pagesPendingFairMQreleased = 0;
129129
unsigned long long nRfmq = snapshot.pagesPendingFairMQreleased.load();
130+
int tfidfmq = (int)snapshot.timeframeIdFairMQ.load();
130131
double avgTfmq = 0.0;
131132
double rRfmq = 0.0;
132133
if (nRfmq) {
@@ -157,6 +158,7 @@ class ConsumerStats : public Consumer
157158
sendMetricNoException({ (int)nRfmq, "readout.stfbMemoryPagesLocked"});
158159
sendMetricNoException({ rRfmq, "readout.stfbMemoryPagesReleaseRate"});
159160
sendMetricNoException({ avgTfmq, "readout.stfbMemoryPagesReleaseLatency"});
161+
sendMetricNoException({ tfidfmq, "readout.stfbTimeframeId"});
160162
}
161163

162164
#ifdef WITH_ZMQ
@@ -169,7 +171,7 @@ class ConsumerStats : public Consumer
169171
if (consoleUpdate) {
170172
if (deltaT > 0) {
171173
theLog.log(LogInfoOps_(3003), "Last interval (%.2fs): blocksRx=%llu, block rate=%.2lf, bytesRx=%llu, rate=%s", deltaT, (unsigned long long)counterBlocksDiff, counterBlocksDiff / deltaT, (unsigned long long)counterBytesDiff, NumberOfBytesToString(counterBytesDiff * 8 / deltaT, "b/s", 1000).c_str());
172-
theLog.log(LogInfoOps_(3003), "STFB locked pages: current=%llu, release rate=%.2lf Hz, latency=%.3lf s", nRfmq, rRfmq, avgTfmq);
174+
theLog.log(LogInfoOps_(3003), "STFB locked pages: current=%llu, release rate=%.2lf Hz, latency=%.3lf s, current TF = %d", nRfmq, rRfmq, avgTfmq, tfidfmq );
173175
}
174176
}
175177

src/ReadoutStats.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ void ReadoutStats::reset()
4141
counters.pagesPendingFairMQ = 0;
4242
counters.pagesPendingFairMQreleased = 0;
4343
counters.pagesPendingFairMQtime = 0;
44+
counters.timeframeIdFairMQ = 0;
4445
}
4546

4647
void ReadoutStats::print()

src/ReadoutStats.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ struct ReadoutStatsCounters {
2828
std::atomic<uint64_t> pagesPendingFairMQ; // number of pages pending in ConsumerFMQ
2929
std::atomic<uint64_t> pagesPendingFairMQreleased; // number of pages which have been released by ConsumerFMQ
3030
std::atomic<uint64_t> pagesPendingFairMQtime; // latency in FMQ, in microseconds, total for all released pages
31+
std::atomic<uint32_t> timeframeIdFairMQ; // last timeframe pushed to ConsumerFMQ
3132
};
3233

3334
// need to be able to easily transmit this struct as a whole

src/readoutMonitor.cxx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,11 @@ int main(int argc, const char** argv)
182182
double previousSampleTime = 0;
183183

184184
// header
185-
printf(" Time State nStf Readout Recorder STFB STFB STFB STFB\n");
186-
printf(" total total total memory memory memory\n");
187-
printf(" locked release release\n");
188-
printf(" rate latency\n");
189-
printf(" (bytes) (bytes) (bytes) (pages) (pages/s) (s)\n");
185+
printf(" Time State nStf Readout Recorder STFB STFB STFB STFB STFB\n");
186+
printf(" total total total memory memory memory tf \n");
187+
printf(" locked release release id \n");
188+
printf(" rate latency \n");
189+
printf(" (bytes) (bytes) (bytes) (pages) (pages/s) (s) \n");
190190

191191
for (; !ShutdownRequest;) {
192192
int nb = 0;
@@ -214,7 +214,7 @@ int main(int argc, const char** argv)
214214
avgTfmq = (counters->pagesPendingFairMQtime.load() / nRfmq) / (deltaT * 1000000.0);
215215
}
216216
if (cfgRawBytes) {
217-
printf("%s\t%s\t%llu\t%llu\t%llu\t%llu\t%llu\t%.2lf\t%.6lf\n",
217+
printf("%s\t%s\t%llu\t%llu\t%llu\t%llu\t%llu\t%.2lf\t%.6lf\t%d\n",
218218
t ? getStringTime(t).c_str() : "-",
219219
(char*)&state,
220220
(unsigned long long)counters->numberOfSubtimeframes.load(),
@@ -223,9 +223,10 @@ int main(int argc, const char** argv)
223223
(unsigned long long)counters->bytesFairMQ.load(),
224224
(unsigned long long)counters->pagesPendingFairMQ.load(),
225225
nRfmq,
226-
avgTfmq);
226+
avgTfmq,
227+
(int)counters->timeframeIdFairMQ.load());
227228
} else {
228-
printf("%s %s %8llu %s %s %s %6llu %7.2lf %6.4lf\n",
229+
printf("%s %s %8llu %s %s %s %6llu %7.2lf %6.4lf %8d\n",
229230
t ? getStringTime(t).c_str() : "-",
230231
(char*)&state,
231232
(unsigned long long)counters->numberOfSubtimeframes.load(),
@@ -234,7 +235,8 @@ int main(int argc, const char** argv)
234235
NumberOfBytesToString(counters->bytesFairMQ.load(),"").c_str(),
235236
(unsigned long long)counters->pagesPendingFairMQ.load(),
236237
nRfmq,
237-
avgTfmq);
238+
avgTfmq,
239+
(int)counters->timeframeIdFairMQ.load());
238240
}
239241
}
240242
previousSampleTime = t;

0 commit comments

Comments
 (0)