Skip to content

Conversation

@ateucher
Copy link
Contributor

@ateucher ateucher commented Mar 6, 2025

I got stalled on this, but I think it's time to finish where we got to and merge. This adds more user-friendly functions to get data summaries at the user level, and also for overall summaries.

@ateucher ateucher marked this pull request as ready for review October 8, 2025 23:03
@ateucher ateucher merged commit 402f2df into main Oct 8, 2025
5 checks passed
@ateucher ateucher deleted the user-level-resources branch October 8, 2025 23:25
@ateucher ateucher requested a review from Copilot October 8, 2025 23:26
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds user-level resource monitoring functions and enhances cost filtering capabilities. It provides more user-friendly functions to get data summaries at the user level and overall summaries by integrating Prometheus queries for resource usage tracking with improved AWS Cost Explorer filtering.

  • Enhanced Prometheus query handling with S3 classes and methods for better data formatting
  • Added user-level resource monitoring functions for CPU, memory, and directory usage
  • Extended cost summaries with hub and cluster filtering capabilities

Reviewed Changes

Copilot reviewed 34 out of 35 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
R/prometheus-usage-summaries.R Adds new user-level functions for directory snapshots, resource requests/usage tracking
R/prometheus.R Refactors query result formatting with S3 classes and improved time handling
R/cost-summaries.R Extends cost filtering with hub and cluster parameters plus service component mapping
R/cost-explorer.R Adds service mapping and AWS tag filtering functions
R/utils.R Adds time formatting utilities for Prometheus queries
tests/testthat/test-*.R Comprehensive test coverage for new functionality

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Default is today (\code{Sys.Date()}). If a \code{POSIXt} object, it will be converted
to UTC, if a \code{Date} or \code{character} object, it will be assumed to be \code{UTC}}

\item{by_user}{A logical value indicating whether to group by user (directory). Defau}
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

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

Documentation for the 'by_user' parameter is incomplete. The description ends abruptly with 'Defau' instead of 'Default FALSE'.

Suggested change
\item{by_user}{A logical value indicating whether to group by user (directory). Defau}
\item{by_user}{A logical value indicating whether to group by user (directory). Default is \code{FALSE}.}

Copilot uses AI. Check for mistakes.
day would be \code{"24h0m0s"}. Default is 1 hour ()}
}
\value{
A data frame of directory sizes over time, with dirctory sizes in megabytes.
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

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

Corrected spelling of 'dirctory' to 'directory'.

Suggested change
A data frame of directory sizes over time, with dirctory sizes in megabytes.
A data frame of directory sizes over time, with directory sizes in megabytes.

Copilot uses AI. Check for mistakes.

hub <- match.arg(hub)

cluster = match.arg(cluster)
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

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

Assignment operator should be '<-' instead of '=' for consistency with R style guidelines.

Suggested change
cluster = match.arg(cluster)
cluster <- match.arg(cluster)

Copilot uses AI. Check for mistakes.
)

if (hub == "support") {
filter_list = list(
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

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

Assignment operator should be '<-' instead of '=' for consistency with R style guidelines.

Copilot uses AI. Check for mistakes.
)
)
} else if (hub != "all") {
filter_list = list(
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

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

Assignment operator should be '<-' instead of '=' for consistency with R style guidelines.

Suggested change
filter_list = list(
filter_list <- list(

Copilot uses AI. Check for mistakes.
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.

2 participants