Google云端存储:我使用了多少总空间?

spe*_*ane 7 dashboard google-cloud-storage google-cloud-console google-cloud-platform

我正在使用Google云端存储.我在哪里可以确定我使用的总空间?我似乎无法在仪表板中找到它告诉您的总使用量,以兆字节或千兆字节为单位.

仪表板的屏幕截图

小智 8

gsutil安装了命令行实用程序吗?如果是这样,您可以使用该gsutil du命令查看对象和存储桶已使用的空间。

例如,gsutil du -s gs://my-bucket-name/应该有效。

https://cloud.google.com/storage/docs/gsutil/commands/du

  • 哎呀...没有办法在仪表板上看到它吗?如果非程序员能够看到我们使用了多少空间,那就太好了。 (6认同)

Che*_*ana 8

正如du - 显示对象大小使用情况中所述,我们可以使用gsutil命令

gsutil -o GSUtil:default_project_id=[PROJECT-ID] du -shc
Run Code Online (Sandbox Code Playgroud)

它将显示每个存储桶的所有空间以及已使用的总空间,如下所示

24.18 MiB    gs://appspot.[PROJECT-ID].com
687.46 MiB   gs://artifacts.[PROJECT-ID].appspot.com
947 B        gs://[PROJECT-ID]_cloudbuild
252.55 MiB   gs://staging.[PROJECT-ID].appspot.com
9.36 GiB     gs://us.artifacts.[PROJECT-ID].appspot.com
10.3 GiB     total
Run Code Online (Sandbox Code Playgroud)

请注意,如果您收到"ImportError: No module named google_compute_engine"请参阅此问题export BOTO_CONFIG=/dev/null可以通过运行前运行来解决gsutil


sab*_*ujp 5

您现在可以通过 Stackdriver Metrics Explorer 获得所需的内容,转至 Stackdriver -> Resources -> Metrics Explorer -> 在 Find resource type and metric entry 字段下选择“Total bytes”或输入“storage.googleapis.com/storage/total_bytes”然后点击出现的那个。然后它会显示您项目中所有存储桶的使用情况。