Skip to content
Snippets Groups Projects
Commit 0a5cb17f authored by Pawel Polanski's avatar Pawel Polanski
Browse files

Information about the time that took the CODA to process a command.

parent 278730dd
No related branches found
No related tags found
No related merge requests found
......@@ -251,6 +251,7 @@ CodaClientApplication::ParseArgsResult CodaClientApplication::parseArguments(QSt
bool CodaClientApplication::start()
{
m_startTime.start();
switch (m_mode) {
case Launch: {
const QString args = m_launchArgs.join(QString(QLatin1Char(' ')));
......@@ -405,7 +406,7 @@ void CodaClientApplication::handleFileSystemFStat(const tcftrk::TcfTrkCommandRes
void CodaClientApplication::handleFileSystemClose(const tcftrk::TcfTrkCommandResult &result)
{
if (result.type == tcftrk::TcfTrkCommandResult::SuccessReply) {
std::printf("File closed.\n.");
std::printf("File closed.\n");
const bool ok = m_mode == Put ? m_putWriteOk : m_statFstatOk;
doExit(ok ? 0 : -1);
} else {
......@@ -485,6 +486,8 @@ void CodaClientApplication::slotTcftrkEvent (const tcftrk::TcfTrkEvent &ev)
void CodaClientApplication::doExit(int ex)
{
std::printf("Operation took %4.2f second(s)\n", m_startTime.elapsed()/1000.);
if (!m_trkDevice.isNull()) {
const QSharedPointer<QIODevice> dev = m_trkDevice->device();
if (QAbstractSocket *socket = qobject_cast<QAbstractSocket *>(dev.data())) {
......
......@@ -33,6 +33,7 @@
#include <QtCore/QCoreApplication>
#include <QtCore/QStringList>
#include <QtCore/QSharedPointer>
#include <QtCore/QTime>
QT_FORWARD_DECLARE_CLASS(QFile)
......@@ -95,6 +96,7 @@ private:
QByteArray m_remoteFileHandle;
quint64 m_putChunkSize;
unsigned m_verbose;
QTime m_startTime;
QScopedPointer<tcftrk::TcfTrkDevice> m_trkDevice;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment