Separate looted currency and preserve growing realm state in atomic chunks
Core tests / core (push) Successful in 49s

This commit is contained in:
Codex
2026-09-24 03:16:52 +12:00
parent e7b9df9e08
commit 8e01cdee22
13 changed files with 54 additions and 17 deletions
+3 -2
View File
@@ -1,6 +1,6 @@
"""Read native counters and profiler output; return bounded public measurements."""
import json,subprocess,time,math
COUNTERS=('quests','abandoned','lootEvents','lootItems','partyKills','rewarded')
COUNTERS=('quests','abandoned','lootEvents','lootItems','partyKills','rewarded','lootedCopper')
def normalize_performance(raw):
def number(v):
try:
@@ -27,9 +27,10 @@ def collect(sql,state):
guids=','.join(map(str,allowed))
for line in sql('SELECT guid,COUNT(*) FROM acore_characters.character_queststatus_rewarded WHERE guid IN ('+guids+') GROUP BY guid').splitlines():
guid,count=map(int,line.split('\t'));rewarded[guid]=count
money={int(g):int(c) for g,c in (line.split('\t') for line in sql('SELECT guid,looted_copper FROM acore_auth.azerothai_currency').splitlines())}
result=[]
for guid,b in allowed.items():
counters=rows.get(guid,dict.fromkeys(COUNTERS,0));counters['rewarded']=rewarded.get(guid,0)
counters=rows.get(guid,dict.fromkeys(COUNTERS,0));counters['rewarded']=rewarded.get(guid,0);counters['lootedCopper']=money.get(guid,0)
result.append({'guid':guid,'name':b['name'],**counters})
return result