Skip to content

Feature/Http-Routes - #5

Merged
MathusanP merged 18 commits into
masterfrom
feature/metrics-endpoint
Sep 20, 2026
Merged

MathusanP merged 18 commits into
masterfrom
feature/metrics-endpoint

Conversation

@MathusanP

@MathusanP MathusanP commented Aug 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

This merge request introduces the HTTP handlers and their endpoints the metric information made in #1

Routes

  • /system/cpu
  • /system/disk
  • /system/graphics
  • /system/uptime
  • /network/throughput
  • /network/port/[portnumber]

Closes #2

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 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) and NetworkMetrics (throughput/ports) plus shared metric record types in Pryde.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.

@MathusanP MathusanP changed the title Feature/metrics endpoint Feature/Http-Routes Aug 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 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

  • LibreHardwareMonitorLib is 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

Comment thread src/Pryde.Api/Handlers.fs
Comment thread src/Pryde.Api/Handlers.fs Outdated
Comment thread src/Pryde.Api/Routes.fs
@MathusanP
MathusanP merged commit cdf7eae into master Sep 20, 2026
2 checks passed
@MathusanP
MathusanP deleted the feature/metrics-endpoint branch September 20, 2026 09:13
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.

Create API endpoints

2 participants