create-tenant tenant=5
----

token-bucket-request tenant=5
instance_id: 1
consumption:
  ru: 10
  kvru: 8
  read_batches: 2
  read_req: 20
  read_bytes: 30
  write_batches: 3
  write_req: 40
  write_bytes: 50
  sql_pods_cpu_seconds: 60
  pgwire_egress_bytes: 70
  cross_region_network_ru: 80
  estimated_cpu_seconds: 90
----

metrics
tenant_id="5"
----
tenant_consumption_cross_region_network_ru{tenant_id="5"} 80
tenant_consumption_external_io_egress_bytes{tenant_id="5"} 0
tenant_consumption_external_io_ingress_bytes{tenant_id="5"} 0
tenant_consumption_kv_request_units{tenant_id="5"} 8
tenant_consumption_pgwire_egress_bytes{tenant_id="5"} 70
tenant_consumption_read_batches{tenant_id="5"} 2
tenant_consumption_read_bytes{tenant_id="5"} 30
tenant_consumption_read_requests{tenant_id="5"} 20
tenant_consumption_request_units{tenant_id="5"} 10
tenant_consumption_sql_pods_cpu_seconds{tenant_id="5"} 60
tenant_consumption_write_batches{tenant_id="5"} 3
tenant_consumption_write_bytes{tenant_id="5"} 50
tenant_consumption_write_requests{tenant_id="5"} 40

token-bucket-request tenant=5
instance_id: 1
consumption:
  ru: 100
  kvru: 80
  read_batches: 20
  read_req: 200
  read_bytes: 300
  write_batches: 30
  write_req: 400
  write_bytes: 500
  sql_pods_cpu_seconds: 600
  pgwire_egress_bytes: 700
  cross_region_network_ru: 800
  estimated_cpu_seconds: 900
----

token-bucket-request tenant=5
instance_id: 2
consumption:
  ru: 1000
  kvru: 800
  read_batches: 200
  read_req: 2000
  read_bytes: 3000
  write_batches: 300
  write_req: 4000
  write_bytes: 5000
  sql_pods_cpu_seconds: 6000
  pgwire_egress_bytes: 7000
  cross_region_network_ru: 8000
  estimated_cpu_seconds: 9000
----

inspect tenant=5
----
Bucket state: token-burst-limit=0  token-refill-rate=10000  token-current=0  token-current-avg=0
Consumption: ru=1110 kvru=888  reads=2220 in 222 batches (3330 bytes)  writes=4440 in 333 batches (5550 bytes)  pod-cpu-usage: 6660 secs  pgwire-egress=7770 bytes  external-egress=0 bytes  external-ingress=0 bytes  estimated-cpu: 9990 secs
Rates: write-batches=0,33.3  estimated-cpu=0,999
Last update: 00:00:00.000
First active instance: 1
  Instance 1:  lease="foo"  seq=2  next-instance=2  last-update=00:00:00.000
  Instance 2:  lease="foo"  seq=3  next-instance=0  last-update=00:00:00.000

metrics
tenant_id="5"
----
tenant_consumption_cross_region_network_ru{tenant_id="5"} 8880
tenant_consumption_external_io_egress_bytes{tenant_id="5"} 0
tenant_consumption_external_io_ingress_bytes{tenant_id="5"} 0
tenant_consumption_kv_request_units{tenant_id="5"} 888
tenant_consumption_pgwire_egress_bytes{tenant_id="5"} 7770
tenant_consumption_read_batches{tenant_id="5"} 222
tenant_consumption_read_bytes{tenant_id="5"} 3330
tenant_consumption_read_requests{tenant_id="5"} 2220
tenant_consumption_request_units{tenant_id="5"} 1110
tenant_consumption_sql_pods_cpu_seconds{tenant_id="5"} 6660
tenant_consumption_write_batches{tenant_id="5"} 333
tenant_consumption_write_bytes{tenant_id="5"} 5550
tenant_consumption_write_requests{tenant_id="5"} 4440
