api_insights_time_stats
Creates, updates, deletes, gets or lists an api_insights_time_stats resource.
Overview
| Name | api_insights_time_stats |
| Type | Resource |
| Id | github.orgs.api_insights_time_stats |
Fields
The following fields are returned by SELECT queries:
- get_time_stats_by_actor
- get_time_stats_by_user
- get_time_stats
Response
| Name | Datatype | Description |
|---|---|---|
rate_limited_request_count | integer (int64) | |
timestamp | string | |
total_request_count | integer (int64) |
Response
| Name | Datatype | Description |
|---|---|---|
rate_limited_request_count | integer (int64) | |
timestamp | string | |
total_request_count | integer (int64) |
Response
| Name | Datatype | Description |
|---|---|---|
rate_limited_request_count | integer (int64) | |
timestamp | string | |
total_request_count | integer (int64) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_time_stats_by_actor | select | org, actor_type, actor_id, min_timestamp, timestamp_increment | max_timestamp | Get the number of API requests and rate-limited requests made within an organization by a specific actor within a specified time period. |
get_time_stats_by_user | select | org, user_id, min_timestamp, timestamp_increment | max_timestamp | Get the number of API requests and rate-limited requests made within an organization by a specific user over a specified time period. |
get_time_stats | select | org, min_timestamp, timestamp_increment | max_timestamp | Get the number of API requests and rate-limited requests made within an organization over a specified time period. |
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 |
|---|---|---|
actor_id | integer | The ID of the actor |
actor_type | string | The type of the actor |
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. |
timestamp_increment | string | The increment of time used to breakdown the query results (5m, 10m, 1h, etc.) |
user_id | string | The ID of the user to query for stats |
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. |
SELECT examples
- get_time_stats_by_actor
- get_time_stats_by_user
- get_time_stats
Get the number of API requests and rate-limited requests made within an organization by a specific actor within a specified time period.
SELECT
rate_limited_request_count,
timestamp,
total_request_count
FROM github.orgs.api_insights_time_stats
WHERE org = '{{ org }}' -- required
AND actor_type = '{{ actor_type }}' -- required
AND actor_id = '{{ actor_id }}' -- required
AND min_timestamp = '{{ min_timestamp }}' -- required
AND timestamp_increment = '{{ timestamp_increment }}' -- required
AND max_timestamp = '{{ max_timestamp }}'
;
Get the number of API requests and rate-limited requests made within an organization by a specific user over a specified time period.
SELECT
rate_limited_request_count,
timestamp,
total_request_count
FROM github.orgs.api_insights_time_stats
WHERE org = '{{ org }}' -- required
AND user_id = '{{ user_id }}' -- required
AND min_timestamp = '{{ min_timestamp }}' -- required
AND timestamp_increment = '{{ timestamp_increment }}' -- required
AND max_timestamp = '{{ max_timestamp }}'
;
Get the number of API requests and rate-limited requests made within an organization over a specified time period.
SELECT
rate_limited_request_count,
timestamp,
total_request_count
FROM github.orgs.api_insights_time_stats
WHERE org = '{{ org }}' -- required
AND min_timestamp = '{{ min_timestamp }}' -- required
AND timestamp_increment = '{{ timestamp_increment }}' -- required
AND max_timestamp = '{{ max_timestamp }}'
;