karmel_jd6
karmel_jd6

Reputation: 31

how to get the storage utilization of a table in BigTable

I am trying to distribute the tables I have in my BigTable instance on balanced sets. For that I need to get the table size of each one of the tables that I need to balance (according to storage utilization)

I am using the "@google-cloud/bigtable": "^0.10.2" along with nodejs version v9.11.2. I have managed to successfully get the array of all table objects from instance using const [tables] = await instance.getTables(); however when I loop over tables I could not find the size or storage utilization of any of its elements

Upvotes: 1

Views: 548

Answers (1)

Ramesh Dharan
Ramesh Dharan

Reputation: 895

You can use the Stackdriver Monitoring API via the Node.jS client library to retrieve the bigtable.googleapis.com/table/bytes_used metric. This metric is sampled every 60 seconds and there's an approximately 2 minute reporting delay.

See https://cloud.google.com/monitoring/api/metrics_gcp#gcp-bigtable for the full list of metrics published for the Cloud Bigtable service.

Upvotes: 5

Related Questions