Skip to content

Instantly share code, notes, and snippets.

@nturaga
Created November 21, 2022 20:07
Show Gist options
  • Save nturaga/2ea8f937801fb12873fb0111d0e2abb9 to your computer and use it in GitHub Desktop.
Save nturaga/2ea8f937801fb12873fb0111d0e2abb9 to your computer and use it in GitHub Desktop.
library(readr)
library(dplyr)
cmd <- 'gcloud compute instances list --filter="tn-pytorch" --format="table(name, status, labels.created_by.list(), labels.image.list())" > tsci_gcloud.csv'
system(cmd)
dat <- read_table('tsci_gcloud.csv')
counts <- dat |>
count(CREATED_BY) |>
arrange(desc(n))
write_csv(counts, '~/Documents/tsci_gcloud_compute_usage.csv')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment