You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/metrics/README.md
+60-3Lines changed: 60 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,9 +11,66 @@ CLI tools to fetch data from the Kusto API.
11
11
1. Enter your `<username>@githubazure.com` credentials.
12
12
* These will get cached for future logins.
13
13
1. At the prompt in Terminal asking which subscription you want to use, just press Enter to choose the default.
14
-
1. Open or create an `.env` file in the root directory of your checkout (this file is already in `.gitignore`).
15
-
1. Add the `KUSTO_CLUSTER` and `KUSTO_DATABASE` values to the `.env`.
14
+
1. Open or create an `.env` file in the root directory of your checkout (this file is already in `.gitignore` so it won't be tracked by Git).
15
+
1. Add the `KUSTO_CLUSTER` and `KUSTO_DATABASE` values to the `.env` (_these values are pinned in slack_):
16
16
```
17
17
KUSTO_CLUSTER='<value>'
18
18
KUSTO_DATABASE='<value>'
19
-
```
19
+
```
20
+
21
+
## docstat usage
22
+
23
+
Run `npm run docstat -- <URL>` on any GitHub Docs URL to gather a set of default metrics about it, including 30d views, users, view duration, bounces, helpfulness score, and exits to support.
24
+
25
+
Notes:
26
+
* If the URL doesn't include a version, `docstat` will return data that includes **all versions** (so FPT, Cloud, Server, etc.).
27
+
* If you want data for FPT only, pass the `--fptOnly` option.
28
+
* `docstat` only accepts URLs with an `en` language code or no language code, and it only fetches English data.
29
+
30
+
To see all the options:
31
+
```
32
+
npm run docstat -- --help
33
+
```
34
+
You can combine options like this:
35
+
```
36
+
npm run docstat -- https://docs.github.com/copilot/tutorials/modernize-legacy-code --compare --range 60
37
+
```
38
+
Use `--redirects` to include `redirect_from` frontmatter paths in the queries (this is helpful if the article may have moved recently):
39
+
```
40
+
npm run docstat -- https://docs.github.com/copilot/tutorials/modernize-legacy-code --redirects
41
+
```
42
+
Use the `--json` (or `-j`) option to output JSON:
43
+
```
44
+
npm run docstat -- https://docs.github.com/copilot/tutorials/modernize-legacy-code --json
45
+
```
46
+
If you want to pass the results of the JSON to `jq`, you need to use `silent` mode:
47
+
```
48
+
npm run --silent docstat -- https://docs.github.com/copilot/tutorials/modernize-legacy-code --json | jq .data.users
49
+
```
50
+
51
+
## docsaudit usage
52
+
53
+
Run `npm run docsaudit` on a top-level content directory to gather data about its files—including title, path, versions, 30d views, and 30d users—and output it to a CSV file.
54
+
55
+
To see all the options:
56
+
```
57
+
npm run docsaudit -- --help
58
+
```
59
+
Run the script on any top-level content directory:
60
+
```
61
+
npm run docsaudit -- <contentdirectoryname>
62
+
```
63
+
For example:
64
+
```
65
+
npm run docsaudit -- actions
66
+
```
67
+
68
+
## Future development
69
+
70
+
Applies to all scripts:
71
+
72
+
* The date range option only accepts a start date (via `-r <number>`, where the number means "`<number>` days ago"). The end date will always be the current date.
73
+
* In the future, we can add an option to set a custom end date.
74
+
75
+
* The only Kusto queries available are hardcoded in the `kusto/queries` directory.
76
+
* In the future, we can hardcode more queries, add the ability to send custom queries, or perhaps create pre-defined sets of queries.
0 commit comments