Usage
trackUsage(endpoint, actor, n=1)
¶
Tracks the usage of an endpoint by an actor.
This function increments the usage count for a given endpoint by an actor. It also handles initialization if the count does not exist.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
endpoint
|
str
|
The endpoint being accessed. |
required |
actor
|
str
|
The actor accessing the endpoint. |
required |
n
|
int
|
The number of times the endpoint was accessed. Defaults to 1. |
1
|
Returns:
Name | Type | Description |
---|---|---|
None |
This function does not return anything but updates the memcache client. |
Source code in inference/core/usage.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
|