Hi Tariq
How exactly is the raw_usage is caluculated
For example "
How we are getting the value :raw_usage: 1.35944437980652
mysql> select * from cloud_usage.usage_event where account_id=9 and type
like "%VM%" and resource_id=1744 ;
+-------+------------+------------+---------------------+---------+-------------+--------------------+-------------+-------------+------+---------------+-----------+--------------+
| id | type | account_id | created | zone_id |
resource_id | resource_name | offering_id | template_id | size |
resource_type | processed | virtual_size |
+-------+------------+------------+---------------------+---------+-------------+--------------------+-------------+-------------+------+---------------+-----------+--------------+
| 13090 | VM.CREATE | 9 | 2014-10-10 13:33:32 | 1 |
1744 | v1k-1010-2230-0254 | 14 | 222 | NULL | VMware
| 1 | NULL |
| 14182 | VM.START | 9 | 2014-10-10 13:38:26 | 1 |
1744 | v1k-1010-2230-0254 | 14 | 222 | NULL | VMware
| 1 | NULL |
| 14188 | VM.DESTROY | 9 | 2014-10-10 13:38:28 | 1 |
1744 | v1k-1010-2230-0254 | 14 | 222 | NULL | VMware
| 1 | NULL |
+-------+------------+------------+---------------------+---------+-------------+--------------------+-------------+-------------+------+---------------+-----------+--------------+
3 rows in set (0.03 sec)
mysql> select * from cloud_usage.cloud_usage where account_id=9 and
vm_instance_id=1744 and usage_type in (1,2) limit 2 \G;
*************************** 1. row ***************************
id: 6051
zone_id: 1
account_id: 9
domain_id: 5
description: v1k-1010-2230-0254 running time (ServiceOffering: 14)
(Template: 222)
usage_display: 1.359444 Hrs
usage_type: 1
raw_usage: 1.35944437980652
vm_instance_id: 1744
vm_name: v1k-1010-2230-0254
offering_id: 14
template_id: 222
usage_id: 1744
type: VMware
size: NULL
network_id: NULL
start_date: 2014-10-09 15:00:00
end_date: 2014-10-10 14:59:59
virtual_size: NULL
*************************** 2. row ***************************
id: 7478
zone_id: 1
account_id: 9
domain_id: 5
description: v1k-1010-2230-0254 allocated (ServiceOffering: 14)
(Template: 222)
usage_display: 0.082222 Hrs
usage_type: 2
raw_usage: 0.0822224989533424
vm_instance_id: 1744
vm_name: v1k-1010-2230-0254
offering_id: 14
template_id: 222
usage_id: 1744
type: VMware
size: NULL
network_id: NULL
start_date: 2014-10-09 15:00:00
end_date: 2014-10-10 14:59:59
virtual_size: NULL
2 rows in set (0.01 sec)
Regards
Kiran
On Wed, Apr 30, 2014 at 2:07 PM, Tariq Iqbal <[email protected]>
wrote:
> Hi Yesid,
>
> Yes, you can by accountid (=ID value for an account in the UI) and
> account(=account name in the UI). Here some examples for Traffic Sent by
> account:
>
> AccountID:
> http://
> <CS_HOST_IP>:8096/client/api?command=listUsageRecords&startdate=2014-01-01&enddate=2014-04-25&type=4&accountid=337cd764-6ee9-47c8-90fa-1deeccb920d8
>
> Account:
> http://
> <CS_HOST_IP>:8096/client/api?command=listUsageRecords&startdate=2014-01-01&enddate=2014-04-25&type=4&account=batman
>
> Best Regards,
>
> Tariq Iqbal
>
> S: +44 20 3603 0540 | M: +447909911600
>
> [email protected] | Twitter: @TariqIqbal_
>
> -----Original Message-----
> From: Yesid Mora [mailto:[email protected]]
> Sent: 29 April 2014 16:05
> To: [email protected]
> Subject: RE: How Verify Usage Bandwidth
>
> Hello Tariq, thanks for your comments, is possible for API have the
> information Bandwidth for account specific?
>
> Thanks,
>
>
>
>
> -----Mensaje original-----
> De: Tariq Iqbal [mailto:[email protected]]
> Enviado el: viernes, 25 de abril de 2014 11:18 a. m.
> Para: [email protected]
> Asunto: RE: How Verify Usage Bandwidth
>
> Hi Yesid,
>
> The only place where you can find Network Traffic Sent in the UI is for
> each VM, by looking at the Network Write value under the 'Instances><VM
> Name>Statistics' tab. You will need to total up all these values to get the
> overall figure.
>
> Alternatively you can use the listUsageRecords API to fetch all the
> Network Bytes Sent usage type records for a specific date range. This will
> provide an XML response and the <rawusage> tag will give you the bytes
> sent. Add these up to get the overall total bytes sent. For example:
>
> An unauthenticated API request:
>
> http://
> <CS_HOST_IP>:8096/client/api?command=listUsageRecords&startdate=2014-01-01&enddate=2014-04-25&type=4
>
> Response:
> <listusagerecordsresponse cloud-stack-version="4.2.1"> <count>2</count>
> <usagerecord> <account>xyz1</account>
> <accountid>337cd764-6ee9-47c8-90fa-1deeccb920d8</accountid>
> <domainid>867b1e4f-de8d-478b-9fb5-450ed3a3babd</domainid>
> <zoneid>4f54138b-cac2-400f-8269-faded18d2b0d</zoneid>
> <description>network bytes sent for Host: 14</description>
> <usage>15488 bytes sent</usage>
> <usagetype>4</usagetype>
> <rawusage>15488</rawusage>
> <usageid>a9904989-4991-4bbd-a754-5b4f797bf18e</usageid>
> <type>DomainRouter</type>
> <startdate>2014-04-24'T'00:00:00+00:00</startdate>
> <enddate>2014-04-24'T'23:59:59+00:00</enddate>
> <networkid>f9b713c5-a7db-4517-b5f6-5f1c0c874866</networkid>
> </usagerecord>
> <usagerecord>
> <account>xyz2</account>
> <accountid>337cd764-6ee9-47c8-90fa-1deeccb920d8</accountid>
> <domainid>867b1e4f-de8d-478b-9fb5-450ed3a3babd</domainid>
> <zoneid>4f54138b-cac2-400f-8269-faded18d2b0d</zoneid>
> <description>network bytes sent for Host: 11</description>
> <usage>33428 bytes sent</usage>
> <usagetype>4</usagetype>
> <rawusage>33428</rawusage>
> <usageid>6de5e260-3430-44ee-9bee-c13494e40ab3</usageid>
> <type>DomainRouter</type>
> <startdate>2014-04-24'T'00:00:00+00:00</startdate>
> <enddate>2014-04-24'T'23:59:59+00:00</enddate>
> <networkid>0aa0664b-15c7-4cc0-be5e-5803220d7c18</networkid>
> </usagerecord>
> </listusagerecordsresponse>
>
> Hope that helps
>
> Best Regards,
>
> Tariq Iqbal
>
> S: +44 20 3603 0540 | M: +447909911600
>
> [email protected] | Twitter: @TariqIqbal_
>
> -----Original Message-----
> From: Yesid Mora [mailto:[email protected]]
> Sent: 24 April 2014 21:59
> To: [email protected]
> Subject: How Verify Usage Bandwidth
>
> Hi all,
>
> I have understood that measures traffic CloudStack output, but my problem
> is that I find or I see this information is possible verify this
> information for UI?? Or is necessary use the API? The version is 3.0.7
>
> Thanks,
>
>
> Yesid Mora
>
>
>
>
> Email asegurado por Check Point
>
> Need Enterprise Grade Support for Apache CloudStack?
> Our CloudStack Infrastructure Support<
> http://shapeblue.com/cloudstack-infrastructure-support/> offers the best
> 24/7 SLA for CloudStack Environments.
>
> Apache CloudStack Bootcamp training courses
>
> **NEW!** CloudStack 4.2.1 training<
> http://shapeblue.com/cloudstack-training/>
> 28th-29th May 2014, Bangalore. Classromm<
> http://shapeblue.com/cloudstack-training/>
> 16th-20th June 2014, Region A. Instructor led, On-line<
> http://shapeblue.com/cloudstack-training/>
> 23rd-27th June 2014, Region B. Instructor led, On-line<
> http://shapeblue.com/cloudstack-training/>
> 15th-20th September 2014, Region A. Instructor led, On-line<
> http://shapeblue.com/cloudstack-training/>
> 22nd-27th September 2014, Region B. Instructor led, On-line<
> http://shapeblue.com/cloudstack-training/>
> 1st-6th December 2014, Region A. Instructor led, On-line<
> http://shapeblue.com/cloudstack-training/>
> 8th-12th December 2014, Region B. Instructor led, On-line<
> http://shapeblue.com/cloudstack-training/>
>
> This email and any attachments to it may be confidential and are intended
> solely for the use of the individual to whom it is addressed. Any views or
> opinions expressed are solely those of the author and do not necessarily
> represent those of Shape Blue Ltd or related companies. If you are not the
> intended recipient of this email, you must neither take any action based
> upon its contents, nor copy or show it to anyone. Please contact the sender
> if you believe you have received this email in error. Shape Blue Ltd is a
> company incorporated in England & Wales. ShapeBlue Services India LLP is a
> company incorporated in India and is operated under license from Shape Blue
> Ltd. Shape Blue Brasil Consultoria Ltda is a company incorporated in Brasil
> and is operated under license from Shape Blue Ltd. ShapeBlue is a
> registered trademark.
>
> Email asegurado por Check Point
>
> Email asegurado por Check Point
> This email and any attachments to it may be confidential and are intended
> solely for the use of the individual to whom it is addressed. Any views or
> opinions expressed are solely those of the author and do not necessarily
> represent those of Shape Blue Ltd or related companies. If you are not the
> intended recipient of this email, you must neither take any action based
> upon its contents, nor copy or show it to anyone. Please contact the sender
> if you believe you have received this email in error. Shape Blue Ltd is a
> company incorporated in England & Wales. ShapeBlue Services India LLP is a
> company incorporated in India and is operated under license from Shape Blue
> Ltd. Shape Blue Brasil Consultoria Ltda is a company incorporated in Brasil
> and is operated under license from Shape Blue Ltd. ShapeBlue is a
> registered trademark.
>