Skip to content

WebRequest

Summary

MembersDescriptions
class FRH_WebRequestsClass to handle executing and tracking low-level Http Web Requests.
struct FRH_WebResponseWeb call response data.
struct FRH_WebRequestWeb call request data.

class FRH_WebRequests

class FRH_WebRequests
: public TSharedFromThis< FRH_WebRequests >

Class to handle executing and tracking low-level Http Web Requests.

Summary

MembersDescriptions
public FRH_WebRequests()
public void Initialize(RallyHereAPI::FRallyHereAPIAll * InAPIs)Initialize the Web Request system.
public void Uninitialize()Safely tears down the Web Request system.
public const TDoubleLinkedList< TSharedPtr< FRH_WebRequest> > &GetTrackedRequests() constGets all of the requests that have been tracked.
public const FRH_WebRequest*GetTrackedRequestById(const FGuid & id) constGets a specific request that has been tracked.
public inline void ClearTrackedRequests()Clears all tracked requests out.
public const TArray< FName > GetAPINames() constGets the list of all APIs able to be tracked.
public bool GetLogAllWebRequests() constGets if we are currently logging web requests from all APIs.
public void SetLogAllWebRequests(bool bValue)Sets logging web requests for all APIs.
public FString FormatWebRequestToJsonBlob(const FRH_WebRequest & request) constConverts a Web Request to a string in JSON format.
public TSharedPtr< FJsonObject > LogTrackedWebRequestsToJSON() constLogs all tracked request to a specified file.
public inline FORCEINLINE bool GetLogWebRequests(const FName & APIName) constGets if a specific API is being logged currently.
public inline FORCEINLINE void SetLogWebRequests(const FName & APIName,bool bValue)Sets logging for a specific API.
public inline FORCEINLINE bool GetIsRetainingWebRequests() constGet whether web requests should be cached indefinitely or cleared after reaching the cache limit.
public inline FORCEINLINE void SetIsRetainingWebRequests(bool bValue)Set whether web requests should be cached indefinitely or cleared after reaching the cache limit.
public inline const TMap< FName, int32 > GetAPINameToCallCountMap() constGet the map that tracks all-time call count for each API.
public inline const TMap< FName, int32 > GetSimplifiedPathToCallCountMap() constGet the map that tracks all-time call count for each generic URL.
public void GetRecentCallCountMaps(TMap< FName, int32 > * OutAPIRecentCallCountMap,TMap< FName, int32 > * OutURLRecentCallCountMap) constGet the maps that track call counts in the last 60s.
public void DetectRecentBursts(TMap< FName, TTuple< int32, int32 >> * OutBurstMapByAPIName,TMap< FName, TTuple< int32, int32 >> * OutBurstMapByURL) constDetects bursts in recent call counts (last 60s). The time and count thresholds for burst detection are specified by BurstCountThreshold and BurstTimeThreshold.

Members

public FRH_WebRequests()

public void Initialize(RallyHereAPI::FRallyHereAPIAll * InAPIs)

Initialize the Web Request system.

Parameters

  • InAPIs The APIs the web request system tracks requests from.

public void Uninitialize()

Safely tears down the Web Request system.

public const TDoubleLinkedList< TSharedPtr< FRH_WebRequest> > &GetTrackedRequests() const

Gets all of the requests that have been tracked.

public const FRH_WebRequest*GetTrackedRequestById(const FGuid & id) const

Gets a specific request that has been tracked.

Parameters

  • id The id of the request to get.

public inline void ClearTrackedRequests()

Clears all tracked requests out.

public const TArray< FName > GetAPINames() const

Gets the list of all APIs able to be tracked.

public bool GetLogAllWebRequests() const

Gets if we are currently logging web requests from all APIs.

public void SetLogAllWebRequests(bool bValue)

Sets logging web requests for all APIs.

Parameters

  • bValue If true, turn on logging for all APIs, else turn off.

public FString FormatWebRequestToJsonBlob(const FRH_WebRequest & request) const

Converts a Web Request to a string in JSON format.

Parameters

  • request The request to format to JSON

Returns

String of the request in JSON format.

public TSharedPtr< FJsonObject > LogTrackedWebRequestsToJSON() const

Logs all tracked request to a specified file.

Parameters

  • World The context world object.

Returns

the full path of the file that was written

public inline FORCEINLINE bool GetLogWebRequests(const FName & APIName) const

Gets if a specific API is being logged currently.

Parameters

  • APIName API name to check.

public inline FORCEINLINE void SetLogWebRequests(const FName & APIName,bool bValue)

Sets logging for a specific API.

Parameters

  • APIName API to change logging state of.

  • bValue if true, turn on logging for the API, else turn off.

public inline FORCEINLINE bool GetIsRetainingWebRequests() const

Get whether web requests should be cached indefinitely or cleared after reaching the cache limit.

public inline FORCEINLINE void SetIsRetainingWebRequests(bool bValue)

Set whether web requests should be cached indefinitely or cleared after reaching the cache limit.

Parameters

  • bValue if true, requests are retained, if not, they are cleared upon reaching the cache limit.

public inline const TMap< FName, int32 > GetAPINameToCallCountMap() const

Get the map that tracks all-time call count for each API.

public inline const TMap< FName, int32 > GetSimplifiedPathToCallCountMap() const

Get the map that tracks all-time call count for each generic URL.

public void GetRecentCallCountMaps(TMap< FName, int32 > * OutAPIRecentCallCountMap,TMap< FName, int32 > * OutURLRecentCallCountMap) const

Get the maps that track call counts in the last 60s.

Parameters

  • OutAPIRecentCallCountMap Pointer to output call count map by API names

  • OutURLRecentCallCountMap Pointer to output call count map by Simplified Paths

public void DetectRecentBursts(TMap< FName, TTuple< int32, int32 >> * OutBurstMapByAPIName,TMap< FName, TTuple< int32, int32 >> * OutBurstMapByURL) const

Detects bursts in recent call counts (last 60s). The time and count thresholds for burst detection are specified by BurstCountThreshold and BurstTimeThreshold.

Parameters

  • OutBurstMapByAPIName Pointer to output burst map by API name (API Name -> <Number of bursts, Largest burst>)

  • OutBurstMapByURL Pointer to output burst map by Simplified Path (Simplified Path -> <Number of bursts, Largest burst>)

struct FRH_WebResponse

Web call response data.

Summary

MembersDescriptions
public TMap< FString, FString > HeadersHeaders of the Web Response.
public FString ContentContent of the Web Response.
public int32 ResponseCodeResonse Code of the Web Response.
public bool ResponseSuccessWas the response successful from a client perspective.
public FDateTime ReceivedTimeThe tiem the response was received.
public inline FRH_WebResponse()

Members

public TMap< FString, FString > Headers

Headers of the Web Response.

public FString Content

Content of the Web Response.

public int32 ResponseCode

Resonse Code of the Web Response.

public bool ResponseSuccess

Was the response successful from a client perspective.

public FDateTime ReceivedTime

The tiem the response was received.

public inline FRH_WebResponse()

struct FRH_WebRequest

Web call request data.

Summary

MembersDescriptions
public RallyHereAPI::FRequestMetadata MetadataMetadata for the Web Request.
public FName APINameThe API name of the Web Request.
public FDateTime TimestampThe local timestamp when the request was made.
public FString VerbVerb for the action type of the Web Request.
public FString URLURL for the Web Request.
public TMap< FString, FString > HeadersHeaders for the Web Request.
public FString ContentContent for the Web Request.
public TArray< FRH_WebResponse>ResponsesResponse for the Web Request. Can contain multiple if the request had to be retried.
public inline FRH_WebRequest()

Members

public RallyHereAPI::FRequestMetadata Metadata

Metadata for the Web Request.

public FName APIName

The API name of the Web Request.

public FDateTime Timestamp

The local timestamp when the request was made.

public FString Verb

Verb for the action type of the Web Request.

public FString URL

URL for the Web Request.

public TMap< FString, FString > Headers

Headers for the Web Request.

public FString Content

Content for the Web Request.

public TArray< FRH_WebResponse>Responses

Response for the Web Request. Can contain multiple if the request had to be retried.

public inline FRH_WebRequest()