Return-Path: X-Original-To: apmail-cloudstack-dev-archive@www.apache.org Delivered-To: apmail-cloudstack-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 385A21154C for ; Sat, 7 Jun 2014 08:46:57 +0000 (UTC) Received: (qmail 84853 invoked by uid 500); 7 Jun 2014 08:46:56 -0000 Delivered-To: apmail-cloudstack-dev-archive@cloudstack.apache.org Received: (qmail 84808 invoked by uid 500); 7 Jun 2014 08:46:56 -0000 Mailing-List: contact dev-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list dev@cloudstack.apache.org Received: (qmail 84794 invoked by uid 99); 7 Jun 2014 08:46:56 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Jun 2014 08:46:56 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id B66781D42D2; Sat, 7 Jun 2014 08:46:47 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============2768718090149202601==" MIME-Version: 1.0 Subject: Re: Review Request 22339: CLOUDSTACK-6669: Fix support resize in usage server From: "ASF Subversion and Git Services" To: "Kishan Kavala" Cc: "ASF Subversion and Git Services" , "Olivier Lemasle" , "cloudstack" Date: Sat, 07 Jun 2014 08:46:47 -0000 Message-ID: <20140607084647.10016.82806@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org Auto-Submitted: auto-generated Sender: "ASF Subversion and Git Services" X-ReviewGroup: cloudstack X-ReviewRequest-URL: https://reviews.apache.org/r/22339/ X-Sender: "ASF Subversion and Git Services" References: <20140607082633.10016.78619@reviews.apache.org> In-Reply-To: <20140607082633.10016.78619@reviews.apache.org> Reply-To: "ASF Subversion and Git Services" X-ReviewRequest-Repository: cloudstack-git --===============2768718090149202601== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/22339/#review45005 ----------------------------------------------------------- Commit f0ea44daf12b702ab1deb03d4e6bc3adfab46efc in cloudstack's branch refs/heads/4.4-forward from Olivier Lemasle [ https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;h=f0ea44d ] CLOUDSTACK-6669: Fix support resize in usage server Signed-off-by: Sebastien Goasguen - ASF Subversion and Git Services On June 7, 2014, 8:26 a.m., Olivier Lemasle wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/22339/ > ----------------------------------------------------------- > > (Updated June 7, 2014, 8:26 a.m.) > > > Review request for cloudstack and Kishan Kavala. > > > Bugs: CLOUDSTACK-6669 > https://issues.apache.org/jira/browse/CLOUDSTACK-6669 > > > Repository: cloudstack-git > > > Description > ------- > > This patch fixes the remaining bug in the initial fix for CLOUDSTACK-6669. > See my example here: https://issues.apache.org/jira/browse/CLOUDSTACK-6669?focusedCommentId=14020334 > > > Diffs > ----- > > usage/src/com/cloud/usage/parser/VolumeUsageParser.java cd092a9 > > Diff: https://reviews.apache.org/r/22339/diff/ > > > Testing > ------- > > 1. Create a DATA volume with "Custom Disk", size 1GB > 2. Resize it to "Custom Disk", size 3GB > 3. Resize it to "Custom Disk", size 20GB > 4. Change disk offering to "Medium Disk, 20GB" > 5. Check cloud_usage database: > > mysql> select * from usage_volume where id = 9; > +----+---------+------------+-----------+------------------+-------------+-------------+---------------------+---------------------+ > | id | zone_id | account_id | domain_id | disk_offering_id | template_id | size | created | deleted | > +----+---------+------------+-----------+------------------+-------------+-------------+---------------------+---------------------+ > | 9 | 1 | 2 | 1 | 6 | NULL | 1073741824 | 2014-06-07 07:00:01 | 2014-06-07 07:02:54 | > | 9 | 1 | 2 | 1 | 6 | NULL | 3221225472 | 2014-06-07 07:02:54 | 2014-06-07 07:26:40 | > | 9 | 1 | 2 | 1 | 6 | NULL | 21474836480 | 2014-06-07 07:26:40 | 2014-06-07 07:29:49 | > | 9 | 1 | 2 | 1 | 4 | NULL | 21474836480 | 2014-06-07 07:29:49 | NULL | > +----+---------+------------+-----------+------------------+-------------+-------------+---------------------+---------------------+ > > and: > > mysql> select description, raw_usage, offering_id, size, start_date, end_date from cloud_usage where usage_id=9 and usage_type = 6; > +-------------------------------------------+--------------------+-------------+-------------+---------------------+---------------------+ > | description | raw_usage | offering_id | size | start_date | end_date | > +-------------------------------------------+--------------------+-------------+-------------+---------------------+---------------------+ > | Volume Id: 9 usage time (DiskOffering: 6) | 0.0480558350682259 | 6 | 1073741824 | 2014-06-07 06:55:00 | 2014-06-07 07:05:00 | > | Volume Id: 9 usage time (DiskOffering: 6) | 0.0350027792155743 | 6 | 3221225472 | 2014-06-07 06:55:00 | 2014-06-07 07:05:00 | > | Volume Id: 9 usage time (DiskOffering: 6) | 0.166666939854622 | 6 | 3221225472 | 2014-06-07 07:05:00 | 2014-06-07 07:15:00 | > | Volume Id: 9 usage time (DiskOffering: 6) | 0.16666667163372 | 6 | 3221225472 | 2014-06-07 07:15:00 | 2014-06-07 07:25:00 | > | Volume Id: 9 usage time (DiskOffering: 6) | 0.0277749989181757 | 6 | 3221225472 | 2014-06-07 07:25:00 | 2014-06-07 07:35:00 | > | Volume Id: 9 usage time (DiskOffering: 6) | 0.052500281482935 | 6 | 21474836480 | 2014-06-07 07:25:00 | 2014-06-07 07:35:00 | > | Volume Id: 9 usage time (DiskOffering: 4) | 0.0863919407129288 | 4 | 21474836480 | 2014-06-07 07:25:00 | 2014-06-07 07:35:00 | > +-------------------------------------------+--------------------+-------------+-------------+---------------------+---------------------+ > > We can see that usage records are duplicated when a volume has multiple sizes or multiple disk offerings on a given time range. Previously, usage records were aggregated, and size and offering_id were the values at the end of the period (see example https://issues.apache.org/jira/browse/CLOUDSTACK-6669?focusedCommentId=14020334) > > > Thanks, > > Olivier Lemasle > > --===============2768718090149202601==--