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
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
(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
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.