Set analytics APIs for remote capture file and replay

The API used was not populated for the case of remote
capture and replay.
This commit is contained in:
Aliya Pazylbekova
2019-06-18 16:28:03 -04:00
committed by Baldur Karlsson
parent 4923aa9d88
commit e21ddb4877
5 changed files with 56 additions and 13 deletions
+5
View File
@@ -939,6 +939,11 @@ void CaptureContext::LoadCaptureThreaded(const QString &captureFile, const QStri
bytebuf buf = access->GetSectionContents(idx);
LoadNotes(QString::fromUtf8((const char *)buf.data(), buf.count()));
}
QString driver = access->DriverName();
if(!driver.isEmpty())
{
ANALYTIC_ADDUNIQ(APIs, driver);
}
}
m_LoadInProgress = false;
+1 -5
View File
@@ -663,7 +663,7 @@ void MainWindow::LoadCapture(const QString &filename, bool temporary, bool local
return;
}
driver = QString::fromUtf8(file->DriverName());
driver = file->DriverName();
machineIdent = QString::fromUtf8(file->RecordedMachineIdent());
support = file->LocalReplaySupport();
@@ -796,10 +796,6 @@ void MainWindow::LoadCapture(const QString &filename, bool temporary, bool local
{
ANALYTIC_SET(UIFeatures.ImageViewer, true);
}
else if(!driver.isEmpty())
{
ANALYTIC_ADDUNIQ(APIs, driver);
}
m_Ctx.LoadCapture(fileToLoad, origFilename, temporary, local);
}
+7 -7
View File
@@ -1532,6 +1532,13 @@ Must only be called after :meth:`InitResolver` has returned ``True``.
)");
virtual rdcarray<rdcstr> GetResolve(const rdcarray<uint64_t> &callstack) = 0;
DOCUMENT(R"(Retrieves the name of the driver that was used to create this capture.
:return: A simple string identifying the driver used to make the capture.
:rtype: ``str``
)");
virtual rdcstr DriverName() = 0;
protected:
ICaptureAccess() = default;
~ICaptureAccess() = default;
@@ -1797,13 +1804,6 @@ replay support.
)");
virtual ReplaySupport LocalReplaySupport() = 0;
DOCUMENT(R"(Retrieves the name of the driver that was used to create this capture.
:return: A simple string identifying the driver used to make the capture.
:rtype: ``str``
)");
virtual const char *DriverName() = 0;
DOCUMENT(R"(Retrieves the identifying string describing what type of machine created this capture.
:return: A string identifying the machine ident used to make the capture.
+42
View File
@@ -63,6 +63,7 @@ enum RemoteServerPacket
eRemoteServer_ListDir,
eRemoteServer_ExecuteAndInject,
eRemoteServer_ShutdownServer,
eRemoteServer_GetDriverName,
eRemoteServer_GetSectionCount,
eRemoteServer_FindSectionByName,
eRemoteServer_FindSectionByType,
@@ -584,6 +585,17 @@ static void ActiveRemoteClientThread(ClientThread *threadData,
SERIALISE_ELEMENT(StackFrames);
}
}
else if(type == eRemoteServer_GetDriverName)
{
reader.EndChunk();
std::string driver = rdc ? rdc->GetDriverName() : "";
{
WRITE_DATA_SCOPE();
SCOPED_SERIALISE_CHUNK(eRemoteServer_GetDriverName);
SERIALISE_ELEMENT(driver);
}
}
else if(type == eRemoteServer_GetSectionCount)
{
reader.EndChunk();
@@ -1631,6 +1643,36 @@ public:
rend->Shutdown();
}
rdcstr DriverName()
{
if(!Connected())
return 0;
{
WRITE_DATA_SCOPE();
SCOPED_SERIALISE_CHUNK(eRemoteServer_GetDriverName);
}
std::string driverName = "";
{
READ_DATA_SCOPE();
RemoteServerPacket type = ser.ReadChunk<RemoteServerPacket>();
if(type == eRemoteServer_GetDriverName)
{
SERIALISE_ELEMENT(driverName);
}
else
{
RDCERR("Unexpected response to GetDriverName");
}
ser.EndChunk();
}
return driverName;
}
int GetSectionCount()
{
if(!Connected())
+1 -1
View File
@@ -120,7 +120,7 @@ public:
rdcstr ErrorString() { return m_ErrorString; }
void Shutdown() { delete this; }
ReplaySupport LocalReplaySupport() { return m_Support; }
const char *DriverName() { return m_DriverName.c_str(); }
rdcstr DriverName() { return m_DriverName; }
const char *RecordedMachineIdent() { return m_Ident.c_str(); }
rdcpair<ReplayStatus, IReplayController *> OpenCapture(RENDERDOC_ProgressCallback progress);