#OrchestratorNewStructure_ProcessorTrace

dev-linux
Ivan Maslov 5 years ago
parent 5939993615
commit 22d089213f

@ -133,6 +133,21 @@ mDict = {
}
]
},
"Processor":{
"LogList_":"Fill list when orchestrator is running",
"TransactionList_":"List of processor activity, whick was executed",
"TransactionList__":[
{
"DateTimeStart":"2009-09-01T00:00:00.000Z",
"DateTimeEnd":"2009-09-01T00:00:00.000Z",
"ActivityList":[]
}
],
"TransactionList":[],
"TransactionTrace_<ActivityTypeName>":"<bool> if Trace for command is selected for False, the tracing will be off for such activity type",
"TransactionTrace_ActivityCMDRun":True,
},
"ControlPanelDict":{
"RefreshSeconds": 5,

@ -5,6 +5,7 @@ import pdb
import os
import sys
import subprocess
import copy
import win32ts
#Глобальная переменная - все глобальные значения программы
global mGlobalDict
@ -50,7 +51,10 @@ def ProcessingRun(inConfigurationDict):
#print(mGlobalDict)
lDateTimeString=datetime.datetime.strftime(datetime.datetime.now(),"%Y.%m.%d %H:%M:%S::%f")
lResult={"dateTime":lDateTimeString, "state":"connected", "actionListResult":[]}
lTransactionItem={}
#Transaction start
lTransactionItem["DateTimeStart"] = datetime.datetime.now().strftime("%Y-%m-%dT%H:%M:%S.%f")
lTransactionItem["ActivityList"]=[]
for lItem in inConfigurationDict["actionList"]:
#Добавить входные значения
lResult["actionListResult"].append({"inArgs":lItem})
@ -130,5 +134,15 @@ def ProcessingRun(inConfigurationDict):
#pdb.set_trace()
lResult["actionListResult"][-1]["key_list"]=lItem["key_list"]
lResult["actionListResult"][-1]["value"]=lGlobalDict.get(lItem["key_list"][-1],None)
##################
#Trace activity
##################
if mGlobalDict["Processor"].get(f"TransactionTrace_{lItem['type']}",True):
#Add activity in TransactionList if it is applicable
lTransactionItem["ActivityList"].append(copy.deepcopy(lItem))
#Transaction end
lTransactionItem["DateTimeEnd"] = datetime.datetime.now().strftime("%Y-%m-%dT%H:%M:%S.%f")
#Перенос результатов в TransactionList
mGlobalDict["Processor"]["TransactionList"].append(lTransactionItem)
#Вернуть результат
return lResult

Loading…
Cancel
Save