Skip to content

Commit 11f6020

Browse files
authored
Misc[MQB]: remove log Stats dumped; log admin cmd execution time (#983)
Signed-off-by: Evgeny Malygin <[email protected]>
1 parent 5cffa17 commit 11f6020

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/groups/mqb/mqba/mqba_application.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646

4747
#include <bmqscm_version.h>
4848
#include <bmqst_statcontext.h>
49+
#include <bmqsys_operationlogger.h>
4950
#include <bmqsys_time.h>
5051
#include <bmqu_memoutstream.h>
5152

@@ -977,11 +978,18 @@ int Application::processCommandCb(
977978
const bsl::function<void(int, const bsl::string&)>& onProcessedCb,
978979
bool fromReroute)
979980
{
980-
bmqu::MemOutStream os;
981-
int rc = processCommand(source, cmd, os, fromReroute);
981+
bmqsys::OperationLogger opLogger(d_allocator_p);
982+
// Set operation name later when we have a return code
983+
opLogger.start();
984+
985+
bmqu::MemOutStream os(d_allocator_p);
986+
const int rc = processCommand(source, cmd, os, fromReroute);
987+
opLogger.operation() << "Process command '" << cmd << "' (rc = " << rc
988+
<< ")";
982989

983990
onProcessedCb(rc, os.str());
984991

992+
// `opLogger` logs execution time on destruction
985993
return rc; // RETURN
986994
}
987995

src/groups/mqb/mqbstat/mqbstat_printer.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,10 +271,6 @@ void Printer::logStats()
271271
{
272272
++d_lastStatId;
273273

274-
// Put a 'reference' in the main log file. We do that first in case it
275-
// crashes/hangs in dump stat, this will help figuring it
276-
BALL_LOG_INFO << "Stats dumped [id: " << d_lastStatId << "]";
277-
278274
// Dump to statslog file
279275
// Prepare the log record and associated attributes
280276
ball::Record record;

0 commit comments

Comments
 (0)