api_insights_subject_stats
Creates, updates, deletes, gets or lists an api_insights_subject_stats resource.
Overview
| Name | api_insights_subject_stats |
| Type | Resource |
| Id | github.orgs.api_insights_subject_stats |
Fields
The following fields are returned by SELECT queries:
- get_subject_stats
Response
| Name | Datatype | Description |
|---|---|---|
subject_id | integer (int64) | |
subject_name | string | |
last_rate_limited_timestamp | string | |
last_request_timestamp | string | |
rate_limited_request_count | integer | |
subject_type | string | |
total_request_count | integer |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_subject_stats | select | org, min_timestamp | max_timestamp, page, per_page, direction, sort, subject_name_substring | Get API request statistics for all subjects within an organization within a specified time frame. Subjects can be users or GitHub Apps. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
min_timestamp | string | The minimum timestamp to query for stats. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. |
org | string | The organization name. The name is not case sensitive. |
direction | string | The direction to sort the results by. |
max_timestamp | string | The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. |
page | integer | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
per_page | integer | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
sort | array | The property to sort the results by. |
subject_name_substring | string | Providing a substring will filter results where the subject name contains the substring. This is a case-insensitive search. |
SELECT examples
- get_subject_stats
Get API request statistics for all subjects within an organization within a specified time frame. Subjects can be users or GitHub Apps.
SELECT
subject_id,
subject_name,
last_rate_limited_timestamp,
last_request_timestamp,
rate_limited_request_count,
subject_type,
total_request_count
FROM github.orgs.api_insights_subject_stats
WHERE org = '{{ org }}' -- required
AND min_timestamp = '{{ min_timestamp }}' -- required
AND max_timestamp = '{{ max_timestamp }}'
AND page = '{{ page }}'
AND per_page = '{{ per_page }}'
AND direction = '{{ direction }}'
AND sort = '{{ sort }}'
AND subject_name_substring = '{{ subject_name_substring }}'
;