Skip to content

Commit 4a7c09a

Browse files
author
David Linko
committed
updated to uses time_offset as a timestamp
1 parent 2db0a8a commit 4a7c09a

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

anms-core/anms/components/schemas/ARIs/rpt_entry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class Config:
3636
reference_time: Optional[datetime] = None
3737
mgr_time: Optional[datetime] = None
3838
nonce_cbor: Optional[str] = None
39-
time_offset: Optional[str] = None
39+
time_offset: Optional[datetime] = None
4040
report_source: Optional[str] = None
4141
report_items: Optional[list] = None
4242
report_item_indexes: Optional[list] = None

anms-core/anms/models/relational/report.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,14 @@ class Report(Model):
4343
agent_id = Column(Integer)
4444
ari_rptset_cbor = Column(LargeBinary)
4545
ari_rptlist_id = Column(Integer)
46-
time_offset = Column(LargeBinary)
46+
time_offset = Column(DateTime)
4747
report_source = Column(LargeBinary)
4848
report_items = Column(ARRAY(LargeBinary) )#bytea[] NULL
4949
report_item_indexes = Column(ARRAY(Integer))
5050
# processing the raw cbor into an ari object
5151
@orm.reconstructor
5252
def init_on_load(self):
5353
self.nonce_cbor = TRANSMORGIFIER.transcode("0x"+getattr(self, 'nonce_cbor').hex())['uri']
54-
self.time_offset = TRANSMORGIFIER.transcode("0x"+getattr(self, 'time_offset').hex())['uri']
5554
self.report_source = TRANSMORGIFIER.transcode("0x"+getattr(self, 'report_source').hex())['uri']
5655
self.report_items = [TRANSMORGIFIER.transcode("0x"+x.hex())['uri'] for x in getattr(self, 'report_items')]
5756

@@ -65,6 +64,7 @@ def as_dict(self) -> Dict[str, Any]:
6564
'nonce_cbor': getattr(self, 'nonce_cbor'),
6665
'agent_id': getattr(self, 'agent_id'),
6766
'ari_rptlist_id': getattr(self, 'ari_rptlist_id'),
67+
'time_offset': getattr(self, 'time_offset'),
6868
'report_source': getattr(self, 'report_source'),
6969
'report_items': getattr(self, 'report_items'),
7070
'report_item_indexes': getattr(self, 'report_item_indexes')

grafana/provisioning/dashboards/anms-monitor.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"editable": true,
2525
"fiscalYearStartMonth": 0,
2626
"graphTooltip": 0,
27-
"id": 0,
27+
"id": 1,
2828
"links": [],
2929
"panels": [
3030
{
@@ -481,7 +481,7 @@
481481
"group": [],
482482
"metricColumn": "none",
483483
"rawQuery": true,
484-
"rawSql": "-- all reports \nSELECT \n reference_time,\n mgr_time,\n agent_id, \n encode(time_offset,'hex') as time_offset,\n encode(report_source,'hex') as report_source,\n report_items\nFROM\n vw_ari_rpt_set",
484+
"rawSql": "-- all reports \nSELECT \n reference_time,\n mgr_time,\n agent_id, \n time_offset,\n encode(report_source,'hex') as report_source,\n report_items\nFROM\n vw_ari_rpt_set",
485485
"refId": "A",
486486
"select": [
487487
[
@@ -823,6 +823,6 @@
823823
"timepicker": {},
824824
"timezone": "",
825825
"title": "Monitor Page",
826-
"uid": "mwvijjmvk2",
827-
"version": 8
826+
"uid": "mwvijjmvk",
827+
"version": 2
828828
}

0 commit comments

Comments
 (0)