Skip to content

Commit

Permalink
🗃️ add AbnormalJobsBlob. #31
Browse files Browse the repository at this point in the history
  • Loading branch information
perillaroc committed Sep 30, 2018
1 parent b1ecd64 commit 6435a44
Show file tree
Hide file tree
Showing 4 changed files with 600 additions and 0 deletions.
Empty file.
29 changes: 29 additions & 0 deletions nmp-model/nmp_model/mongodb/blobs/workload/abnormal_jobs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# coding: utf-8
import datetime
from mongoengine import \
EmbeddedDocument, StringField, IntField, ListField, DictField, EmbeddedDocumentField, DateTimeField

from nmp_model.mongodb.blob import Blob, BlobData


class AbnormalJobsContent(EmbeddedDocument):
plugins = ListField(DictField())
abnormal_jobs = ListField(DictField())

def to_dict(self):
return self.to_mongo().to_dict()


class AbnormalJobsBlobData(BlobData):
workload_system = StringField(choices=['loadleveler', 'slurm'])
user_name = StringField()
collected_time = DateTimeField()
update_time = DateTimeField(default=datetime.datetime.utcnow)
content = EmbeddedDocumentField(AbnormalJobsContent)

def to_dict(self):
return self.to_mongo().to_dict()


class AbnormalJobsBlob(Blob):
data = EmbeddedDocumentField(AbnormalJobsBlobData)
Empty file.
Loading

0 comments on commit 6435a44

Please sign in to comment.