UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
InstallBundleUtils.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "Async/AsyncWork.h"
6#include "Containers/Array.h"
7#include "Containers/Map.h"
9#include "Containers/Ticker.h"
11#include "CoreMinimal.h"
13#include "HAL/Platform.h"
14#include "HAL/PlatformMisc.h"
15#include "InstallBundleTypes.h"
18#include "Stats/Stats.h"
19#include "Templates/Function.h"
20#include "Templates/IsEnum.h"
22#include "Templates/UniquePtr.h"
24#include "UObject/NameTypes.h"
26
28
29namespace InstallBundleUtil
30{
31 // Returns the app version in the same format as BPS versions
33
35
37
39
41
43
44 // returns true if the given BundleName exists in the InstallBundle.ini config
45 INSTALLBUNDLEMANAGER_API bool HasInstallBundleInConfig(const FString& BundleName);
46
48 {
49 bool bWithSoftReferences = false;
50 };
51
53
54 // Returns true
56
57 // Returns true if this bundle should be included in a platform package
59
60 // Returns an ordered regex list used to map files to bundles
61 // SectionPredicate can be used to exclude non-relavent bundles from the list
65
66 // Finds a matching install bundle for a given path
69 const FString& Path,
70 FString& OutBundleName);
71
72 constexpr float MinimumBundleWeight = 0.05f;
73
74 // It would really be nice to have these in core
75 template<class EnumType>
76 constexpr auto& CastAsUnderlying(EnumType &Type)
77 {
78 static_assert(TIsEnum<EnumType>::Value, "");
79 using UnderType = std::underlying_type_t<EnumType>;
80 return *reinterpret_cast<UnderType*>(&Type);
81 }
82
83 template<class EnumType>
84 constexpr const auto& CastAsUnderlying(const EnumType &Type)
85 {
86 static_assert(TIsEnum<EnumType>::Value, "");
87 using UnderType = std::underlying_type_t<EnumType>;
88 return *reinterpret_cast<const UnderType*>(&Type);
89 }
90
91 template<class EnumType>
92 constexpr auto CastToUnderlying(EnumType Type)
93 {
94 static_assert(TIsEnum<EnumType>::Value, "");
95 using UnderType = std::underlying_type_t<EnumType>;
96 return static_cast<UnderType>(Type);
97 }
98
99 template<typename EnumType, typename StringArrType, EnumType EnumCount = EnumType::Count>
100 const TCHAR* TLexToString(EnumType E, const StringArrType& Strings)
101 {
103 static_assert(Count == UE_ARRAY_COUNT(Strings), "");
104
106 if (Idx >= 0 && Idx < Count)
107 {
108 return Strings[Idx];
109 }
110 else
111 {
112 return TEXT("");
113 }
114 }
115
116 // Keep the engine awake via RAII when running as an embedded app
118 {
120 static INSTALLBUNDLEMANAGER_API FName TagWithRendering;
121 public:
122 FInstallBundleManagerKeepAwake(bool bNeedsRendering = false)
123 : FEmbeddedKeepAwake(bNeedsRendering ? TagWithRendering : Tag, bNeedsRendering) {}
124 };
125
158
159 // Helper to safely suppress installer analytics that will restore previous state when going out of scope
173
175 {
176 public:
178
180 : WorkFunc(MoveTemp(InWork))
181 , OnCompleteFunc(MoveTemp(InOnComplete))
182 {}
183
184 void DoWork()
185 {
186 if (WorkFunc)
187 {
188 WorkFunc();
189 }
190 }
191
193 {
194 if (OnCompleteFunc)
195 {
196 OnCompleteFunc();
197 }
198 }
199
204
205 private:
206 TUniqueFunction<void()> WorkFunc;
207 TUniqueFunction<void()> OnCompleteFunc;
208 };
209
212
214
216
218
220
222
224
226 {
227 double StartTime = 0.0;
228 double EndTime = 0.0;
230 bool bOpen = true;
231
232 double GetElapsedTime() const
233 {
234 return (EndTime > StartTime) ? (EndTime - StartTime) : 0.0;
235 }
236 };
237
239 {
240 double StartTime = 0.0;
241 double EndTime = 0.0;
242 bool bOpen = true;
244
245 double GetElapsedTime() const
246 {
247 return (EndTime > StartTime) ? (EndTime - StartTime) : 0.0;
248 }
249 };
250
252 {
253 private:
254 FName BundleName;
255 void* Cookie = nullptr;
256
257 public:
259 : BundleName(InBundleName), Cookie(InCookie)
260 {}
261
262 FName GetBundleName() const { return BundleName; }
263 void* GetCookie() const { return Cookie; }
264
266 {
267 return BundleName == Other.BundleName && Cookie == Other.Cookie;
268 }
269
271 {
272 return HashCombineFast(GetTypeHash(Key.GetBundleName()), GetTypeHash(Key.GetCookie()));
273 }
274 };
275
277 {
278 private:
280
281 public:
287
289 {
290 return StatsMap.Find(Key);
291 }
292
294 {
295 return StatsMap.FindChecked(Key);
296 }
297
298 UE_DEPRECATED(5.7, "Use FContentRequestStatsKey version")
299 void StatsBegin(FName BundleName) { StatsBegin(FContentRequestStatsKey(BundleName, nullptr)); }
300 UE_DEPRECATED(5.7, "Use FContentRequestStatsKey version")
301 void StatsEnd(FName BundleName) { StatsEnd(FContentRequestStatsKey(BundleName, nullptr)); }
302 UE_DEPRECATED(5.7, "Use FContentRequestStatsKey version")
303 void StatsBegin(FName BundleName, const TCHAR* State) { StatsBegin(FContentRequestStatsKey(BundleName, nullptr)); }
304 UE_DEPRECATED(5.7, "Use FContentRequestStatsKey version")
305 void StatsEnd(FName BundleName, const TCHAR* State, uint64 DataSize = 0) { StatsEnd(FContentRequestStatsKey(BundleName, nullptr)); }
306 UE_DEPRECATED(5.7, "Use FContentRequestStatsKey version")
307 void StatsReset(FName BundleName) { StatsReset(FContentRequestStatsKey(BundleName, nullptr)); }
308
309 UE_DEPRECATED(5.7, "Use FindStats and FindStatsChecked")
311 };
312
313 namespace PersistentStats
314 {
315 //Stats used to store timing information in FPersistentTimerData format
316 //_Real stats account for total time since a stat was started regardless of the app's state (shutdown, in foreground, etc.)
317 //_FG stats account for time while the app is active
318 //_BG stats are an estimate of time while the app is inactive (backgrounded, closed, etc.)
319 // *_BG stats are an estimate as we can not account for unexpected crashes, etc.
321 {
332 , PSOTime_FG
333 , PSOTime_BG
334 , NumStatNames //should always be final entry
335 };
336
337 //Stats used to store count information in an int format
339 {
343 , NumStatNames //should always be final entry
344 };
345
348
349 //Returns if the timer is in the _Real set
351 //Returns if the timer is in the _FG set
353 //Returns if the timer is in the _BG set
355
356 //Gets the _Real timer when supplied with the corresponding _FG or _BG timer name
358 //Gets the _FG timer when supplied with the corresponding _Real or _BG timer name
360 //Gets the _BG timer when supplied with the corresponding _Real or _FG timer name
362
364 {
365 public:
367 JSON_SERIALIZE("LastUpdateTime", LastUpdateTime);
370
371 public:
376
379 };
380
381 //Both ContentRequests and Individual Bundles use this to track data respective to themselves.
382 //Keeps us from having to write serialization / loading data for both cases that would be the same
384 {
385 public:
386 //We should not ever really be serializing this base class. Kept it here for reference.
388 JSON_SERIALIZE("AnalyticsSessionID", AnalyticsSessionID);
392
393 public:
395
396 //Tries to load persistent stats from disk and determine if we need to resume our previous persistent session or start a new one
398
399 //Tries to set this stat pool as "inactive". By default also stop all active timers.
400 // NOTE: If you don't stop all active timers future calls to UpdateTimingStat will still increment this value and save it off!
402
407
410
411 bool IsActive() const { return bIsActive; }
412 bool IsDirty() const { return bIsDirty; }
413
415
418
421
422 //Saves the persistent stat data to disk in the location returned by GetFullPathForStatFile()
423 //Returns True if that save succeeds and false otherwise.
425
426 //Function that allows you to load stats from disk. Returns true if stats were either loaded from disk now, or previously were loaded from disk.
427 //NOTE: This does not begin stat collection, so you should still call StatsBegin on this before handling any stats!
429
430 protected:
432
433 //Called after we load data but before we process any of it.
434 //Useful for fixing up the data loaded from disk before it changes or is acted upon by anything else
435 //NOTE: A call to LoadStatsFromDisk will not necessarily call this! It will only be called when data is actually pulled from
436 //the disk, and its possible to skip pulling data from the disk!
438
439 //Helper to try and reconcile offline and active timers after we load data from disk
441
442 //Protected so we can only construct the derived versions of this Base class
452
453 protected:
454 //Serialized Stat Data
458
459 //We don't serialize these as they are tracking behavior and not stats
462
464
465 //Static Methods
466 public:
467 //Helper function that generates a basic ExpectedAnalyticsID from device and UE information
469
470 //Pure Virtual Methods
471 public:
472 //Returns Full Path to look for our persistent stat cache
473 virtual const FString GetFullPathForStatFile() const = 0;
474 };
475
476 //Each bundles persistent stats
478 {
479 public:
481 JSON_SERIALIZE("BundleName", BundleName);
482 JSON_SERIALIZE("AnalyticsSessionID", AnalyticsSessionID);
486
487
488 private:
489 //Remove default constructor as we require a BundleName in the constructor
490 FBundlePersistentStats() = delete;
491
492 //Used in our full path and should signify the FString version of the FName of this bundle we are tracking
493 FString BundleName;
494
495 public:
497 : BundleName(BundleNameIn.ToString())
498 {
499 }
500
502
503 //Implementation for FInstallBundleStatsContainerBase
504 public:
505 INSTALLBUNDLEMANAGER_API virtual const FString GetFullPathForStatFile() const override;
506 };
507
508 //Tracks a set of bundles and stats for a named session. This way you can have stats across multiple bundle installs grouped by some naming convention
510 {
511 public:
513 JSON_SERIALIZE("SessionName", SessionName);
514 JSON_SERIALIZE_ARRAY("RequiredBundles", RequiredBundles);
515 JSON_SERIALIZE("AnalyticsSessionID", AnalyticsSessionID);
519
520 private:
521 //Remove default constructor as we require a ContentRequestName in the constructor
522 FSessionPersistentStats() = delete;
523
524 //Used in our full path and should signify some identifier for a given ContentRequest
525 FString SessionName;
526
527 //Used to keep track of all bundles that are part of this content request
528 TArray<FString> RequiredBundles;
529
530 public:
532 : SessionName(ContentRequestNameIn)
533 , RequiredBundles()
534 {
535 }
536
538
541
542 //Removes all Required Bundle Names except the ones in the NewRequiredBundlesList. If no NewRequiredBundlesList is supplied, just erases all RequiredBundles.
543 //This includes ones loaded from the persistent cache from previous runs. This re-saves the persistent cache file so they will be removed completely.
545
546 //Populates the passed in TArray with all the required bundles' names
548
549 //Implementation for FInstallBundleStatsContainerBase
550 public:
551 INSTALLBUNDLEMANAGER_API virtual const FString GetFullPathForStatFile() const override;
552 };
553
554 //Helper class to handle holding a collection of Bundle and Session stats.
556 {
557 public:
560
561 //NOTE! These 2 functions are not virtual as we call them in the construct/deconstructor!
564
565 //Starts Bundle Persistent Stat Tracking for the given BundleName. Will automatically load applicable data from the disk and reset that cache
566 //if the ExpectedAnalyticsID doesn't match the one previously serialized.
567 //Uses FInstallBundleStatsContainerBase::GetBaseExpectedAnalyticsID if an ExpectedAnalyticsID is not passed in or empty
568 INSTALLBUNDLEMANAGER_API virtual void StartBundlePersistentStatTracking(FName BundleName, const FString& ExpectedAnalyticsID = FString(), bool bForceResetStatData = false);
569
570 //Starts Session Persistent Stat Tracking under the given SessionName. Will automatically load applicable data from the disk and reset that cache
571 //if the ExpectedAnalyticsID doesn't match the one previously serialized.
572 //Uses FInstallBundleStatsContainerBase::GetBaseExpectedAnalyticsID if an ExpectedAnalyticsID is not passed in or empty
573 INSTALLBUNDLEMANAGER_API virtual void StartSessionPersistentStatTracking(const FString& SessionName, const TArray<FName>& RequiredBundles = TArray<FName>(), const FString& ExpectedAnalyticsID = FString(), bool bForceResetStatData = false);
574
576 INSTALLBUNDLEMANAGER_API virtual void StopSessionPersistentStatTracking(const FString& SessionName, bool bStopAllActiveTimers = true);
577
580
583
586
589
591 INSTALLBUNDLEMANAGER_API virtual const FSessionPersistentStats* GetSessionStat(const FString& SessionName) const;
592
594
595 //Deletes persistent stat information from our stats for this Session/Bundle to reduce memory useage
596 INSTALLBUNDLEMANAGER_API virtual void RemoveSessionStats(const FString& SessionName);
597 INSTALLBUNDLEMANAGER_API virtual void RemoveBundleStats(FName BundleName);
598
599 protected:
600 INSTALLBUNDLEMANAGER_API virtual bool Tick(float dt);
603
606
609
614
615 //Called whenever we start a timer
616 //NOTE: doesn't get called by timer's being Start/Stopped for bShouldAutoHandleFGBGStats
618
619 //Called whenever we stop a timer
620 //NOTE: doesn't get called by timer's being Start/Stopped for bShouldAutoHandleFGBGStats
622
623 //Stops active foreground timers when going to background and starts applicable background version
624 //Also increments background counters
626
627 //Stops active background timers and resumes applicable foreground timers
628 //Also increments foreground counters
630
631 //Goes through this Session's RequiredBundles and loads data from disk for those bundles. Allows us to make sure we have
632 //full data in memory from disk without having to know the previous runs AnalyticsID to call StatsBegin on that bundle.
633 //NOTE: You should still call StatsBegin on the listed bundles before Starting/Incrementing/ETC any analytics! This just
634 //ensures that the previous run data exists for this given session!
635 INSTALLBUNDLEMANAGER_API virtual void LoadRequiredBundleDataFromDiskForSession(const FString& SessionName);
636
637 protected:
640
644
645 //internal counter used to track when we need to run our timer update during tick. Requires bShouldAutoUpdateTimersInTick to be set to true to effect anything.
646 //reset to TimerAutoUpdateRate whenever we trigger the auto update.
648
649 //internal counter used to track when we need to update all of our dirty stats. Requires bShouldSaveDirtyStatsOnTick to be set to true to effect anything.
650 //reset to TimerAutoUpdateRate whenever we trigger the dirty stat update
652
653
654 /****** Config Values ******/
655 // All values are loaded from GEngineIni in [InstallBundleManager.PersistentStatSettings]
656
657 /****** Timer Auto Update Settings ****/
658 //These settings determine if we auto-update our Timer stats on a tick. Without an auto-update timers would only update on Start / Stop potentially leaving us vulnerable to
659 //dropping a lot of timing information in the event of a crash. By setting these values you ensure your data is accurate to some interval.
660 //
661 //bShouldAutoUpdateTimersInTick -- Determines if the auto update feature is on at all. Rate of auto timer updates is determined by TimerAutoUpdateRate.
662 //
663 //TimerAutoUpdateRate -- Determines the rate we trigger the update in seconds. <=0 means update every tick.
664 //
667
668 /****** Stat Save To Disk Settings ****/
669 //These settings determine how we handle saving our stats to disk. Outside of these settings, stats ALWAYS try to save to disk on Start or End, but these settings
670 //let us also configure other times we may want to save the data to disk.
671 //
672 //bShouldSaveDirtyStatsOnTick -- If this is set to true then all stats that have bIsDirty set to true will try to save to disk every X seconds. Update rate determined by DirtyStatSaveToDiskRate
673 // This way we will not update a given stat more then once a tick to disk.
674 //
675 //DirtyStatSaveToDiskRate -- Determines how often we update our dirty stats in seconds. <=0 means update every tick.
678
679 //Determines if we should automatically Start,Stop,and Update the _FG and _BG versions of our timer stats.
680 //If true you only have to call Start/Stop on the _Real versions of all timers and we will automatically
681 //Start and Stop the _FG and _BG timers when going to background or returning to foreground to keep
682 //their data accurate.
684 };
685 }
686
691
703} // InstallBundleUtil
OODEFFUNC typedef void(OODLE_CALLBACK t_fp_OodleCore_Plugin_Free)(void *ptr)
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
FPlatformTypes::uint64 uint64
A 64-bit unsigned integer.
Definition Platform.h:1117
#define RETURN_QUICK_DECLARE_CYCLE_STAT(StatId, GroupId)
Definition Stats.h:655
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
OnComplete(MoveTemp(Response))
ENetworkConnectionType
Definition GenericPlatformMisc.h:383
EInstallBundlePauseFlags
Definition InstallBundleTypes.h:279
#define BEGIN_JSON_SERIALIZER
Definition JsonSerializerMacros.h:21
#define END_JSON_SERIALIZER
Definition JsonSerializerMacros.h:26
constexpr uint32 HashCombineFast(uint32 A, uint32 B)
Definition TypeHash.h:74
#define UE_ARRAY_COUNT(array)
Definition UnrealTemplate.h:212
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
uint8_t uint8
Definition binka_ue_file_header.h:8
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition AsyncWork.h:585
Definition AsyncWork.h:63
Definition ConfigCacheIni.h:566
Definition IDelegateInstance.h:14
Definition EmbeddedCommunication.h:111
Definition NameTypes.h:617
Definition AsyncWork.h:663
Definition UnrealTemplate.h:321
Definition QueuedThreadPool.h:105
Definition InstallBundleUtils.h:252
FName GetBundleName() const
Definition InstallBundleUtils.h:262
void * GetCookie() const
Definition InstallBundleUtils.h:263
bool operator==(const FContentRequestStatsKey &Other) const
Definition InstallBundleUtils.h:265
FContentRequestStatsKey(FName InBundleName, void *InCookie)
Definition InstallBundleUtils.h:258
friend uint32 GetTypeHash(const FContentRequestStatsKey &Key)
Definition InstallBundleUtils.h:270
Definition InstallBundleUtils.h:277
const FContentRequestStats * FindStats(const FContentRequestStatsKey &Key) const
Definition InstallBundleUtils.h:288
INSTALLBUNDLEMANAGER_API void StatsEnd(const FContentRequestStatsKey &Key)
Definition InstallBundleUtils.cpp:403
void StatsEnd(FName BundleName, const TCHAR *State, uint64 DataSize=0)
Definition InstallBundleUtils.h:305
const TMap< FContentRequestStatsKey, FContentRequestStats > & GetMap()
Definition InstallBundleUtils.h:310
void StatsBegin(FName BundleName)
Definition InstallBundleUtils.h:299
const FContentRequestStats & FindStatsChecked(const FContentRequestStatsKey &Key) const
Definition InstallBundleUtils.h:293
void StatsReset(FName BundleName)
Definition InstallBundleUtils.h:307
void StatsBegin(FName BundleName, const TCHAR *State)
Definition InstallBundleUtils.h:303
INSTALLBUNDLEMANAGER_API void StatsBegin(const FContentRequestStatsKey &Key)
Definition InstallBundleUtils.cpp:392
void StatsEnd(FName BundleName)
Definition InstallBundleUtils.h:301
INSTALLBUNDLEMANAGER_API void StatsReset(const FContentRequestStatsKey &Key)
Definition InstallBundleUtils.cpp:420
Definition InstallBundleUtils.h:118
FInstallBundleManagerKeepAwake(bool bNeedsRendering=false)
Definition InstallBundleUtils.h:122
FInstallBundleManagerScreenSaverControl & operator=(const FInstallBundleManagerScreenSaverControl &Other)=default
FInstallBundleManagerScreenSaverControl()
Definition InstallBundleUtils.h:135
FInstallBundleManagerScreenSaverControl(const FInstallBundleManagerScreenSaverControl &Other)
Definition InstallBundleUtils.h:145
FInstallBundleManagerScreenSaverControl(FInstallBundleManagerScreenSaverControl &&Other)=default
~FInstallBundleManagerScreenSaverControl()
Definition InstallBundleUtils.h:140
FInstallBundleManagerScreenSaverControl & operator=(FInstallBundleManagerScreenSaverControl &&Other)
Definition InstallBundleUtils.h:152
Definition InstallBundleUtils.h:175
TStatId GetStatId() const
Definition InstallBundleUtils.h:200
void CallOnComplete()
Definition InstallBundleUtils.h:192
FInstallBundleWork(TUniqueFunction< void()> InWork, TUniqueFunction< void()> InOnComplete)
Definition InstallBundleUtils.h:179
void DoWork()
Definition InstallBundleUtils.h:184
JSON_SERIALIZE("AnalyticsSessionID", AnalyticsSessionID)
virtual ~FBundlePersistentStats()
Definition InstallBundleUtils.h:501
JSON_SERIALIZE_MAP_SERIALIZABLE("TimingStats", TimingStatsMap, FPersistentTimerData)
INSTALLBUNDLEMANAGER_API BEGIN_JSON_SERIALIZER JSON_SERIALIZE("BundleName", BundleName)
FBundlePersistentStats(FName BundleNameIn)
Definition InstallBundleUtils.h:496
virtual INSTALLBUNDLEMANAGER_API const FString GetFullPathForStatFile() const override
Definition InstallBundleUtils.cpp:1057
float TimerAutoUpdateTimeRemaining
Definition InstallBundleUtils.h:647
virtual INSTALLBUNDLEMANAGER_API void UpdateStatsForForeground(FPersistentStatsBase &StatToUpdate)
Definition InstallBundleUtils.cpp:1472
float DirtyStatSaveToDiskRate
Definition InstallBundleUtils.h:677
virtual INSTALLBUNDLEMANAGER_API void UpdateAllBundlesActiveTimers()
Definition InstallBundleUtils.cpp:1501
virtual INSTALLBUNDLEMANAGER_API void OnForeground_HandleBundleStats()
Definition InstallBundleUtils.cpp:1407
bool bShouldSaveDirtyStatsOnTick
Definition InstallBundleUtils.h:676
virtual INSTALLBUNDLEMANAGER_API void OnTimerStoppedForStat(FPersistentStatsBase &BundleStatForTimer, ETimingStatNames TimerStarted)
Definition InstallBundleUtils.cpp:1194
virtual INSTALLBUNDLEMANAGER_API void LoadRequiredBundleDataFromDiskForSession(const FString &SessionName)
Definition InstallBundleUtils.cpp:1293
virtual INSTALLBUNDLEMANAGER_API void StartSessionPersistentStatTracking(const FString &SessionName, const TArray< FName > &RequiredBundles=TArray< FName >(), const FString &ExpectedAnalyticsID=FString(), bool bForceResetStatData=false)
Definition InstallBundleUtils.cpp:1260
virtual INSTALLBUNDLEMANAGER_API void StopBundlePersistentStatTracking(FName BundleName, bool bStopAllActiveTimers=true)
Definition InstallBundleUtils.cpp:1275
virtual INSTALLBUNDLEMANAGER_API void StopSessionPersistentStatTracking(const FString &SessionName, bool bStopAllActiveTimers=true)
Definition InstallBundleUtils.cpp:1284
float TimerDirtyStatUpdateTimeRemaining
Definition InstallBundleUtils.h:651
virtual INSTALLBUNDLEMANAGER_API void IncrementSessionPersistentCounter(const FString &SessionName, ECountStatNames CounterToUpdate)
Definition InstallBundleUtils.cpp:1374
float TimerAutoUpdateRate
Definition InstallBundleUtils.h:666
bool bShouldAutoUpdateTimersInTick
Definition InstallBundleUtils.h:665
virtual INSTALLBUNDLEMANAGER_API void StartBundlePersistentStatTimer(FName BundleName, ETimingStatNames TimerToStart)
Definition InstallBundleUtils.cpp:1318
FDelegateHandle OnApp_EnteringBackgroundHandle
Definition InstallBundleUtils.h:643
virtual INSTALLBUNDLEMANAGER_API void OnApp_EnteringForeground()
Definition InstallBundleUtils.cpp:1389
virtual INSTALLBUNDLEMANAGER_API void OnTimerStartedForStat(FPersistentStatsBase &BundleStatForTimer, ETimingStatNames TimerStarted)
Definition InstallBundleUtils.cpp:1178
INSTALLBUNDLEMANAGER_API FPersistentStatContainerBase()
Definition InstallBundleUtils.cpp:1067
virtual INSTALLBUNDLEMANAGER_API void StopBundlePersistentStatTimer(FName BundleName, ETimingStatNames TimerToStop)
Definition InstallBundleUtils.cpp:1338
virtual INSTALLBUNDLEMANAGER_API void OnForeground_HandleSessionStats()
Definition InstallBundleUtils.cpp:1431
virtual INSTALLBUNDLEMANAGER_API void UpdateStatsForBackground(FPersistentStatsBase &StatToUpdate)
Definition InstallBundleUtils.cpp:1443
virtual INSTALLBUNDLEMANAGER_API const FBundlePersistentStats * GetBundleStat(FName BundleName) const
Definition InstallBundleUtils.cpp:1531
virtual INSTALLBUNDLEMANAGER_API void StartBundlePersistentStatTracking(FName BundleName, const FString &ExpectedAnalyticsID=FString(), bool bForceResetStatData=false)
Definition InstallBundleUtils.cpp:1251
virtual INSTALLBUNDLEMANAGER_API void IncrementBundlePersistentCounter(FName BundleName, ECountStatNames CounterToUpdate)
Definition InstallBundleUtils.cpp:1366
virtual INSTALLBUNDLEMANAGER_API void StopSessionPersistentStatTimer(const FString &SessionName, ETimingStatNames TimerToStop)
Definition InstallBundleUtils.cpp:1346
INSTALLBUNDLEMANAGER_API void InitializeBase()
Definition InstallBundleUtils.cpp:1089
virtual INSTALLBUNDLEMANAGER_API void ResetTimerUpdate()
Definition InstallBundleUtils.cpp:1204
virtual INSTALLBUNDLEMANAGER_API void OnApp_EnteringBackground()
Definition InstallBundleUtils.cpp:1382
virtual INSTALLBUNDLEMANAGER_API void OnBackground_HandleBundleStats()
Definition InstallBundleUtils.cpp:1395
virtual INSTALLBUNDLEMANAGER_API void ResetDirtyStatUpdate()
Definition InstallBundleUtils.cpp:1209
TMap< FName, FBundlePersistentStats > PerBundlePersistentStatMap
Definition InstallBundleUtils.h:638
virtual INSTALLBUNDLEMANAGER_API void RemoveSessionStats(const FString &SessionName)
Definition InstallBundleUtils.cpp:1241
virtual INSTALLBUNDLEMANAGER_API void UpdateBundlePersistentStatTimer(FName BundleName, ETimingStatNames TimerToUpdate)
Definition InstallBundleUtils.cpp:1354
virtual INSTALLBUNDLEMANAGER_API void OnBackground_HandleSessionStats()
Definition InstallBundleUtils.cpp:1419
FTSTicker::FDelegateHandle TickHandle
Definition InstallBundleUtils.h:641
bool bShouldAutoHandleFGBGStats
Definition InstallBundleUtils.h:683
virtual INSTALLBUNDLEMANAGER_API void UpdateSessionPersistentStatTimer(const FString &SessionName, ETimingStatNames TimerToUpdate)
Definition InstallBundleUtils.cpp:1360
virtual INSTALLBUNDLEMANAGER_API void RemoveBundleStats(FName BundleName)
Definition InstallBundleUtils.cpp:1246
virtual INSTALLBUNDLEMANAGER_API void UpdateAllSessionActiveTimers()
Definition InstallBundleUtils.cpp:1513
virtual INSTALLBUNDLEMANAGER_API ~FPersistentStatContainerBase()
Definition InstallBundleUtils.cpp:1084
INSTALLBUNDLEMANAGER_API void ShutdownBase()
Definition InstallBundleUtils.cpp:1129
virtual INSTALLBUNDLEMANAGER_API const FSessionPersistentStats * GetSessionStat(const FString &SessionName) const
Definition InstallBundleUtils.cpp:1536
FDelegateHandle OnApp_EnteringForegroundHandle
Definition InstallBundleUtils.h:642
virtual INSTALLBUNDLEMANAGER_API void SaveAllDirtyStatsToDisk()
Definition InstallBundleUtils.cpp:1214
virtual INSTALLBUNDLEMANAGER_API void StartSessionPersistentStatTimer(const FString &SessionName, ETimingStatNames TimerToStart)
Definition InstallBundleUtils.cpp:1328
TMap< FString, FSessionPersistentStats > SessionPersistentStatMap
Definition InstallBundleUtils.h:639
INSTALLBUNDLEMANAGER_API void StartTimingStat(ETimingStatNames StatToUpdate)
Definition InstallBundleUtils.cpp:833
INSTALLBUNDLEMANAGER_API void IncrementCountStat(PersistentStats::ECountStatNames StatToUpdate)
Definition InstallBundleUtils.cpp:809
INSTALLBUNDLEMANAGER_API const FPersistentTimerData * GetTimingStatData(ETimingStatNames StatToGet) const
Definition InstallBundleUtils.cpp:799
INSTALLBUNDLEMANAGER_API bool HasCountStat(ECountStatNames StatToCheck) const
Definition InstallBundleUtils.cpp:793
INSTALLBUNDLEMANAGER_API void OnLoadingDataFromDisk()
Definition InstallBundleUtils.cpp:937
bool IsActive() const
Definition InstallBundleUtils.h:411
bool IsDirty() const
Definition InstallBundleUtils.h:412
INSTALLBUNDLEMANAGER_API void UpdateAllActiveTimers()
Definition InstallBundleUtils.cpp:882
JSON_SERIALIZE_MAP_SERIALIZABLE("TimingStats", TimingStatsMap, FPersistentTimerData)
virtual const FString GetFullPathForStatFile() const =0
bool bIsDirty
Definition InstallBundleUtils.h:461
virtual ~FPersistentStatsBase()
Definition InstallBundleUtils.h:394
INSTALLBUNDLEMANAGER_API void StopTimingStat(ETimingStatNames StatToUpdate, bool UpdateTimerOnStop=true)
Definition InstallBundleUtils.cpp:849
INSTALLBUNDLEMANAGER_API void StatsEnd(bool bStopAllActiveTimers=true)
Definition InstallBundleUtils.cpp:923
INSTALLBUNDLEMANAGER_API const int * GetCountStatData(ECountStatNames StatToGet) const
Definition InstallBundleUtils.cpp:804
FString AnalyticsSessionID
Definition InstallBundleUtils.h:457
bool bIsActive
Definition InstallBundleUtils.h:460
INSTALLBUNDLEMANAGER_API bool HasTimingStat(ETimingStatNames StatToCheck) const
Definition InstallBundleUtils.cpp:787
INSTALLBUNDLEMANAGER_API bool LoadStatsFromDisk()
Definition InstallBundleUtils.cpp:746
static INSTALLBUNDLEMANAGER_API const FString GetBaseExpectedAnalyticsID()
Definition InstallBundleUtils.cpp:1525
INSTALLBUNDLEMANAGER_API void HandleTimerStatsAfterDataLoad()
Definition InstallBundleUtils.cpp:942
bool bHasLoadedFromDisk
Definition InstallBundleUtils.h:463
TMap< FString, FPersistentTimerData > TimingStatsMap
Definition InstallBundleUtils.h:455
INSTALLBUNDLEMANAGER_API bool IsTimingStatStarted(ETimingStatNames StatToUpdate) const
Definition InstallBundleUtils.cpp:817
INSTALLBUNDLEMANAGER_API BEGIN_JSON_SERIALIZER JSON_SERIALIZE("AnalyticsSessionID", AnalyticsSessionID)
INSTALLBUNDLEMANAGER_API bool SaveStatsToDisk()
Definition InstallBundleUtils.cpp:772
TMap< FString, int > CountStatMap
Definition InstallBundleUtils.h:456
INSTALLBUNDLEMANAGER_API void StatsBegin(const FString &ExpectedAnalyticsID, bool bForceResetData=false)
Definition InstallBundleUtils.cpp:906
INSTALLBUNDLEMANAGER_API void ResetStats(const FString &NewAnalyticsSessionID)
Definition InstallBundleUtils.cpp:778
INSTALLBUNDLEMANAGER_API void UpdateTimingStat(ETimingStatNames StatToUpdate)
Definition InstallBundleUtils.cpp:863
INSTALLBUNDLEMANAGER_API void StopAllActiveTimers()
Definition InstallBundleUtils.cpp:894
FPersistentStatsBase()
Definition InstallBundleUtils.h:443
FPersistentTimerData()
Definition InstallBundleUtils.h:372
double LastUpdateTime
Definition InstallBundleUtils.h:377
double CurrentValue
Definition InstallBundleUtils.h:378
BEGIN_JSON_SERIALIZER JSON_SERIALIZE("LastUpdateTime", LastUpdateTime)
INSTALLBUNDLEMANAGER_API void AddRequiredBundles(const TArray< FString > &RequiredBundlesToAdd)
Definition InstallBundleUtils.cpp:1022
JSON_SERIALIZE("AnalyticsSessionID", AnalyticsSessionID)
INSTALLBUNDLEMANAGER_API BEGIN_JSON_SERIALIZER JSON_SERIALIZE("SessionName", SessionName)
JSON_SERIALIZE_MAP_SERIALIZABLE("TimingStats", TimingStatsMap, FPersistentTimerData)
INSTALLBUNDLEMANAGER_API void GetRequiredBundles(TArray< FString > &OutRequiredBundles) const
Definition InstallBundleUtils.cpp:1041
virtual ~FSessionPersistentStats()
Definition InstallBundleUtils.h:537
FSessionPersistentStats(const FString &ContentRequestNameIn)
Definition InstallBundleUtils.h:531
INSTALLBUNDLEMANAGER_API void ResetRequiredBundles(const TArray< FString > &NewRequiredBundles=TArray< FString >())
Definition InstallBundleUtils.cpp:1050
virtual INSTALLBUNDLEMANAGER_API const FString GetFullPathForStatFile() const override
Definition InstallBundleUtils.cpp:1062
JSON_SERIALIZE_ARRAY("RequiredBundles", RequiredBundles)
Definition Array.h:670
Definition AssetRegistryState.h:50
Definition UnrealString.h.inl:34
Definition SharedPointer.h:692
Definition FunctionFwd.h:19
Definition UniquePtr.h:107
const FString & LexToString(ETimingStatNames InType)
Definition InstallBundleUtils.cpp:472
ETimingStatNames
Definition InstallBundleUtils.h:321
ETimingStatNames GetAssociatedBGTimerName(ETimingStatNames InTimerType)
Definition InstallBundleUtils.cpp:710
ECountStatNames
Definition InstallBundleUtils.h:339
bool IsTimerBG(ETimingStatNames InTimerType)
Definition InstallBundleUtils.cpp:608
ETimingStatNames GetAssociatedRealTimerName(ETimingStatNames InTimerType)
Definition InstallBundleUtils.cpp:638
bool IsTimerReal(ETimingStatNames InTimerType)
Definition InstallBundleUtils.cpp:548
ETimingStatNames GetAssociatedFGTimerName(ETimingStatNames InTimerType)
Definition InstallBundleUtils.cpp:674
bool IsTimerFG(ETimingStatNames InTimerType)
Definition InstallBundleUtils.cpp:578
Definition InstallBundleUtils.cpp:25
void CleanupInstallBundleAsyncIOTasks(TArray< TUniquePtr< FInstallBundleTask > > &Tasks)
Definition InstallBundleUtils.cpp:380
bool GetMountOptionsFromConfig(const FStringView BundleName, FConfigMountOptions &OutMountOptions)
Definition InstallBundleUtils.cpp:159
bool HasInstallBundleInConfig(const FString &BundleName)
Definition InstallBundleUtils.cpp:148
const FString & GetInstallBundleSectionPrefix()
Definition InstallBundleUtils.cpp:94
void StartInstallBundleAsyncIOTask(TUniqueFunction< void()> WorkFunc)
Definition InstallBundleUtils.cpp:333
bool MatchBundleRegex(const TArray< TPair< FString, TArray< FRegexPattern > > > &BundleRegexList, const FString &Path, FString &OutBundleName)
Definition InstallBundleUtils.cpp:248
bool IsPlatformInstallBundlePredicate(const FConfigFile &InstallBundleConfig, const FString &Section)
Definition InstallBundleUtils.cpp:180
void FinishInstallBundleAsyncIOTasks(TArray< TUniquePtr< FInstallBundleTask > > &Tasks)
Definition InstallBundleUtils.cpp:357
const TCHAR * GetInstallBundlePauseReason(EInstallBundlePauseFlags Flags)
Definition InstallBundleUtils.cpp:78
bool SplitHostUrl(const FStringView Url, FStringView &OutHost, FStringView &OutRemainder)
Definition InstallBundleUtils.cpp:37
constexpr float MinimumBundleWeight
Definition InstallBundleUtils.h:72
bool HasInternetConnection(ENetworkConnectionType ConnectionType)
Definition InstallBundleUtils.cpp:31
bool AllInstallBundlePredicate(const FConfigFile &InstallBundleConfig, const FString &Section)
Definition InstallBundleUtils.cpp:175
constexpr auto & CastAsUnderlying(EnumType &Type)
Definition InstallBundleUtils.h:76
bool GetConfiguredBundleSources(TArray< FString > &OutSources, TMap< FString, FString > &OutFallbackSources)
Definition InstallBundleUtils.cpp:100
const TCHAR * TLexToString(EnumType E, const StringArrType &Strings)
Definition InstallBundleUtils.h:100
TArray< TPair< FString, TArray< FRegexPattern > > > LoadBundleRegexFromConfig(const FConfigFile &InstallBundleConfig, TFunctionRef< bool(const FConfigFile &InstallBundleConfig, const FString &Section)> SectionPredicate)
Definition InstallBundleUtils.cpp:194
constexpr auto CastToUnderlying(EnumType Type)
Definition InstallBundleUtils.h:92
FString GetAppVersion()
Definition InstallBundleUtils.cpp:26
@ false
Definition radaudio_common.h:23
Definition JsonSerializable.h:17
Definition InstallBundleUtils.h:48
bool bWithSoftReferences
Definition InstallBundleUtils.h:49
Definition InstallBundleUtils.h:693
FContentRequestSharedContext & operator=(const FContentRequestSharedContext &Other)=delete
FContentRequestSharedContext & operator=(FContentRequestSharedContext &&Other)=default
FContentRequestSharedContext(const FContentRequestSharedContext &Other)=delete
TMap< FInstallBundleSourceType, TUniquePtr< IBundleSourceContentRequestSharedContext > > BundleSourceSharedContext
Definition InstallBundleUtils.h:700
FContentRequestSharedContext(FContentRequestSharedContext &&Other)=default
Definition InstallBundleUtils.h:226
uint64 DataSize
Definition InstallBundleUtils.h:229
double EndTime
Definition InstallBundleUtils.h:228
double StartTime
Definition InstallBundleUtils.h:227
bool bOpen
Definition InstallBundleUtils.h:230
double GetElapsedTime() const
Definition InstallBundleUtils.h:232
Definition InstallBundleUtils.h:239
double StartTime
Definition InstallBundleUtils.h:240
double GetElapsedTime() const
Definition InstallBundleUtils.h:245
bool bOpen
Definition InstallBundleUtils.h:242
TMap< FString, FContentRequestStateStats > StateStats
Definition InstallBundleUtils.h:243
double EndTime
Definition InstallBundleUtils.h:241
Definition InstallBundleUtils.h:161
INSTALLBUNDLEMANAGER_API void Enable()
Definition InstallBundleUtils.cpp:310
INSTALLBUNDLEMANAGER_API void Disable()
Definition InstallBundleUtils.cpp:319
static INSTALLBUNDLEMANAGER_API bool IsEnabled()
Definition InstallBundleUtils.cpp:328
INSTALLBUNDLEMANAGER_API ~FInstallBundleSuppressAnalytics()
Definition InstallBundleUtils.cpp:305
INSTALLBUNDLEMANAGER_API FInstallBundleSuppressAnalytics()
Definition InstallBundleUtils.cpp:300
virtual ~IBundleSourceContentRequestSharedContext()
Definition InstallBundleUtils.h:689
Definition IsEnum.h:7
Definition LightweightStats.h:416
Definition Tuple.h:652