Title: | Provide functions to retrieve and report on usage expenses in NHGRI AnVIL (anvilproject.org). |
---|---|
Description: | AnVILBilling helps monitor AnVIL-related costs in R, using queries to a BigQuery table to which costs are exported daily. Functions are defined to help categorize tasks and associated expenditures, and to visualize and explore expense profiles over time. This package will be expanded to help users estimate costs for specific task sets. |
Authors: | BJ Stubbs [aut], Vince Carey [aut, cre] |
Maintainer: | Vince Carey <[email protected]> |
License: | Artistic-2.0 |
Version: | 1.17.0 |
Built: | 2024-10-30 03:30:05 UTC |
Source: | https://github.com/bioc/AnVILBilling |
accessor for reckoning element
ab_reckoning(x)
ab_reckoning(x)
x |
an instance of avReckoning |
a tibble with one row for each expense type by time slice
dim(ab_reckoning(demo_rec))
dim(ab_reckoning(demo_rec))
prototypical cost exploring app
browse_reck()
browse_reck()
returns "NULL"
if (interactive()) browse_reck()
if (interactive()) browse_reck()
alternate app for AnVIL where htmlwidgets misbehaves
browse_reck2()
browse_reck2()
a demonstration avReckoning object
demo_rec
demo_rec
avReckoning instance
This is a snapshot of cost data collected for a specific project.
demo_rec
demo_rec
request billing data
getBilling( startDate, endDate, bqProject, bqDataset, bqTable, bqBilling_code, page_size = 50000 )
getBilling( startDate, endDate, bqProject, bqDataset, bqTable, bqBilling_code, page_size = 50000 )
startDate |
character(1) date of start of reckoning |
endDate |
character(1) date of end of reckoning |
bqProject |
character(1) GCP project id |
bqDataset |
character(1) GCP dataset id for billing data in BQ |
bqTable |
character(1) GCP table for billing data in BQ |
bqBilling_code |
character(1) GCP billing code |
page_size |
numeric(1) passed to dbConnect |
tbl_df
On 21 August 2020 VJC changed condition on endDate to <=
if (interactive()) { getBilling(startDate="2020-08-01", endDate="2020-08-15", bqProject="bjbilling", bqTable="gcp_billing_export_v1_015E39_38569D_3CC771", bqDataset="anvilbilling", bqBilling_code="landmarkanvil2") }
if (interactive()) { getBilling(startDate="2020-08-01", endDate="2020-08-15", bqProject="bjbilling", bqTable="gcp_billing_export_v1_015E39_38569D_3CC771", bqDataset="anvilbilling", bqBilling_code="landmarkanvil2") }
return keys
getKeys(mybilling)
getKeys(mybilling)
mybilling |
tbl_df |
character()
List the available GCP product skus
getSkus(mybilling)
getSkus(mybilling)
mybilling |
tbl_df |
character()
Calcuate costs for a workflow submission by ID
getSubmissionCost(mybilling, submissionID)
getSubmissionCost(mybilling, submissionID)
mybilling |
tbl_df |
submissionID |
character(1) Terra submission ID |
numeric()
data(demo_rec) # makes rec v = getValues(demo_rec@reckoning, "terra-submission-id")[1] # for instance getSubmissionCost(demo_rec@reckoning,v)
data(demo_rec) # makes rec v = getValues(demo_rec@reckoning, "terra-submission-id")[1] # for instance getSubmissionCost(demo_rec@reckoning,v)
Calcuate ram usage for a workflow submission by ID
getSubmissionRam(mybilling, submissionID)
getSubmissionRam(mybilling, submissionID)
mybilling |
tbl_df |
submissionID |
character(1) Terra submission ID |
data.frame
data(demo_rec) # makes rec v = getValues(demo_rec@reckoning, "terra-submission-id")[1] # for instance getSubmissionRam(demo_rec@reckoning,v)
data(demo_rec) # makes rec v = getValues(demo_rec@reckoning, "terra-submission-id")[1] # for instance getSubmissionRam(demo_rec@reckoning,v)
deal with nested tables in a reckoning
getValues(mybilling, mykey)
getValues(mybilling, mykey)
mybilling |
tbl_df from reckon() |
mykey |
character(1) key |
character()
if (interactive()) getValues(reckoning(demo_rec), "security")
if (interactive()) getValues(reckoning(demo_rec), "security")
perform reckoning
reckon(obj)
reckon(obj)
obj |
instance of avReckoningRequest |
instance of avReckoning
data(demo_rec) if (interactive()) reckon(demo_rec)
data(demo_rec) if (interactive()) reckon(demo_rec)
generic for accessor for reckoning component
reckoning(x)
reckoning(x)
x |
object inheriting from avReckoning |
tbl_df
if (interactive()) reckoning(reckon(demo_rec))
if (interactive()) reckoning(reckon(demo_rec))
accessor for reckoning component
## S4 method for signature 'avReckoning' reckoning(x)
## S4 method for signature 'avReckoning' reckoning(x)
x |
instance of avReckoning |
tbl_df
if (interactive()) reckoning(reckon(demo_rec))
if (interactive()) reckoning(reckon(demo_rec))
set up request object
setup_billing_request(start, end, project, dataset, table, billing_code)
setup_billing_request(start, end, project, dataset, table, billing_code)
start |
character(1) date of start of reckoning |
end |
character(1) date of end of reckoning |
project |
character(1) GCP project id |
dataset |
character(1) GCP dataset id for billing data in BQ |
table |
character(1) GCP table for billing data in BQ |
billing_code |
character(1) GCP billing code |
instance of avReckoningRequest
lk1 = setup_billing_request("2020-08-01", "2020-08-15", "bq_scoped_project", "bq_dataset", "bq_table", "billcode") lk1
lk1 = setup_billing_request("2020-08-01", "2020-08-15", "bq_scoped_project", "bq_dataset", "bq_table", "billcode") lk1
filter a reckoning by 'label' retaining records associated with a particular key-value pair
subsetByKeyValue(mybilling, mykey, myvalue)
subsetByKeyValue(mybilling, mykey, myvalue)
mybilling |
instance of avReckoning |
mykey |
character(1) |
myvalue |
character(1) |
data.frame
example(reckon) # makes rec v = getValues(ab_reckoning(demo_rec), "terra-submission-id")[1] # for instance nt = subsetByKeyValue(ab_reckoning(demo_rec), "terra-submission-id", v) head(nt) dim(nt)
example(reckon) # makes rec v = getValues(ab_reckoning(demo_rec), "terra-submission-id")[1] # for instance nt = subsetByKeyValue(ab_reckoning(demo_rec), "terra-submission-id", v) head(nt) dim(nt)
subset a billing object by sku
subsetBySku(mybilling, mysku)
subsetBySku(mybilling, mysku)
mybilling |
tbl_df |
mysku |
character(1) GCP product sku |
data.frame