Skip to content

Commit

Permalink
add source schema to show_status
Browse files Browse the repository at this point in the history
  • Loading branch information
the4thdoctor committed Nov 25, 2017
1 parent 4ed58a8 commit d7b923c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions pg_chameleon/lib/global_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ def show_status(self):
list the replica status using the configuration files and the replica catalogue
"""
source_status=self.pg_eng.get_status()
tab_headers = ['Config file', 'Destination schema', 'Status' , 'Read lag', 'Last read', 'Replay lag' , 'Last replay']
tab_headers = ['Config file', 'Source schema', 'Destination schema', 'Status' , 'Read lag', 'Last read', 'Replay lag' , 'Last replay']
tab_body = []

for status in source_status:
Expand All @@ -527,7 +527,8 @@ def show_status(self):
last_read = status[4]
replay_lag = status[5]
last_replay = status[6]
tab_row = [source_name, dest_schema, source_status, read_lag, last_read, replay_lag, last_replay]
source_schema = status[7]
tab_row = [source_name, source_schema, dest_schema, source_status, read_lag, last_read, replay_lag, last_replay]
tab_body.append(tab_row)
print(tabulate(tab_body, headers=tab_headers))

Expand Down
3 changes: 2 additions & 1 deletion pg_chameleon/lib/pg_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,8 @@ def get_status(self):
date_trunc('seconds',now())-ts_last_received lag,
ts_last_received,
ts_last_received-ts_last_replay,
ts_last_replay
ts_last_replay,
t_source_schema
FROM
sch_chameleon.t_sources
ORDER BY
Expand Down

0 comments on commit d7b923c

Please sign in to comment.