ECS metering

ECS MeteringECS supports namespace and bucket metering in both UI and CLI. Lets discuss how to use that necessary feature.

Let’s start with GUI

  • Navigate to Monitor > Metering
  • Select your namespace
  • Select corresponding bucket
  • Click on “+” to add the bucket into the list of Selected.

ECS metering

Note: If you are a Namespace Admin, you can select your namespace only.

  • Click Apply

ECS metering

  • Metering info is generated
  • Bucket is empty now.

ECS metering-3

Lets check the same visa CLI

  • Authenticate with curl, store auth token into cookie file
# curl -kv https://10.0.0.1:4443/login?using-cookies=true -u "root:password" -c cookiefile
*   Trying 10.0.0.1...
* TCP_NODELAY set
* Connected to 10.0.0.1 (10.0.0.1) port 4443 (#0)
* TLS 1.0 connection using TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
* Server certificate: localhost
* Server auth using Basic with user 'root'
> GET /login?using-cookies=true HTTP/1.1
> Host: 10.0.0.1:4443
> Authorization: Basic cm9vdDpDaGFuZ2VNZQ==
> User-Agent: curl/7.51.0
> Accept: */*

< HTTP/1.1 200 OK
< Date: Mon, 13 Feb 2017 11:52:51 GMT
< Content-Type: application/xml
< Content-Length: 93
< Connection: keep-alive
< X-SDS-AUTH-TOKEN: BAAcRkM1dD…8=
* Added cookie X-SDS-AUTH-TOKEN="BAAcRkM1dD…8=" for domain 10.0.0.1, path /, expire 1487015571
…
root
  • CLI confirms that the bucket is empty now.
  • Specify sizeunit=KB as the parameter.
# curl -ks -b cookiefile https://10.0.0.1:4443/object/billing/buckets/ns1/ns1s3bucket1/info?sizeunit=KB |xmllint --format -
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<bucket_billing_info>
<namespace>ns1</namespace>
<name>ns1s3bucket1</name>
<sample_time>2017-02-13T11:55:45Z</sample_time>
<vpool_id>urn:storageos:ReplicationGroupInfo:e7e32a31-935a-44d0-905e-9410345d4913:global</vpool_id>
<total_size>0</total_size>
<total_size_unit>KB</total_size_unit>
<total_objects>0</total_objects>
<TagSet/>
</bucket_billing_info>
  • Lets write 3x tiny objects with Cyberduck.

ECS metering

  • Check metering of the bucket.
  • Hmm… nothing presented…
# curl -ks -b cookiefile https://10.0.0.1:4443/object/billing/buckets/ns1/ns1s3bucket1/info?sizeunit=KB |xmllint --format - |grep total
<total_size>0</total_size>
<total_size_unit>KB</total_size_unit>
<total_objects>0</total_objects>

The reason is – aggregated metering data is collected every 5 minutes. So we should to wait a little bit.

  • Metering data updated after 5 minutes
  • If a bucket capacity is less than 1Gb it will be shown 0GB.
# curl -ks -b cookiefile https://10.0.0.1:4443/object/billing/buckets/ns1/ns1s3bucket1/info?sizeunit=KB |xmllint --format - |grep total
<total_size>0</total_size>
<total_size_unit>KB</total_size_unit>
<total_objects>3</total_objects>

 

  • Write a heavy object

ECS metering-5

  • Now we have 4x object.
  • The total consumed capacity is 2GB.
# curl -ks -b cookiefile https://10.0.0.1:4443/object/billing/buckets/ns1/ns1s3bucket1/info?sizeunit=KB |xmllint --format - |grep total
<total_size>1951648</total_size>
<total_size_unit>KB</total_size_unit>
<total_objects>4</total_objects>
  • BTW, we can check the specific period of time using start_time and end_time parameters in the request URL.
# curl -ks -b cookiefile https://10.0.0.1:4443/object/billing/buckets/ns1/ns1s3bucket1/info?start_time=2017-02-14T14:00&end_time=2017-02-14T16:00 
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<bucket_billing_info>
<namespace>ns1</namespace>
<name>ns1s3bucket1</name>
<sample_time>2017-02-13T16:30:41Z</sample_time>
<vpool_id>urn:storageos:ReplicationGroupInfo:e7e32a31-935a-44d0-905e-9410345d4913:global</vpool_id>
<total_size>2</total_size>
<total_size_unit>GB</total_size_unit>
<total_objects>4</total_objects>
<TagSet/>
</bucket_billing_info>

Note: start_time and end_time must be in UTC. The API will ignore any other time zone specified in the request.

Important! Metering data is kept for 60 days only. If you need historical perspective, please use SRM.

  • Let’s do the same via GUI Mdetering.
  • 5 minutes interval is the minimum when customizing a Time Range.

ECS meteringECS metering

Metrics used:

  • Total Size (GB) – Total size of the objects stored in the selected namespace or bucket at the end time specified in the filter.
  • Object Count – Number of objects associated with the selected namespace or bucket at the end time specified in the filter. Object count will be total of number of all existing versions.

Note: Total size and Object count are not related to the chosen time window. All the rest to the right of the window is related to the time window.

  • Objects Created – Number of objects created in the selected namespace or bucket in the time period.
  • Objects Deleted – Number of objects deleted from the selected namespace or bucket in the time period. Object overwrite increases created object and deleted object count but total object will remain same.
  • Bandwidth Ingress (MB) – Total of incoming object data (writes) for the selected namespace or bucket during the specified period.
  • Bandwidth Egress (MB) – Total of outgoing object data (reads) for the selected namespace or bucket during the specified period.

Important! It takes 5 or more days for the space allocated to deleted object to be reclaimed. However, objects are marked as deleted and that is reflected in metering and chargeback reports. As a best practice it is recommended to use metering data 4 hours after deletion.

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: