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
def IncrementDownloadFinished(self): self._doc["NDownloadsFinished"] += 1 self._doc["LastMessage"] = "download finished" self._doc["LastUpdate"] = TimeHelper.GetUTCNowString()
def IncrementCommandFinished(self): self._doc["NCommandsFinished"] += 1 self._doc["LastMessage"] = "command finished" self._doc["LastUpdate"] = TimeHelper.GetUTCNowString()
def UpdateMessage(self, msg): self._doc["LastUpdate"] = TimeHelper.GetUTCNowString() self._doc["LastMessage"] = msg