LGTM

On Tue, Jan 26, 2016 at 6:00 PM 'Klaus Aehlig' via ganeti-devel <
[email protected]> wrote:

> When forgetting data from the buffer because the maximal buffer size is
> reached,
> forget the oldest value, not the newest one.
>
> Signed-off-by: Klaus Aehlig <[email protected]>
> ---
>  src/Ganeti/DataCollectors/CPUload.hs | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/src/Ganeti/DataCollectors/CPUload.hs
> b/src/Ganeti/DataCollectors/CPUload.hs
> index 65ac423..ed13bde 100644
> --- a/src/Ganeti/DataCollectors/CPUload.hs
> +++ b/src/Ganeti/DataCollectors/CPUload.hs
> @@ -149,10 +149,7 @@ formatData l@(x:xs) = CPUavgload (length l - 1) xs x
>  -- | Update a Map Entry.
>  updateEntry :: Buffer -> Buffer -> Buffer
>  updateEntry newBuffer mapEntry =
> -  (Seq.><) newBuffer
> -  (if Seq.length mapEntry < bufferSize
> -    then mapEntry
> -    else Seq.drop 1 mapEntry)
> +  (Seq.><) newBuffer (Seq.take bufferSize mapEntry)
>
>  -- | Updates the given Collector data.
>  dcUpdate :: Maybe CollectorData -> IO CollectorData
> --
> 2.7.0.rc3.207.g0ac5344
>
> --
Lisa Velden
Software Engineer
[email protected]

Google Germany GmbH
Erika-Mann-Straße 33
80636 München


Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg

Reply via email to