File size: 1,092 Bytes
b421dd5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
"""Quick verification that overwatch store reads data from NeonDB."""
import os
from overwatch.store import LogStore

s = LogStore()

# Test query_events
events, total = s.query_events(page=1, page_size=5)
print(f"query_events — total: {total}")
for e in events[:3]:
    print(f"  [{e.log_level}] {e.stage:<30} {e.document_name[:25]}")

# Test list_documents
docs, doc_total = s.list_documents(page=1, page_size=5)
print(f"\nlist_documents — total: {doc_total}")
for d in docs[:3]:
    print(f"  doc_id={d['document_id'][:12]}  status={d['processing_status']:<12}  "
          f"warn={d['warning_count']}  err={d['error_count']}")

# Test document summary on the first real document
if docs:
    first_doc_id = docs[0]["document_id"]
    summary = s.get_document_summary(first_doc_id)
    if summary:
        print(f"\nget_document_summary({first_doc_id[:12]}...):")
        print(f"  status        : {summary['processing_status']}")
        print(f"  total_events  : {summary['total_events']}")
        print(f"  extraction_summary stages: {list(summary['extraction_summary'].keys())}")