{"id":13764054,"url":"https://github.com/VividCortex/pm","last_synced_at":"2025-05-10T17:31:29.266Z","repository":{"id":11908434,"uuid":"14472928","full_name":"VividCortex/pm","owner":"VividCortex","description":"Processlist manager with TCP listener","archived":false,"fork":false,"pushed_at":"2023-12-12T11:06:41.000Z","size":66,"stargazers_count":81,"open_issues_count":2,"forks_count":7,"subscribers_count":19,"default_branch":"master","last_synced_at":"2024-04-22T13:32:23.110Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VividCortex.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}},"created_at":"2013-11-17T19:17:01.000Z","updated_at":"2024-02-28T09:02:31.000Z","dependencies_parsed_at":"2024-01-07T21:54:10.749Z","dependency_job_id":"c26eb1a5-790c-4a53-8cab-3599241955b9","html_url":"https://github.com/VividCortex/pm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VividCortex%2Fpm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VividCortex%2Fpm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VividCortex%2Fpm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VividCortex%2Fpm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VividCortex","download_url":"https://codeload.github.com/VividCortex/pm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224982988,"owners_count":17402404,"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-08-03T15:01:11.234Z","updated_at":"2024-11-16T23:30:59.090Z","avatar_url":"https://github.com/VividCortex.png","language":"Go","readme":"# pm\n\n![build](https://github.com/VividCortex/pm/workflows/build/badge.svg)\n\n`pm` is a process manager with an HTTP interface. We use it at\n[VividCortex](https://vividcortex.com/) to inspect and manage API server\nprograms. It replaces an internal-only project that was similar.\n\n`pm` is in beta and will change rapidly. Please see the issues list for what's\nplanned, or to suggest changes.\n\nA Processlist is useful for inspecting and managing what's running in a\nprogram, such as an HTTP server or other server program. Processes within this\nprogram are user-defined tasks, such as HTTP requests.\n\n## Documentation\n\nPlease read the generated package documentation for both\n[server](http://godoc.org/github.com/VividCortex/pm) and\n[client](http://godoc.org/github.com/VividCortex/pm/client).\n\n## Getting Started\n\nPackage pm is a process manager with an HTTP monitoring/control interface.\n\nProcesses or tasks are user-defined routines within a running Go program. Think\nof the routines handling client requests in a web server, for instance. This\npackage is designed to keep track of them, making information available through\nan HTTP interface. Client tools connecting to the later can thus monitor active\ntasks, having access to the full status history with timing data. Also,\napplication-specific attributes may be attached to tasks (method/URI for the web\nserver case, for example), that will be integrated with status/timing\ninformation.\n\n\nUsing `pm` starts by opening a server port to handle requests for task information\nthrough HTTP. That goes like this (although you probably want to add error\nchecking/handling code):\n\n```go\ngo pm.ListenAndServe(\":8081\")\n```\n\nProcesses to be tracked must call `Start()` with a process identifier and,\noptionally, a set of attributes. Even though the id is arbitrary, it's up to the\napplication to choose one not in use by any other running task. A deferred call\nto `Done()` with the same id should follow:\n\n```go\npm.Start(requestID, nil, map[string]interface{}{\n\t\"host\":   req.RemoteAddr,\n\t\"method\": req.Method,\n\t\"uri\":    req.RequestURI,\n})\ndefer pm.Done(requestID)\n```\n\nFinally, each task can change its status as often as required with a `Status()`\ncall. Status strings are completely arbitrary and never inspected by the\npackage. Now you're all set to try something like this:\n\n```\ncurl http://localhost:8081/procs/\ncurl http://localhost:8081/procs/\u003cid\u003e/history\n```\n\nwhere `\u003cid\u003e` stands for an actual process id in your application. You'll get\nJSON responses including, respectively, the set of processes currently running\nand the full history for your chosen id.\n\nTasks can also be cancelled from the HTTP interface. In order to do that, you\nshould call the DELETE method on `/procs/\u003cid\u003e`. Given the lack of support in Go\nto cancel a running routine, cancellation requests are implemented in this\npackage as panics. Please refer to the full package documentation to learn how\nto properly deal with this. If you're **not** interested in this feature, you\ncan disable cancellation completely by running the following *before* you\n`Start()` any task:\n\n```go\npm.SetOptions(ProclistOptions{\n\tForbidCancel: true\n})\n```\n\nSee package `pm/client` for an HTTP client implementation you can readily use\nfrom Go applications.\n\n## Contributing\n\nWe only accept pull requests for minor fixes or improvements. This includes:\n\n* Small bug fixes\n* Typos\n* Documentation or comments\n\nPlease open issues to discuss new features. Pull requests for new features will be rejected,\nso we recommend forking the repository and making changes in your fork for your use case.\n\n## License\n\nCopyright (c) 2013 VividCortex, licensed under the MIT license.\nPlease see the LICENSE file for details.\n\n## Cat Picture\n\n![mechanic cat](http://heidicullinan.files.wordpress.com/2012/03/funny-cat-pictures-lolcats-mechanic-cat-is-on-the-job.jpg)\n","funding_links":[],"categories":["工具库","实用工具","Utilities","公用事业公司","工具库`可以提升效率的通用代码库和工具`","Utility","實用工具"],"sub_categories":["查询语","Advanced Console UIs","Utility/Miscellaneous","Fail injection","实用程序/Miscellaneous","HTTP Clients","交流","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e","高级控制台界面","高級控制台界面"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FVividCortex%2Fpm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FVividCortex%2Fpm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FVividCortex%2Fpm/lists"}