WebRequest
Summary
| Members | Descriptions |
|---|---|
class URH_WebRequests | Class to handle executing and tracking low-level Http Web Requests. |
struct FRH_WebResponse | Web call response data. |
struct FRH_WebRequest | Web call request data. |
class URH_WebRequests
class URH_WebRequests
: public UObject
Class to handle executing and tracking low-level Http Web Requests.
Summary
| Members | Descriptions |
|---|---|
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() const | Gets all of the requests that have been tracked. |
public const FRH_WebRequest*GetTrackedRequestById(FGuid id) const | Gets a specific request that has been tracked. |
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. |
public FString FormatWebRequestToJsonBlob(const FRH_WebRequest & request) const | Converts a Web Request to a string in JSON format. |
public TSharedPtr< FJsonObject > LogTrackedWebRequestsToJSON() const | Logs all tracked request to a specified file. |
public inline FORCEINLINE bool GetLogWebRequests(const FName & APIName) const | Gets 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() 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. |
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. |
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. |
Members
public void Initialize(RallyHereAPI::FRallyHereAPIAll * InAPIs)
Initialize the Web Request system.
Parameters
InAPIsThe 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(FGuid id) const
Gets a specific request that has been tracked.
Parameters
idThe 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
bValueIf 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
requestThe 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
WorldThe 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
APINameAPI name to check.
public inline FORCEINLINE void SetLogWebRequests(const FName & APIName,bool bValue)
Sets logging for a specific API.
Parameters
-
APINameAPI to change logging state of. -
bValueif 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
bValueif 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
-
OutAPIRecentCallCountMapPointer to output call count map by API names -
OutURLRecentCallCountMapPointer 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
-
OutBurstMapByAPINamePointer to output burst map by API name (API Name -> <Number of bursts, Largest burst>) -
OutBurstMapByURLPointer to output burst map by Simplified Path (Simplified Path -> <Number of bursts, Largest burst>)
struct FRH_WebResponse
Web call response data.
Summary
| Members | Descriptions |
|---|---|
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. |
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.
struct FRH_WebRequest
Web call request data.
Summary
| Members | Descriptions |
|---|---|
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. |
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.