Пример #1
0
 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)
Пример #2
0
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)
Пример #3
0
 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))
Пример #4
0
 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))
Пример #5
0
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)
Пример #6
0
def getTableService():
    return SummaryTable(config.AZURE_STORAGE_ACCOUNT_NAME,
                        config.AZURE_STORAGE_ACCOUNT_KEY,
                        config.AZURE_STORAGE_SUMMARY_TABLE_NAME)
Пример #7
0
 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)
Пример #8
0
    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()
Пример #9
0
 def setUpClass(self):
     self.event_type = "test"
     self.table = SummaryTable(config.AZURE_STORAGE_ACCOUNT_NAME,
                               config.AZURE_STORAGE_ACCOUNT_KEY,
                               'testharness')
Пример #10
0
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)