Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Stats Infrastructure #136

Merged
merged 8 commits into from
Jan 5, 2025
Merged

Initial Stats Infrastructure #136

merged 8 commits into from
Jan 5, 2025

Conversation

eriq-augustine
Copy link
Collaborator

  • Added some initial infrastructure for stats.
  • Added collection for system stats.
  • Added an API endpoint for querying system stats.

Sibling Python PR: edulinq/autograder-py#37

internal/db/stats_test.go Outdated Show resolved Hide resolved
internal/stats/query.go Outdated Show resolved Hide resolved
internal/stats/query.go Outdated Show resolved Hide resolved
internal/stats/system.go Outdated Show resolved Hide resolved
Copy link
Contributor

@OliverLok OliverLok left a comment

Choose a reason for hiding this comment

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

Just some small typos.

Copy link
Collaborator Author

@eriq-augustine eriq-augustine left a comment

Choose a reason for hiding this comment

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

One issue, one case of sharing code, and one missing comment.

internal/db/database.go Show resolved Hide resolved
internal/db/disk/stats.go Outdated Show resolved Hide resolved
internal/stats/system.go Show resolved Hide resolved

path := this.getSystemStatsPath()
if !util.PathExists(path) {
return make([]*stats.SystemMetrics, 0), nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not return nil, nil?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So that it outputs as [] instead of null in JSON.

Copy link
Contributor

@OliverLok OliverLok left a comment

Choose a reason for hiding this comment

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

One small thing.

@eriq-augustine eriq-augustine merged commit 8e97925 into main Jan 5, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants