Projects
Eulaceura:Factory
sysSentry
_service:obs_scm:add-detail-time.patch
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:add-detail-time.patch of Package sysSentry
From 9ecd4c2c9c9f9578f5ec4780360dc67b182b384a Mon Sep 17 00:00:00 2001 From: jinsaihang <jinsaihang@h-partners.com> Date: Wed, 9 Oct 2024 08:09:04 +0000 Subject: [PATCH 2/2] add detail time Signed-off-by: jinsaihang <jinsaihang@h-partners.com> --- src/python/syssentry/alarm.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/python/syssentry/alarm.py b/src/python/syssentry/alarm.py index 74a2716..d5337d3 100644 --- a/src/python/syssentry/alarm.py +++ b/src/python/syssentry/alarm.py @@ -118,11 +118,13 @@ def get_alarm_result(task_name: str, time_range: int, detailed: bool) -> List[Di logging.debug(f"get_alarm_result: final alarm_list of {alarm_id} has {len(alarm_list)} elements") def xalarm_to_dict(alarm_info: Xalarm) -> dict: + timestamp = alarm_info.timetamp.tv_sec + alarm_info.timetamp.tv_usec / 1000000 + dt_object = datetime.fromtimestamp(int(timestamp)) return { 'alarm_id': xalarm_getid(alarm_info), 'alarm_type': xalarm_gettype(alarm_info), 'alarm_level': xalarm_getlevel(alarm_info), - 'timetamp': xalarm_gettime(alarm_info), + 'timestamp': dt_object.strftime("%Y-%m-%d %H:%M:%S"), 'msg1': xalarm_getdesc(alarm_info) } -- 2.27.0
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2