Esempio n. 1
0
    def __getUserBWValues(self, user_id, ras_id, unique_id_val):
        snapshot = snapshot_main.getRealTimeManager().getSnapShot("user_bw")
        dates, values = snapshot.getDates(), snapshot.getValues()

        user_vals = []

        key = ",".join(map(str, (user_id, ras_id, unique_id_val)))

        i = len(values) - 1

        if i < 0:
            return ([], [])

        user_vals = []
        cur_val = values[i]
        while cur_val.has_key(key):
            user_vals.append(cur_val[key])

            i -= 1
            if i < 0:
                break

            cur_val = values[i]

        user_vals.reverse()
        return (dates[i + 1:], user_vals)
Esempio n. 2
0
 def getRealTimeSnapShot(self, request):
     request.needAuthType(request.ADMIN)
     request.checkArgs("name")
     requester = request.getAuthNameObj()
     requester.canDo("SEE REALTIME SNAPSHOTS")
     snapshot = snapshot_main.getRealTimeManager().getSnapShot(
         request["name"])
     return (snapshot.getDates(), snapshot.getValues())
Esempio n. 3
0
def init():
    voip_onlines_snapshot = VoIPOnlinesSnapShot()
    snapshot_main.getRealTimeManager().register(voip_onlines_snapshot)
    snapshot_main.getOnlinesLoop().registerClient(voip_onlines_snapshot)
Esempio n. 4
0
def init():
    snapshot_main.getRealTimeManager().register(AllOnlinesSnapShot())
Esempio n. 5
0
 def run(self):
     snapshot_main.getRealTimeManager().updateAll()
Esempio n. 6
0
def init():
    user_bw_snapshot = UserBWSnapShot()

    snapshot_main.getRealTimeManager().register(user_bw_snapshot)
    snapshot_main.getOnlinesLoop().registerClient(user_bw_snapshot)
Esempio n. 7
0
def init():
    internet_onlines_snapshot = InternetOnlinesSnapShot()
    snapshot_main.getRealTimeManager().register(internet_onlines_snapshot)
    snapshot_main.getOnlinesLoop().registerClient(internet_onlines_snapshot)