def sendEventToPubSub(pubsubAddr, ts): eventList = ["variable_1"] # this shoule be deleted clientId = "test" + "_" + str(ts) metainfo = "GRID[<0,0>:<1,1>]%TS["+str(ts)+"]" matchtype= "META_GRID" print("debug clientid %s metainfo %s matchtype %s"%(clientId,metainfo,matchtype)) pubsubclient.publishEventList(pubsubAddr,eventList,clientId,metainfo,matchtype) print("pubsubclient %s ok"%(clientId))
def sendEventToPubSub(ts): addrList = pubsubclient.getServerAddr() print (addrList) addr = addrList[0] eventList = ["dataPattern_1"] # this shoule be deleted clientId = "test" + "_" + str(ts) metainfo = "GRID[<-1,-1>:<-1,-1>]%TS["+str(ts)+"]" matchtype = "NAME" pubsubclient.publishEventList(addr,eventList,clientId,metainfo,matchtype)
#the time used for predicates every time time.sleep(0.01) version = version + 1 if (patternHeppen == True): print( "---------patternHeppen at ts %d , write info to meta----------" % (version)) # publish event to pubsub broker addrList = pubsubclient.getServerAddr() print("addrlist is", addrList) addr = addrList[0] eventList = ["ANASTART"] # this shoule be deleted clientId = "test" + "_" + str(version) # it is better to update meta into json format metainfo = "GRID[<-1,-1>:<-1,-1>]%TS[" + str(version) + "]" matchtype = "NAME" pubsubclient.publishEventList(addr, eventList, clientId, metainfo, matchtype) #break ds.finalize() endanay = timeit.default_timer() print("time span") print(endanay - startanay)