Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: new tk tool importers-count #1232

Merged
merged 2 commits into from
Nov 18, 2024
Merged

Conversation

julienduchesne
Copy link
Member

@julienduchesne julienduchesne commented Nov 15, 2024

This is useful to find which files are used widely and which aren't used at all Example:

julienduchesne@triceratops ksonnet % tk tool importers-count lib/meta
lib/meta/clusters.libsonnet: 523
lib/meta/certificates.libsonnet: 257
lib/meta/namespaces.libsonnet: 249
lib/meta/teams.libsonnet: 248
lib/meta/environment.libsonnet: 231
lib/meta/envs.libsonnet: 229
lib/meta/functions.libsonnet: 229
lib/meta/remote_write.libsonnet: 71
lib/meta/cells.libsonnet: 70
lib/meta/networking.libsonnet: 5
lib/meta/datasources.libsonnet: 3
lib/meta/alerting.libsonnet: 2
lib/meta/repositories.libsonnet: 1

Note: There's a ton of processing that is globally cached in that command so calling tk tool importers in a loop in a bash script is no substitute, it would be way slower

This is useful to find which files are used widely and which aren't used at all
Example:
```
julienduchesne@triceratops ksonnet % tk tool imported-count lib/meta
lib/meta/clusters.libsonnet: 523
lib/meta/certificates.libsonnet: 257
lib/meta/namespaces.libsonnet: 249
lib/meta/teams.libsonnet: 248
lib/meta/environment.libsonnet: 231
lib/meta/envs.libsonnet: 229
lib/meta/functions.libsonnet: 229
lib/meta/remote_write.libsonnet: 71
lib/meta/cells.libsonnet: 70
lib/meta/networking.libsonnet: 5
lib/meta/datasources.libsonnet: 3
lib/meta/alerting.libsonnet: 2
lib/meta/repositories.libsonnet: 1
```
@julienduchesne julienduchesne requested a review from a team as a code owner November 15, 2024 15:17
@julienduchesne julienduchesne changed the title feat: new tk tool imported-count feat: new tk tool importers-count Nov 15, 2024
Copy link
Contributor

@zerok zerok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@julienduchesne julienduchesne added this pull request to the merge queue Nov 18, 2024
Merged via the queue into main with commit 5dcb6c5 Nov 18, 2024
15 checks passed
@julienduchesne julienduchesne deleted the julienduchesne/cmd-import-count branch November 18, 2024 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants