def __init__(self): self.log = Log() self.msgQueue = Queue(account_name=config.AZURE_STORAGE_ACCOUNT_NAME, account_key=config.AZURE_STORAGE_ACCOUNT_KEY, queue_name=config.HALO_QUEUE_MATCH) self.summary = SummaryTable(config.AZURE_STORAGE_ACCOUNT_NAME, config.AZURE_STORAGE_ACCOUNT_KEY, config.AZURE_STORAGE_SUMMARY_TABLE_NAME)
def increment_match_count(gamertag, amount = 1): """ Get the count of matches we are aware of for a given player. """ summary = SummaryTable(config.AZURE_STORAGE_ACCOUNT_NAME, config.AZURE_STORAGE_ACCOUNT_KEY, config.AZURE_STORAGE_SUMMARY_TABLE_NAME) count = get_match_count(gamertag) count = count + amount count_type = gamertag + "_match" summary.updateCount(count_type, count)
def __init__(self): self.log = Log() self.log.debug("Storage account for analyzer: {0}".format(config.AZURE_STORAGE_ACCOUNT_NAME)) self.msgQueue = Queue(account_name = config.AZURE_STORAGE_ACCOUNT_NAME, account_key=config.AZURE_STORAGE_ACCOUNT_KEY, queue_name=config.AZURE_STORAGE_QUEUE_NAME) self.summary = SummaryTable(config.AZURE_STORAGE_ACCOUNT_NAME, config.AZURE_STORAGE_ACCOUNT_KEY, config.AZURE_STORAGE_SUMMARY_TABLE_NAME) self.keep_running = bool(config.ANALYZER_KEEP_RUNNING) self.log.debug("Analyzer keep running: {0}".format(self.keep_running)) if self.keep_running: self.sleep_time = float(config.ANALYZER_SLEEP_TIME) self.log.debug("Sleep time between analyses: {0}".format(self.sleep_time))
def __init__(self): self.log = Log() self.log.debug("Storage account for analyzer: {0}".format( config.AZURE_STORAGE_ACCOUNT_NAME)) self.msgQueue = Queue(account_name=config.AZURE_STORAGE_ACCOUNT_NAME, account_key=config.AZURE_STORAGE_ACCOUNT_KEY, queue_name=config.AZURE_STORAGE_QUEUE_NAME) self.current_length = self.msgQueue.getLength() self.summary = SummaryTable(config.AZURE_STORAGE_ACCOUNT_NAME, config.AZURE_STORAGE_ACCOUNT_KEY, config.AZURE_STORAGE_SUMMARY_TABLE_NAME) self.sleep_time = float(config.ANALYZER_SLEEP_TIME) self.log.debug("Sleep time between analyses: {0}".format( self.sleep_time))
def createTable(): log.debug("Creating table named: " + config.AZURE_STORAGE_SUMMARY_TABLE_NAME) table = SummaryTable(config.AZURE_STORAGE_ACCOUNT_NAME, config.AZURE_STORAGE_ACCOUNT_KEY, config.AZURE_STORAGE_SUMMARY_TABLE_NAME)
def getTableService(): return SummaryTable(config.AZURE_STORAGE_ACCOUNT_NAME, config.AZURE_STORAGE_ACCOUNT_KEY, config.AZURE_STORAGE_SUMMARY_TABLE_NAME)
def __init__(self): self.log = Log() self.summary = SummaryTable(config.AZURE_STORAGE_ACCOUNT_NAME, config.AZURE_STORAGE_ACCOUNT_KEY, config.AZURE_STORAGE_SUMMARY_TABLE_NAME)
if not (0 < dist < sys.maxsize): print("continue") continue print("good loop") if dist <= 2000: if len(listSmall) < 5: print("list small:", dist) values = valuesCalculator(graph, source, target) listSmall.update({(source.index, target.index): values}) elif 2000 < dist <= 5000: if len(listMedium) < 5: print("list medium:", dist) values = valuesCalculator(graph, source, target) listMedium.update({(source.index, target.index): values}) else: if len(listBig) < 5: print("list big:", dist) values = valuesCalculator(graph, source, target) listBig.update({(source.index, target.index): values}) if len(listSmall) == 5 and len(listMedium) == 5 and len(listBig) == 5: condition = not condition summary = {**listSmall, **listMedium, **listBig} print(summary) app = SummaryTable(summary) app.mainloop()
def setUpClass(self): self.event_type = "test" self.table = SummaryTable(config.AZURE_STORAGE_ACCOUNT_NAME, config.AZURE_STORAGE_ACCOUNT_KEY, 'testharness')
def get_match_count(gamertag): summary = SummaryTable(config.AZURE_STORAGE_ACCOUNT_NAME, config.AZURE_STORAGE_ACCOUNT_KEY, config.AZURE_STORAGE_SUMMARY_TABLE_NAME) count_type = gamertag + "_match" return summary.getCount(count_type)