Collect statistic about used file format versions.
Later it will be useful when we will decide which formats to support for backward compatibility.
This commit is contained in:
parent
be88184f7c
commit
1ed8bf4a46
|
@ -29,6 +29,7 @@
|
||||||
|
|
||||||
#include <QCloseEvent>
|
#include <QCloseEvent>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
|
#include <QFileInfo>
|
||||||
#include <QFileSystemWatcher>
|
#include <QFileSystemWatcher>
|
||||||
#include <QLoggingCategory>
|
#include <QLoggingCategory>
|
||||||
#include <QPrintDialog>
|
#include <QPrintDialog>
|
||||||
|
@ -41,7 +42,6 @@
|
||||||
#include <QtMath>
|
#include <QtMath>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <QFileInfo>
|
|
||||||
|
|
||||||
#include "../ifc/exception/vexception.h"
|
#include "../ifc/exception/vexception.h"
|
||||||
#include "../ifc/xml/vlayoutconverter.h"
|
#include "../ifc/xml/vlayoutconverter.h"
|
||||||
|
@ -465,6 +465,25 @@ auto VPMainWindow::LoadFile(const QString &path) -> bool
|
||||||
lock.reset();
|
lock.reset();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VCommonSettings *settings = VAbstractApplication::VApp()->Settings();
|
||||||
|
if (settings->IsCollectStatistic())
|
||||||
|
{
|
||||||
|
auto *statistic = VGAnalytics::Instance();
|
||||||
|
|
||||||
|
QString clientID = settings->GetClientID();
|
||||||
|
if (clientID.isEmpty())
|
||||||
|
{
|
||||||
|
clientID = QUuid::createUuid().toString();
|
||||||
|
settings->SetClientID(clientID);
|
||||||
|
statistic->SetClientID(clientID);
|
||||||
|
}
|
||||||
|
|
||||||
|
statistic->Enable(true);
|
||||||
|
|
||||||
|
const qint64 uptime = VAbstractApplication::VApp()->AppUptime();
|
||||||
|
statistic->SendLayoutFormatVersion(uptime, converter.GetFormatVersionStr());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (VException &e)
|
catch (VException &e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -475,6 +475,25 @@ auto TMainWindow::LoadFile(const QString &path) -> bool
|
||||||
m_curFileFormatVersion = converter.GetCurrentFormatVersion();
|
m_curFileFormatVersion = converter.GetCurrentFormatVersion();
|
||||||
m_curFileFormatVersionStr = converter.GetFormatVersionStr();
|
m_curFileFormatVersionStr = converter.GetFormatVersionStr();
|
||||||
m_m->setXMLContent(converter.Convert()); // Read again after conversion
|
m_m->setXMLContent(converter.Convert()); // Read again after conversion
|
||||||
|
|
||||||
|
VCommonSettings *settings = VAbstractApplication::VApp()->Settings();
|
||||||
|
if (settings->IsCollectStatistic())
|
||||||
|
{
|
||||||
|
auto *statistic = VGAnalytics::Instance();
|
||||||
|
|
||||||
|
QString clientID = settings->GetClientID();
|
||||||
|
if (clientID.isEmpty())
|
||||||
|
{
|
||||||
|
clientID = QUuid::createUuid().toString();
|
||||||
|
settings->SetClientID(clientID);
|
||||||
|
statistic->SetClientID(clientID);
|
||||||
|
}
|
||||||
|
|
||||||
|
statistic->Enable(true);
|
||||||
|
|
||||||
|
const qint64 uptime = VAbstractApplication::VApp()->AppUptime();
|
||||||
|
statistic->SendMultisizeMeasurementsFormatVersion(uptime, m_curFileFormatVersionStr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -482,6 +501,25 @@ auto TMainWindow::LoadFile(const QString &path) -> bool
|
||||||
m_curFileFormatVersion = converter.GetCurrentFormatVersion();
|
m_curFileFormatVersion = converter.GetCurrentFormatVersion();
|
||||||
m_curFileFormatVersionStr = converter.GetFormatVersionStr();
|
m_curFileFormatVersionStr = converter.GetFormatVersionStr();
|
||||||
m_m->setXMLContent(converter.Convert()); // Read again after conversion
|
m_m->setXMLContent(converter.Convert()); // Read again after conversion
|
||||||
|
|
||||||
|
VCommonSettings *settings = VAbstractApplication::VApp()->Settings();
|
||||||
|
if (settings->IsCollectStatistic())
|
||||||
|
{
|
||||||
|
auto *statistic = VGAnalytics::Instance();
|
||||||
|
|
||||||
|
QString clientID = settings->GetClientID();
|
||||||
|
if (clientID.isEmpty())
|
||||||
|
{
|
||||||
|
clientID = QUuid::createUuid().toString();
|
||||||
|
settings->SetClientID(clientID);
|
||||||
|
statistic->SetClientID(clientID);
|
||||||
|
}
|
||||||
|
|
||||||
|
statistic->Enable(true);
|
||||||
|
|
||||||
|
const qint64 uptime = VAbstractApplication::VApp()->AppUptime();
|
||||||
|
statistic->SendIndividualMeasurementsFormatVersion(uptime, m_curFileFormatVersionStr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (not m_m->IsDefinedKnownNamesValid())
|
if (not m_m->IsDefinedKnownNamesValid())
|
||||||
|
@ -1635,6 +1673,25 @@ void TMainWindow::ImportFromPattern()
|
||||||
QScopedPointer<VLitePattern> doc(new VLitePattern());
|
QScopedPointer<VLitePattern> doc(new VLitePattern());
|
||||||
doc->setXMLContent(converter.Convert());
|
doc->setXMLContent(converter.Convert());
|
||||||
measurements = doc->ListMeasurements();
|
measurements = doc->ListMeasurements();
|
||||||
|
|
||||||
|
VCommonSettings *settings = VAbstractApplication::VApp()->Settings();
|
||||||
|
if (settings->IsCollectStatistic())
|
||||||
|
{
|
||||||
|
auto *statistic = VGAnalytics::Instance();
|
||||||
|
|
||||||
|
QString clientID = settings->GetClientID();
|
||||||
|
if (clientID.isEmpty())
|
||||||
|
{
|
||||||
|
clientID = QUuid::createUuid().toString();
|
||||||
|
settings->SetClientID(clientID);
|
||||||
|
statistic->SetClientID(clientID);
|
||||||
|
}
|
||||||
|
|
||||||
|
statistic->Enable(true);
|
||||||
|
|
||||||
|
const qint64 uptime = VAbstractApplication::VApp()->AppUptime();
|
||||||
|
statistic->SendPatternFormatVersion(uptime, converter.GetFormatVersionStr());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (VException &e)
|
catch (VException &e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
#include <QDoubleSpinBox>
|
#include <QDoubleSpinBox>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
|
#include <QFileInfo>
|
||||||
#include <QFileSystemWatcher>
|
#include <QFileSystemWatcher>
|
||||||
#include <QFuture>
|
#include <QFuture>
|
||||||
#include <QGlobalStatic>
|
#include <QGlobalStatic>
|
||||||
|
@ -54,7 +55,6 @@
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <QFileInfo>
|
|
||||||
|
|
||||||
#include "../ifc/exception/vexceptionconversionerror.h"
|
#include "../ifc/exception/vexceptionconversionerror.h"
|
||||||
#include "../ifc/exception/vexceptionemptyparameter.h"
|
#include "../ifc/exception/vexceptionemptyparameter.h"
|
||||||
|
@ -6349,6 +6349,25 @@ auto MainWindow::LoadPattern(QString fileName, const QString &customMeasureFile)
|
||||||
m_curFileFormatVersion = converter->GetCurrentFormatVersion();
|
m_curFileFormatVersion = converter->GetCurrentFormatVersion();
|
||||||
m_curFileFormatVersionStr = converter->GetFormatVersionStr();
|
m_curFileFormatVersionStr = converter->GetFormatVersionStr();
|
||||||
doc->setXMLContent(converter->Convert());
|
doc->setXMLContent(converter->Convert());
|
||||||
|
|
||||||
|
VCommonSettings *settings = VAbstractApplication::VApp()->Settings();
|
||||||
|
if (settings->IsCollectStatistic())
|
||||||
|
{
|
||||||
|
auto *statistic = VGAnalytics::Instance();
|
||||||
|
|
||||||
|
QString clientID = settings->GetClientID();
|
||||||
|
if (clientID.isEmpty())
|
||||||
|
{
|
||||||
|
clientID = QUuid::createUuid().toString();
|
||||||
|
settings->SetClientID(clientID);
|
||||||
|
statistic->SetClientID(clientID);
|
||||||
|
}
|
||||||
|
|
||||||
|
statistic->Enable(true);
|
||||||
|
|
||||||
|
const qint64 uptime = VAbstractApplication::VApp()->AppUptime();
|
||||||
|
statistic->SendPatternFormatVersion(uptime, m_curFileFormatVersionStr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!customMeasureFile.isEmpty())
|
if (!customMeasureFile.isEmpty())
|
||||||
|
@ -6920,11 +6939,49 @@ auto MainWindow::CheckPathToMeasurements(const QString &patternPath, const QStri
|
||||||
{
|
{
|
||||||
VVSTConverter converter(mPath);
|
VVSTConverter converter(mPath);
|
||||||
m->setXMLContent(converter.Convert()); // Read again after conversion
|
m->setXMLContent(converter.Convert()); // Read again after conversion
|
||||||
|
|
||||||
|
VCommonSettings *settings = VAbstractApplication::VApp()->Settings();
|
||||||
|
if (settings->IsCollectStatistic())
|
||||||
|
{
|
||||||
|
auto *statistic = VGAnalytics::Instance();
|
||||||
|
|
||||||
|
QString clientID = settings->GetClientID();
|
||||||
|
if (clientID.isEmpty())
|
||||||
|
{
|
||||||
|
clientID = QUuid::createUuid().toString();
|
||||||
|
settings->SetClientID(clientID);
|
||||||
|
statistic->SetClientID(clientID);
|
||||||
|
}
|
||||||
|
|
||||||
|
statistic->Enable(true);
|
||||||
|
|
||||||
|
const qint64 uptime = VAbstractApplication::VApp()->AppUptime();
|
||||||
|
statistic->SendMultisizeMeasurementsFormatVersion(uptime, converter.GetFormatVersionStr());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
VVITConverter converter(mPath);
|
VVITConverter converter(mPath);
|
||||||
m->setXMLContent(converter.Convert()); // Read again after conversion
|
m->setXMLContent(converter.Convert()); // Read again after conversion
|
||||||
|
|
||||||
|
VCommonSettings *settings = VAbstractApplication::VApp()->Settings();
|
||||||
|
if (settings->IsCollectStatistic())
|
||||||
|
{
|
||||||
|
auto *statistic = VGAnalytics::Instance();
|
||||||
|
|
||||||
|
QString clientID = settings->GetClientID();
|
||||||
|
if (clientID.isEmpty())
|
||||||
|
{
|
||||||
|
clientID = QUuid::createUuid().toString();
|
||||||
|
settings->SetClientID(clientID);
|
||||||
|
statistic->SetClientID(clientID);
|
||||||
|
}
|
||||||
|
|
||||||
|
statistic->Enable(true);
|
||||||
|
|
||||||
|
const qint64 uptime = VAbstractApplication::VApp()->AppUptime();
|
||||||
|
statistic->SendIndividualMeasurementsFormatVersion(uptime, converter.GetFormatVersionStr());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (not m->IsDefinedKnownNamesValid())
|
if (not m->IsDefinedKnownNamesValid())
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
#include "../ifc/xml/vvstconverter.h"
|
#include "../ifc/xml/vvstconverter.h"
|
||||||
#include "../vdxf/libdxfrw/drw_base.h"
|
#include "../vdxf/libdxfrw/drw_base.h"
|
||||||
#include "../vformat/vmeasurements.h"
|
#include "../vformat/vmeasurements.h"
|
||||||
|
#include "../vganalytics/vganalytics.h"
|
||||||
#include "../vlayout/vlayoutexporter.h"
|
#include "../vlayout/vlayoutexporter.h"
|
||||||
#include "../vlayout/vlayoutgenerator.h"
|
#include "../vlayout/vlayoutgenerator.h"
|
||||||
#include "../vmisc/compatibility.h"
|
#include "../vmisc/compatibility.h"
|
||||||
|
@ -1299,11 +1300,49 @@ auto MainWindowsNoGUI::OpenMeasurementFile(const QString &path) const -> QShared
|
||||||
{
|
{
|
||||||
VVSTConverter converter(path);
|
VVSTConverter converter(path);
|
||||||
m->setXMLContent(converter.Convert()); // Read again after conversion
|
m->setXMLContent(converter.Convert()); // Read again after conversion
|
||||||
|
|
||||||
|
VCommonSettings *settings = VAbstractApplication::VApp()->Settings();
|
||||||
|
if (settings->IsCollectStatistic())
|
||||||
|
{
|
||||||
|
auto *statistic = VGAnalytics::Instance();
|
||||||
|
|
||||||
|
QString clientID = settings->GetClientID();
|
||||||
|
if (clientID.isEmpty())
|
||||||
|
{
|
||||||
|
clientID = QUuid::createUuid().toString();
|
||||||
|
settings->SetClientID(clientID);
|
||||||
|
statistic->SetClientID(clientID);
|
||||||
|
}
|
||||||
|
|
||||||
|
statistic->Enable(true);
|
||||||
|
|
||||||
|
const qint64 uptime = VAbstractApplication::VApp()->AppUptime();
|
||||||
|
statistic->SendMultisizeMeasurementsFormatVersion(uptime, converter.GetFormatVersionStr());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
VVITConverter converter(path);
|
VVITConverter converter(path);
|
||||||
m->setXMLContent(converter.Convert()); // Read again after conversion
|
m->setXMLContent(converter.Convert()); // Read again after conversion
|
||||||
|
|
||||||
|
VCommonSettings *settings = VAbstractApplication::VApp()->Settings();
|
||||||
|
if (settings->IsCollectStatistic())
|
||||||
|
{
|
||||||
|
auto *statistic = VGAnalytics::Instance();
|
||||||
|
|
||||||
|
QString clientID = settings->GetClientID();
|
||||||
|
if (clientID.isEmpty())
|
||||||
|
{
|
||||||
|
clientID = QUuid::createUuid().toString();
|
||||||
|
settings->SetClientID(clientID);
|
||||||
|
statistic->SetClientID(clientID);
|
||||||
|
}
|
||||||
|
|
||||||
|
statistic->Enable(true);
|
||||||
|
|
||||||
|
const qint64 uptime = VAbstractApplication::VApp()->AppUptime();
|
||||||
|
statistic->SendIndividualMeasurementsFormatVersion(uptime, converter.GetFormatVersionStr());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (not m->IsDefinedKnownNamesValid())
|
if (not m->IsDefinedKnownNamesValid())
|
||||||
|
|
|
@ -305,6 +305,62 @@ void VGAnalytics::SendPatternToolUsedEvent(qint64 engagementTimeMsec, const QStr
|
||||||
SendEvent(QStringLiteral("vapp_pattern_tool_used"), params);
|
SendEvent(QStringLiteral("vapp_pattern_tool_used"), params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void VGAnalytics::SendPatternFormatVersion(qint64 engagementTimeMsec, const QString &version)
|
||||||
|
{
|
||||||
|
QHash<QString, QJsonValue> params{
|
||||||
|
// In order for user activity to display in standard reports like Realtime, engagement_time_msec and session_id
|
||||||
|
// must be supplied as part of the params for an event.
|
||||||
|
// https://developers.google.com/analytics/devguides/collection/protocol/ga4/sending-events?client_type=gtag#optional_parameters_for_reports
|
||||||
|
{QStringLiteral("engagement_time_msec"), engagementTimeMsec},
|
||||||
|
{QStringLiteral("format_version"), version},
|
||||||
|
};
|
||||||
|
|
||||||
|
SendEvent(QStringLiteral("vapp_pattern_format_version"), params);
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void VGAnalytics::SendIndividualMeasurementsFormatVersion(qint64 engagementTimeMsec, const QString &version)
|
||||||
|
{
|
||||||
|
QHash<QString, QJsonValue> params{
|
||||||
|
// In order for user activity to display in standard reports like Realtime, engagement_time_msec and session_id
|
||||||
|
// must be supplied as part of the params for an event.
|
||||||
|
// https://developers.google.com/analytics/devguides/collection/protocol/ga4/sending-events?client_type=gtag#optional_parameters_for_reports
|
||||||
|
{QStringLiteral("engagement_time_msec"), engagementTimeMsec},
|
||||||
|
{QStringLiteral("format_version"), version},
|
||||||
|
};
|
||||||
|
|
||||||
|
SendEvent(QStringLiteral("vapp_individual_measurements_format_version"), params);
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void VGAnalytics::SendMultisizeMeasurementsFormatVersion(qint64 engagementTimeMsec, const QString &version)
|
||||||
|
{
|
||||||
|
QHash<QString, QJsonValue> params{
|
||||||
|
// In order for user activity to display in standard reports like Realtime, engagement_time_msec and session_id
|
||||||
|
// must be supplied as part of the params for an event.
|
||||||
|
// https://developers.google.com/analytics/devguides/collection/protocol/ga4/sending-events?client_type=gtag#optional_parameters_for_reports
|
||||||
|
{QStringLiteral("engagement_time_msec"), engagementTimeMsec},
|
||||||
|
{QStringLiteral("format_version"), version},
|
||||||
|
};
|
||||||
|
|
||||||
|
SendEvent(QStringLiteral("vapp_multisize_measurements_format_version"), params);
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void VGAnalytics::SendLayoutFormatVersion(qint64 engagementTimeMsec, const QString &version)
|
||||||
|
{
|
||||||
|
QHash<QString, QJsonValue> params{
|
||||||
|
// In order for user activity to display in standard reports like Realtime, engagement_time_msec and session_id
|
||||||
|
// must be supplied as part of the params for an event.
|
||||||
|
// https://developers.google.com/analytics/devguides/collection/protocol/ga4/sending-events?client_type=gtag#optional_parameters_for_reports
|
||||||
|
{QStringLiteral("engagement_time_msec"), engagementTimeMsec},
|
||||||
|
{QStringLiteral("format_version"), version},
|
||||||
|
};
|
||||||
|
|
||||||
|
SendEvent(QStringLiteral("vapp_layout_format_version"), params);
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* A query for a POST message will be created to report this event. The
|
* A query for a POST message will be created to report this event. The
|
||||||
|
|
|
@ -90,6 +90,10 @@ public slots:
|
||||||
void SendAppStartEvent(qint64 engagementTimeMsec);
|
void SendAppStartEvent(qint64 engagementTimeMsec);
|
||||||
void SendAppCloseEvent(qint64 engagementTimeMsec);
|
void SendAppCloseEvent(qint64 engagementTimeMsec);
|
||||||
void SendPatternToolUsedEvent(qint64 engagementTimeMsec, const QString &toolName);
|
void SendPatternToolUsedEvent(qint64 engagementTimeMsec, const QString &toolName);
|
||||||
|
void SendPatternFormatVersion(qint64 engagementTimeMsec, const QString &version);
|
||||||
|
void SendIndividualMeasurementsFormatVersion(qint64 engagementTimeMsec, const QString &version);
|
||||||
|
void SendMultisizeMeasurementsFormatVersion(qint64 engagementTimeMsec, const QString &version);
|
||||||
|
void SendLayoutFormatVersion(qint64 engagementTimeMsec, const QString &version);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY_MOVE(VGAnalytics) // NOLINT
|
Q_DISABLE_COPY_MOVE(VGAnalytics) // NOLINT
|
||||||
|
|
Loading…
Reference in New Issue
Block a user