Repository navigation
Feature/Http-Routes - #5
Conversation
Load, Processor Count, Name
VolumeName, driveletter, totalbyes, freebytes, filesystem
And the tests associated.
…nP/pryde into feature/metrics-endpoint
Was previously negotiated but XmlSerializer needs a type
There was a problem hiding this comment.
🔵 Needs a closer look
It introduces a likely NuGet restore failure (nonexistent package version) and a few correctness/maintainability issues that should be addressed before merging.
Pull request overview
Adds system/network metric collection in Pryde.Data and exposes it via new Giraffe HTTP endpoints in Pryde.Api, with accompanying Windows CI and xUnit tests to exercise the metrics calls.
Changes:
- Introduces
DeviceMetrics(CPU/disk/GPU/uptime) andNetworkMetrics(throughput/ports) plus shared metric record types inPryde.Core. - Adds Giraffe handlers/routes for
/system/*and/network/*endpoints. - Adds Windows GitHub Actions CI and expands the test suite to cover the new metrics functions.
File summaries
| File | Description |
|---|---|
| tests/Pryde.Tests/Tests.fs | Replaces placeholder test with metrics + networking tests. |
| src/Pryde.Polling/Scheduler.fs | Adds a new polling project source file (currently template content). |
| src/Pryde.Polling/Pryde.Polling.fsproj | Updates compile include to Scheduler.fs. |
| src/Pryde.Data/Pryde.Data.fsproj | Switches compilation to new metrics modules and adds WMI/LibreHardwareMonitor dependencies. |
| src/Pryde.Data/NetworkMetrics.fs | Implements network throughput and port listener/port info functions. |
| src/Pryde.Data/Library.fs | Removes template library module. |
| src/Pryde.Data/DeviceMetrics.fs | Implements CPU temperature/CPU info/disk info/GPU info/uptime via WMI + LibreHardwareMonitor. |
| src/Pryde.Core/Types.fs | Adds shared record types for metrics payloads. |
| src/Pryde.Core/Pryde.Core.fsproj | Switches compilation to Types.fs. |
| src/Pryde.Core/Library.fs | Removes template library module. |
| src/Pryde.Api/Routes.fs | Defines route mappings for the metrics endpoints. |
| src/Pryde.Api/Pryde.Api.fsproj | Adds handlers/routes compilation order, adds Pryde.Data reference, adds package refs. |
| src/Pryde.Api/Program.fs | Replaces minimal API “Hello World” with Giraffe pipeline using webApp. |
| src/Pryde.Api/Handlers.fs | Implements HTTP handlers returning JSON from DeviceMetrics/NetworkMetrics. |
| .github/workflows/test.yml | Adds CI workflow running restore/build/test on windows-latest. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
🟡 Changes recommended
It introduces a concrete dependency management problem (duplicate/conflicting package references) and an input-validation gap for the port route that should be addressed before merging.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (1)
src/Pryde.Api/Pryde.Api.fsproj:25
LibreHardwareMonitorLibis referenced twice, and Pryde.Data already brings it in transitively (and at a different version: 0.9.6). This can produce restore warnings/conflicts and makes dependency management harder; remove the duplicate ItemGroup and avoid directly referencing LibreHardwareMonitorLib from Pryde.Api unless the API project uses it directly.
<PackageReference Include="LibreHardwareMonitorLib" Version="0.9.7-pre714" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="LibreHardwareMonitorLib" Version="0.9.7-pre714" />
- Files reviewed: 5/5 changed files
- Comments generated: 3
- Review effort level: Lite
Summary
This merge request introduces the HTTP handlers and their endpoints the metric information made in #1
Routes
Closes #2