It's not only one-time usage - core_usage_type and
power_consumption_usage_type are passed to every call of update_assets -
that's why result of get_core_usage() and get_power_consumption_usage() is
assigned to variables - one vs N db selects.

Pozdrawiam

Mateusz Kurek


On Mon, Jan 13, 2014 at 11:47 AM, kula1922 <notifications@github.com> wrote:

> In src/ralph_pricing/plugins/assets.py:
>
> >      date = kwargs['today']
> > -    count = sum(update_assets(data, date, usage) for data in get_assets(date))
> > +    count = sum(
> > +        update_assets(
> > +            data,
> > +            date,
> > +            core_usage_type,
> > +            power_consumption_usage_type,
>
> update_assets(
> ....
> get_core_usage(),
> get_power_consumption_usage(),
> ....
> )
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/kula1922/ralph_pricing/pull/1/files#r8821612>
> .
>