11/22/2020
文章目录
stat 指令
- STAT_Group
- game
- engine
- RHI
- UNIT
- 组里面又有细分,叫做STAT_Name
- GC sweep time
- Tick Time
- 每一个Name可能会有CallCount,InclusiveAvgTime,InclusiveMaxTime等等记录性能的数据(统计数据类型)
如何从C++保存这些数据呢?
RetriveStatData
蓝图函数库可以在蓝图中调用该函数,如果是Statics静态的,那么可以在任意蓝图中调用该函数
#include "Stats/StatsData.h"
UCLASS()
class MAPSTAT_API UCustomizeStatics : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintCallable)
static bool RetrieveStatData(const TArray<FString>&ArrayName, TArray<int32>& CallCounts, TArray<float>& InclusiveAvg,
TArray<float>& InclusiveMax);
};
//ArrayName == StatsName
bool UCustomizeStatics::RetrieveStatData(const TArray<FString>&ArrayName, TArray<int32>& CallCounts, TArray<float>& InclusiveAvg, TArray<float>& InclusiveMax)
{
#if STATS
FGameThreadStatsData* ViewData = FLatestGameThreadStatsData::Get().Latest;
if (!ViewData)
{
return false;
}
const int32 Size