Fix vpnv6 ECMP under-parse and persist full CLI line counts.

RR vpnv6 wrap lines with next-hop+metrics were collapsing ECMP legs; store raw_line_count/declared_total before DB truncate so collect stats stay accurate.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-09-23 14:53:19 +08:00
parent 86fcb98218
commit ac53af4a5d
16 changed files with 531 additions and 35 deletions

View file

@ -118,6 +118,10 @@ class BizStateBatchCommand(Base):
params_json: Mapped[dict] = mapped_column(_JsonType, default=dict)
parse_status: Mapped[str] = mapped_column(String(32), default="") # ok|unmatched|failed|skipped_custom
row_count: Mapped[int] = mapped_column(Integer, default=0)
# Full CLI lines counted before raw_text truncate into Postgres.
raw_line_count: Mapped[int] = mapped_column(Integer, default=0)
# Optional device-declared total (BGP Total number of routes, etc.).
declared_total: Mapped[int] = mapped_column(Integer, default=0)
raw_text: Mapped[str] = mapped_column(Text, default="")
message: Mapped[str] = mapped_column(String(1024), default="")
created_at: Mapped[datetime] = mapped_column(DateTime, default=utcnow_naive)