Resource Tuner
|
#include <ClientDataManager.h>
Public Member Functions | |
int8_t | clientExists (int32_t clientPID, int32_t clientTID) |
Checks if the client with the given ID exists in the Client Data Table. | |
int8_t | createNewClient (int32_t clientPID, int32_t clientTID) |
Create a new entry for the client with the given PID in the ClientData Table. | |
std::unordered_set< int64_t > * | getRequestsByClientID (int32_t clientTID) |
Returns a list of active requests for the client with the given PID. | |
void | insertRequestByClientId (int32_t clientTID, int64_t requestHandle) |
This method is called by the RequestMap to insert a new Request (represented by it's handle) for the client with the given ID in the Client Data Table. | |
void | deleteRequestByClientId (int32_t clientTID, int64_t requestHandle) |
This method is called by the RequestMap to delete a Request (represented by it's handle) for the client with the given ID in the Client Data Table. | |
double | getHealthByClientID (int32_t clientTID) |
This method is called by the RateLimiter to fetch the current health for a given client in the Client Data Table. | |
int64_t | getLastRequestTimestampByClientID (int32_t clientTID) |
This method is called by the RateLimiter to fetch the Last Request Timestamp for a given client in the Client Data Table. | |
void | updateHealthByClientID (int32_t clientTID, double health) |
This method is called by the RateLimiter to update the current health for a given client in the Client Data Table. | |
void | updateLastRequestTimestampByClientID (int32_t clientTID, int64_t currentMillis) |
This method is called by the RateLimiter to update the Last Request Timestamp for a given client in the Client Data Table. | |
int8_t | getClientLevelByClientID (int32_t clientPID) |
This method is called by the Verifier to fetch the Permission Level for a given client in the Client Data Table, i.e. whether the client has SYSTEM (Root) or THIRD_PARTY (User) permissions. | |
std::vector< int32_t > * | getThreadsByClientId (int32_t clientPID) |
Returns the list of threads corresponding to the thread with the given ID. | |
void | getActiveClientList (std::vector< int32_t > &clientList) |
This method is called by the PulseMonitor to fetch the list of all active clients. | |
void | deleteClientPID (int32_t clientPID) |
Delete a client PID Entry from the Client Table. | |
void | deleteClientTID (int32_t clientTID) |
Delete a client TID Entry from the Client TID Data Table. | |
Stores and Maintains Client Tracking Data for all the Active Clients (i.e. clients with outstanding Requests). The Data Tracked for each Client includes:
Definition at line 44 of file ClientDataManager.h.
int8_t ClientDataManager::clientExists | ( | int32_t | clientPID, |
int32_t | clientTID | ||
) |
Checks if the client with the given ID exists in the Client Data Table.
clientPID | PID of the client |
clientTID | TID of the client |
int8_t ClientDataManager::createNewClient | ( | int32_t | clientPID, |
int32_t | clientTID | ||
) |
Create a new entry for the client with the given PID in the ClientData Table.
This method should only be called if the clientExists method returns 0.
clientPID | PID of the client |
clientTID | TID of the client |
void ClientDataManager::deleteClientPID | ( | int32_t | clientPID | ) |
Delete a client PID Entry from the Client Table.
clientPID | Process ID of the client |
void ClientDataManager::deleteClientTID | ( | int32_t | clientTID | ) |
Delete a client TID Entry from the Client TID Data Table.
clientTID | TID of the client |
void ClientDataManager::deleteRequestByClientId | ( | int32_t | clientTID, |
int64_t | requestHandle | ||
) |
void ClientDataManager::getActiveClientList | ( | std::vector< int32_t > & | clientList | ) |
This method is called by the PulseMonitor to fetch the list of all active clients.
clientList | An IN/OUT parameter to store the list of active clients. |
int8_t ClientDataManager::getClientLevelByClientID | ( | int32_t | clientPID | ) |
This method is called by the Verifier to fetch the Permission Level for a given client in the Client Data Table, i.e. whether the client has SYSTEM (Root) or THIRD_PARTY (User) permissions.
clientPID | Process ID of the client |
double ClientDataManager::getHealthByClientID | ( | int32_t | clientTID | ) |
This method is called by the RateLimiter to fetch the current health for a given client in the Client Data Table.
clientPID | Process ID of the client |
int64_t ClientDataManager::getLastRequestTimestampByClientID | ( | int32_t | clientTID | ) |
This method is called by the RateLimiter to fetch the Last Request Timestamp for a given client in the Client Data Table.
clientTID | TID of the client |
std::unordered_set< int64_t > * ClientDataManager::getRequestsByClientID | ( | int32_t | clientTID | ) |
Returns a list of active requests for the client with the given PID.
clientTID | Process TID of the client |
std::vector< int32_t > * ClientDataManager::getThreadsByClientId | ( | int32_t | clientPID | ) |
Returns the list of threads corresponding to the thread with the given ID.
clientPID | Process ID of the client |
void ClientDataManager::insertRequestByClientId | ( | int32_t | clientTID, |
int64_t | requestHandle | ||
) |
void ClientDataManager::updateHealthByClientID | ( | int32_t | clientTID, |
double | health | ||
) |
This method is called by the RateLimiter to update the current health for a given client in the Client Data Table.
clientTID | TID of the client |
health | Update value of the Health for the client |
void ClientDataManager::updateLastRequestTimestampByClientID | ( | int32_t | clientTID, |
int64_t | currentMillis | ||
) |
This method is called by the RateLimiter to update the Last Request Timestamp for a given client in the Client Data Table.
clientTID | TID of the client |
currentMillis | New value for the Last Request Timestamp for the client |