History

Merge pull request #11451 from huffman/feat/upload-user-event

Add uploading to asset server event

Clément Brisset committed 9 years ago

Commit 3b488332 parents 662bb6c 9c120f110 files · +53 −22Browse files

Showing the changes to interface/src/scripting/AssetMappingsScriptingInterface.cpp (1 of 10 files). Show all

Unified · Split

interface/src/scripting/AssetMappingsScriptingInterface.cpp+16−0
@@ -21,6 +21,7 @@ · 20 unmodified lines
2121 #include <NetworkLogging.h>
2222 #include <NodeList.h>
2323 #include <OffscreenUi.h>
24+#include <UserActivityLogger.h>
2425
2526 static const int AUTO_REFRESH_INTERVAL = 1000;
2627
@@ -104,6 +105,21 @@ void AssetMappingsScriptingInterface::uploadFile(QString path, QString mapping, · 77 unmodified lines
104105
105106 startedCallback.call();
106107
108+ QFileInfo fileInfo { path };
109+ int64_t size { fileInfo.size() };
110+
111+ QString extension = "";
112+ auto idx = path.lastIndexOf(".");
113+ if (idx >= 0) {
114+ extension = path.mid(idx + 1);
115+ }
116+
117+ UserActivityLogger::getInstance().logAction("uploading_asset", {
118+ { "size", (qint64)size },
119+ { "mapping", mapping },
120+ { "extension", extension}
121+ });
122+
107123 auto upload = DependencyManager::get<AssetClient>()->createUpload(path);
108124 QObject::connect(upload, &AssetUpload::finished, this, [=](AssetUpload* upload, const QString& hash) mutable {
109125 if (upload->getError() != AssetUpload::NoError) {