view_traffic
Creates, updates, deletes, gets or lists a view_traffic resource.
Overview
| Name | view_traffic |
| Type | Resource |
| Id | github.repos.view_traffic |
Fields
The following fields are returned by SELECT queries:
- get_views
Response
| Name | Datatype | Description |
|---|---|---|
count | integer | |
uniques | integer | |
views | array |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_views | select | owner, repo | per | Get the total number of views and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday. |
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 |
|---|---|---|
owner | string | The account owner of the repository. The name is not case sensitive. |
repo | string | The name of the repository without the .git extension. The name is not case sensitive. |
per | string | The time frame to display results for. |
SELECT examples
- get_views
Get the total number of views and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday.
SELECT
count,
uniques,
views
FROM github.repos.view_traffic
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND per = '{{ per }}'
;