本文整理汇总了Python中sentry.models.Group.data方法的典型用法代码示例。如果您正苦于以下问题:Python Group.data方法的具体用法?Python Group.data怎么用?Python Group.data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sentry.models.Group
的用法示例。
在下文中一共展示了Group.data方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: make_group_generator
# 需要导入模块: from sentry.models import Group [as 别名]
# 或者: from sentry.models.Group import data [as 别名]
def make_group_generator(random, project):
epoch = to_timestamp(datetime(2016, 6, 1, 0, 0, 0, tzinfo=timezone.utc))
for id in itertools.count(1):
first_seen = epoch + random.randint(0, 60 * 60 * 24 * 30)
last_seen = random.randint(first_seen, first_seen + (60 * 60 * 24 * 30))
culprit = make_culprit(random)
level = random.choice(LOG_LEVELS.keys())
message = make_message(random)
group = Group(
id=id,
project=project,
culprit=culprit,
level=level,
message=message,
first_seen=to_datetime(first_seen),
last_seen=to_datetime(last_seen),
status=random.choice((GroupStatus.UNRESOLVED, GroupStatus.RESOLVED, )),
data={
'type': 'default',
'metadata': {
'title': message,
}
}
)
if random.random() < 0.8:
group.data = make_group_metadata(random, group)
yield group
示例2: make_group_generator
# 需要导入模块: from sentry.models import Group [as 别名]
# 或者: from sentry.models.Group import data [as 别名]
def make_group_generator(random, project):
epoch = to_timestamp(datetime(2016, 6, 1, 0, 0, 0, tzinfo=timezone.utc))
for id in itertools.count(1):
first_seen = epoch + random.randint(0, 60 * 60 * 24 * 30)
last_seen = random.randint(first_seen, first_seen + (60 * 60 * 24 * 30))
group = Group(
id=id,
project=project,
culprit=make_culprit(random),
level=random.choice(LOG_LEVELS.keys()),
message=make_message(random),
first_seen=to_datetime(first_seen),
last_seen=to_datetime(last_seen),
)
if random.random() < 0.8:
group.data = make_group_metadata(random, group)
yield group