{"id":19272230,"url":"https://github.com/backstage/catman","last_synced_at":"2025-04-21T22:31:07.165Z","repository":{"id":45354670,"uuid":"372780547","full_name":"backstage/catman","owner":"backstage","description":"Service catalog load testing service","archived":false,"fork":false,"pushed_at":"2023-03-07T01:25:54.000Z","size":14,"stargazers_count":5,"open_issues_count":1,"forks_count":2,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-01T16:12:18.992Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/backstage.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-01T09:51:50.000Z","updated_at":"2023-12-21T07:01:13.000Z","dependencies_parsed_at":"2024-06-19T15:01:26.300Z","dependency_job_id":null,"html_url":"https://github.com/backstage/catman","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"7fa2494509babc3bf2ae9ebade06dd9198999d61"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backstage%2Fcatman","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backstage%2Fcatman/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backstage%2Fcatman/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backstage%2Fcatman/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/backstage","download_url":"https://codeload.github.com/backstage/catman/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250143810,"owners_count":21382091,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T20:35:55.758Z","updated_at":"2025-04-21T22:31:06.919Z","avatar_url":"https://github.com/backstage.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Backstage Software Catalog Performance testing service\n\nThis service sole purpose is to answer the catalog with `catalog-info.yaml` files and locations.\n\n`curl http://localhost:9191/foo/bar1337/blob/master/catalog-info.yaml` responds with an entity that has the same path as the \"repo\" in the url.\nThe description is the current timestamp so that it later can be used in the catalog to detect if and how quickly new changes are picked up.\n\n```yaml\napiVersion: backstage.io/v1alpha1\nkind: Component\nmetadata:\n  description: \"2021-05-26T13:43:50+02:00\"\n  name: bar1337\nspec:\n  lifecycle: experimental\n  owner: wAcbaAolwo\n  type: website\n```\n\n`curl http://localhost:9191/locations/42/catalog-info.yaml` produces 42 locations.\n\n### Adding 1000 locations to the catalog\n\nAdding a whole lot of entities can either be done by adding each location manually using bash.\n\n```bash\nfor i in {1..1000}; do curl -X POST -H 'Content-Type: application/json' localhost:7000/api/catalog/locations -d '{\"type\": \"url\", \"target\": \"http://localhost:9191/foo/'bar$i'/blob/master/catalog-info.yaml\"}'; done\n```\n\nOr by adding a location that references to 1000 other locations.\n\n```bash\ncurl -X POST -H 'Content-Type: application/json' localhost:7000/api/catalog/locations -d '{\"type\": \"url\", \"target\": \"http://localhost:9191/locations/1000/catalog-info.yaml\"}'\n```\n\n### Running/Building/Deploying\n\n```bash\n# requirements\nbrew install golang\n# run locally\ngo run cmd/catman/main.go\n# build for current architecture.\ngo build ./cmd/catman\n# build for linux\nGOOS=linux go build ./cmd/catman\n\n# running on a specific port\n./catman -port 9191\n# setting base url, needed if this is suppose to be deployed on something else than localhost\n# to produce valid urls for generated locations\n./catman -baseurl http://mydomain.example.com\n```\n\n### Hand crafted code to benchmark individual methods in the catalog\n\nSee `utils.ts` for producing lightweight metrics.\n\n```javascript\nconst timer = createTimer(\"some work\");\nawait work();\ntimer.end();\n```\n\n### Permit catalog to read entities from catman\n\nThe catalog does not permit reading from unknown locations so the hostname of catman needs to be appended to the allow list.\n\n```yaml\nbackend:\n  # ... other config...\n  reading:\n    allow:\n      - host: example.com\n      - host: \"*.mozilla.org\"\n      - host: localhost:9191\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbackstage%2Fcatman","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbackstage%2Fcatman","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbackstage%2Fcatman/lists"}