MSV FM

[email protected]: ~ $
Path : /lib/fm-agent/library/
File Upload :
Current < : //lib/fm-agent/library/result_queue.py

class ResultQueue(object):
    """ If the aggregator can't be reached for some reason, we want
    to still keep calculating results and store them locally until we can reach the agg
    again."""

    # Variables for ResultQueue
    #QUEUE_MAX_RESULTS = 150000     # We put results in a queue if aggregator can't be reached.
    #QUEUE_BATCH_SIZE = 10000       # How many queue results we send back to the aggregator at once

    def __init__(self, queue_max_results=None, queue_batch_size=None):
        self.data = []
        self.queue_max_results = queue_max_results
        if self.queue_max_results is None:
            self.queue_max_results = 150000
        self.queue_batch_size = queue_batch_size
        if self.queue_batch_size is None:
            self.queue_batch_size = 10000

    def pop(self):
        # remove the oldest results first
        self.data.pop(0)

    # Pop only the most recent result
    def pop_latest(self):
        self.data.pop()

    def pop_results(self, chunk=None):
        if chunk is None:
            chunk = self.queue_batch_size
        # Pop and return 'chunk' of the newest items
        if len(self.data) <= chunk:
            result = self.data
            self.data = []

        else:
            x = len(self.data) - chunk
            result = self.data[x:]
            self.data = self.data[:x]

        return result

    def push(self, result):
        if len(self.data) == self.queue_max_results:
            self.pop()
        self.data.append(result)

    def update(self, results):
        if len(results) + len(self.data) <= self.queue_max_results:
            self.data.extend(results)
        else:
            # Make room so we stay under QUEUE_MAX_RESULTS
            free_space = self.queue_max_results - len(self.data)
            removal = len(results) - free_space
            self.data = self.data[removal:]
            self.data.extend(results)

    def isEmpty(self):
        return len(self.data) == 0

    def queueLength(self): return len(self.data)
    


Bethany
Bethany
0%

THE FINEST HOTEL NEAR LAKE KIVU

The Perfect Base For You

Required fields are followed by *





EC1A68011

About Us

Delicious Interior With The Pinch Of Everything

Bethany Investment group is Presbyterian church in Rwanda(EPR) company that manage Hotel and Guest house in Karongi (Bethany Hotel), ISANO branch in GIKONDO(Kigali), Kiyovu branch(Kigali), AMIZERO branch(Nyagatare-East) and Gisenyi Branch(Rubavu).

Accomodation

Get a Comfortable Room
Feel The Comfort

Get a comfortable room and feel our hotel’s comfort. Bethany Hotel features a variety of fully furnished rooms with extra space, Executive rooms, Deluxe rooms with a beautiful lake view and garden space, Deluxe rooms, comfort rooms, family rooms and standard rooms at your service.

Standard Single

Services

We Provide Top Class Facility
Especially For You

Beach BBQ Party

Kick back on the beach& and enjoy our berbecue from our masterchef

Breakfast

Kick back at our hotels& enjoy our breakfast from our masterchef

Conference Hall

Kick back at our hotels& enjoy our conference halls from all bethany branches

Enjoy with your partner

Honeymoon Package

80%

Get In Touch

Don’t Miss Any Update

    +

    Search your Room

    Required fields are followed by *