{"id":19149032,"url":"https://github.com/yas-siin/taskmonitoring","last_synced_at":"2026-03-05T18:04:02.139Z","repository":{"id":258765419,"uuid":"875575029","full_name":"YAS-SIIN/TaskMonitoring","owner":"YAS-SIIN","description":"Task Monitoring is a C# library designed to monitor and manage Task and ThreadPool usage in .NET applications. It provides an API to expose runtime statistics, such as the number of active threads and tasks, and detailed task execution information.","archived":false,"fork":false,"pushed_at":"2025-06-11T14:10:22.000Z","size":48,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-28T23:43:30.908Z","etag":null,"topics":["csharp","nuget-package","task","task-manager","thread"],"latest_commit_sha":null,"homepage":"","language":"C#","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/YAS-SIIN.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,"zenodo":null}},"created_at":"2024-10-20T11:00:24.000Z","updated_at":"2025-09-30T08:20:28.000Z","dependencies_parsed_at":"2024-10-20T17:35:15.253Z","dependency_job_id":"c34fe41b-4ed8-4550-82c2-ec197adea69d","html_url":"https://github.com/YAS-SIIN/TaskMonitoring","commit_stats":null,"previous_names":["yas-siin/taskmonitoring"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/YAS-SIIN/TaskMonitoring","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YAS-SIIN%2FTaskMonitoring","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YAS-SIIN%2FTaskMonitoring/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YAS-SIIN%2FTaskMonitoring/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YAS-SIIN%2FTaskMonitoring/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YAS-SIIN","download_url":"https://codeload.github.com/YAS-SIIN/TaskMonitoring/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YAS-SIIN%2FTaskMonitoring/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30141302,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T16:58:46.102Z","status":"ssl_error","status_checked_at":"2026-03-05T16:58:45.706Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["csharp","nuget-package","task","task-manager","thread"],"created_at":"2024-11-09T08:06:07.463Z","updated_at":"2026-03-05T18:04:02.115Z","avatar_url":"https://github.com/YAS-SIIN.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Task Monitoring Library\n\n## Overview\n\n**Task Monitoring** is a C# library designed to monitor and manage `Task` and `ThreadPool` usage in .NET applications. It provides an API to expose runtime statistics, such as the number of active threads and tasks, and detailed task execution information.\n\nThis library is useful for debugging, performance monitoring, and gaining insights into how tasks and threads are managed in your application.\n\n## Features\n\n- Track the number of currently active `ThreadPool` threads.\n- Monitor the number of scheduled, running, and completed tasks.\n- Expose detailed information about tasks, including their status, start time, and duration.\n- Provides an API to access task monitoring data, which can be extended to visualize metrics in charts.\n\n## Installation\n\nYou can install this package from NuGet using the .NET CLI:\n\n```bash\ndotnet add package TaskMonitoring\n```\n\nOr, through the NuGet Package Manager in Visual Studio:\n\n- Right-click on your project in Solution Explorer.\n- Select Manage NuGet Packages.\n- Search for TaskMonitoring.\n- Click Install.\n\nNuGet Package: [TaskMonitoring](https://www.nuget.org/packages/TaskMonitoring/)\n\n## Usage\nMonitoring ThreadPool and Tasks\nTo monitor thread and task activity, you can use the ThreadTaskMonitor class, which provides methods to track task execution and thread pool status.\n\n\n### Example:\n\n```csharp\nusing TaskMonitoring;\n\nvar monitor = new ThreadTaskMonitor();\n\n// Get the current number of active ThreadPool threads\nvar activeThreads = monitor.GetActiveThreadCount();\nConsole.WriteLine($\"Active ThreadPool Threads: {activeThreads}\");\n\n// Track a task and get detailed task info\nvar task = Task.Run(() =\u003e {\n    Thread.Sleep(1000); // Simulate some work\n});\n\nmonitor.TrackTask(task);\n\n// Get task details\nvar taskDetails = monitor.GetTaskDetails();\nforeach (var taskInfo in taskDetails)\n{\n    Console.WriteLine($\"Task ID: {taskInfo.TaskId}, Status: {taskInfo.Status}\");\n}\n```\n\n## Custom Task Scheduler\nThe library includes a custom TaskScheduler called MonitoringTaskScheduler that tracks tasks as they are scheduled and executed.\n\n### Example:\n\n```csharp\nvar monitoringScheduler = new MonitoringTaskScheduler();\nvar taskFactory = new TaskFactory(monitoringScheduler);\n\n// Start a task using the custom task scheduler\ntaskFactory.StartNew(() =\u003e {\n    Thread.Sleep(1000); // Simulate task work\n});\n\ntaskFactory.StartNew(() =\u003e {\n    Thread.Sleep(500); // Another task\n});\n// Get the count of scheduled tasks\nint scheduledTaskCount = monitoringScheduler.GetScheduledTaskCount();\nConsole.WriteLine($\"Currently scheduled tasks: {scheduledTaskCount}\");\n```\n\n## Contributing\nContributions are welcome! If you would like to contribute, please follow these steps:\n\nFork the repository.\n- Create a new feature branch (git checkout -b feature/your-feature-name).\n- Commit your changes (git commit -m 'Add some feature').\n- Push to the branch (git push origin feature/your-feature-name).\n- Create a pull request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyas-siin%2Ftaskmonitoring","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyas-siin%2Ftaskmonitoring","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyas-siin%2Ftaskmonitoring/lists"}