Skip to content

Commit 4be927c

Browse files
LoC and file count insights (#1205)
Docs for inventory stats code insights. - https://linear.app/sourcegraph/issue/SRCH-1914/enablement-loc-and-file-count-insights-in-65 --------- Co-authored-by: Marc <[email protected]>
1 parent 1ce50b3 commit 4be927c

File tree

2 files changed

+68
-0
lines changed

2 files changed

+68
-0
lines changed

docs/admin/updates/docker_compose.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ For upgrade procedures or general info about sourcegraph versioning see the link
1111
>
1212
> ***If the notes indicate a patch release exists, target the highest one.***
1313
14+
## v6.3 patch 1
15+
16+
- Grafana's port 3370 is no longer open by default for unauthenticated access for Docker Compose and Pure Docker deployments. Admins can still access Grafana by logging in to their Sourcegraph instance, navigating to the Site Admin page, then clicking Monitoring from the left navigation menu. If customers require port 3370 to be open, see [[PR 1204](https://github.com/sourcegraph/deploy-sourcegraph-docker/pull/1204/files)] for insight on how to add this port to their `docker-compose.override.yaml` file.
17+
1418
## v6.2.2553
1519

1620
### Known issues
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Inventory Stats
2+
3+
<p type="subtitle">Learn about your project's inventory stats type of Code Insights.</p>
4+
5+
An inventory stats code insight lets you track code inventory metrics such as file counts, lines of code, and language usage trends in your repositories. Sourcegraph Code Search Enterprise users can track these metrics across all repositories in their organization.
6+
7+
To create an inventory stats code insight:
8+
9+
- Navigate to the Code Insights tab from the Sourcegraph instance
10+
- Click on the **Create insight** button
11+
- Select **Inventory Stats** as the type of insight
12+
- Choose your list of target repositories on which you want to perform an insight
13+
- Next, pick the inventory metrics you want to track, like lines of code, file size, and file count
14+
- Finally, add a **title** and **granularity** of the insight
15+
- And click **Create code insight** once you are done
16+
17+
While configuring these fields, you can also see a live preview of the insight on the right side of the page.
18+
19+
After you have created the insight, you can view it on the **Code Insights** tab.
20+
21+
![inventory-stats](https://storage.googleapis.com/sourcegraph-assets/Docs/inventory-stats-insights-0625.png)
22+
23+
Now, you can perform all the actions you can on other Code Insights, such as editing, filtering, sharing, and deleting.
24+
25+
## Inventory environment variables
26+
27+
<Callout type="note">Inventory environment variables have been moved into site configuration. This impacts any self-hosted customer using these environment variables. Cloud customers are not impacted by this change.</Callout>
28+
29+
If you are a self-hosted Sourcegraph Enterprise user, we have moved the inventory environment variables into the **inventory** section of the **Site configuration** settings in your **Site admin** page.
30+
31+
Here's a list oI the Inventory environment variables and their new site configuration settings, with default values:
32+
33+
- `USE_ENHANCED_LANGUAGE_DETECTION` ==> `"disableEnhancedLanguageDetection"`
34+
- defaults to `false`
35+
- `GET_INVENTORY_GIT_SERVER_CONCURRENCY` ==> `"gitServerConcurrency"`
36+
- defaults to `4`
37+
- `GET_INVENTORY_REDIS_CONCURRENCY` ==> `"redisConcurrency"`
38+
- defaults to `20`
39+
- `GET_INVENTORY_MAX_INV_IN_MEMORY` ==> `"maxInventoryInMemory"`
40+
- defaults to `1000`
41+
- `GET_INVENTORY_TIMEOUT` ==> `"timeoutInMinutes"`
42+
- defaults to `5`
43+
44+
Here's an example of the site configuration section:
45+
46+
```json
47+
"inventory" : {
48+
"disableEnhancedLanguageDetection": false,
49+
"gitServerConcurrency": 4,
50+
"redisConcurrency": 20,
51+
"maxInventoryInMemory": 1000,
52+
"timeoutInMinutes": 5
53+
}
54+
```
55+
56+
<Callout type="info">To accommodate default values in your Site configuration vs. environment variables, the positive `USE_ENHANCED_LANGUAGE_DETECTION` env var has been changed to the negative `disableEnhancedLanguageDetection`.</Callout>
57+
58+
There is a new environment variable for managing `worker` resources when processing Inventory insights:
59+
60+
```json
61+
INSIGHTS_INVENTORY_BATCH_SIZE
62+
```
63+
64+
This environment variable controls the number of repositories to process in a single batch for inventory insights in the code insights worker. It affects memory usage while processing repos. Lower number is less memory used. It does not affect the speed of the process.

0 commit comments

Comments
 (0)