예제 #1
0
 def InitializeMetadata(self, id, aws_id):
     ncommands = len(self.manifest.GetJob(id)["Commands"])
     nuploads = self._GetUploadCount(id)
     ndownloads = len(self.manifest.GetJob(id)["RequiredS3Data"]) - nuploads
     inst = InstanceMetadata(id=id,
                             aws_id=aws_id,
                             ncommands=ncommands,
                             nuploads=nuploads,
                             ndownloads=ndownloads,
                             lastmessage="Initialize",
                             lastupdate=TimeHelper.GetUTCNowString(),
                             ncommandsFinished=0,
                             nuploadsFinished=0,
                             ndownloadsFinished=0)
     return inst
예제 #2
0
 def IncrementDownloadFinished(self):
     self._doc["NDownloadsFinished"] += 1
     self._doc["LastMessage"] = "download finished"
     self._doc["LastUpdate"] = TimeHelper.GetUTCNowString()
예제 #3
0
 def IncrementCommandFinished(self):
     self._doc["NCommandsFinished"] += 1
     self._doc["LastMessage"] = "command finished"
     self._doc["LastUpdate"] = TimeHelper.GetUTCNowString()
예제 #4
0
 def UpdateMessage(self, msg):
     self._doc["LastUpdate"] = TimeHelper.GetUTCNowString() 
     self._doc["LastMessage"] = msg