Skip to content

Commit

Permalink
adding output file location option (#200)
Browse files Browse the repository at this point in the history
* adding output file location option

* wrong variable
  • Loading branch information
paigerube14 authored Jun 26, 2023
1 parent eb9fd38 commit b03433e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ When the cerberus is configured to run in the daemon mode, it will continuosly m
#### Report
The report is generated in the run directory and it contains the information about each check/monitored component status per iteration with timestamps. It also displays information about the components in case of failure. Refer [report](docs/example_report.md) for example.

You can use the "-o <file_path_name>" option to change the location of the created report

#### Metrics API
Cerberus exposes the metrics including the failures observed during the run through an API. Tools consuming Cerberus can query the API to get a blob of json with the observed failures to scrape and act accordingly. For example, we can query for etcd failures within a start and end time and take actions to determine pass/fail for test cases or report whether the cluster is healthy or unhealthy for that duration.

Expand Down
9 changes: 8 additions & 1 deletion start_cerberus.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,11 +557,18 @@ def main(cfg):
help="config location",
default="config/config.yaml",
)
parser.add_option(
"-o",
"--output",
dest="output",
help="output report location",
default="cerberus.report",
)
(options, args) = parser.parse_args()
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s [%(levelname)s] %(message)s",
handlers=[logging.FileHandler("cerberus.report", mode="w"), logging.StreamHandler()],
handlers=[logging.FileHandler(options.output, mode="w"), logging.StreamHandler()],
)
if options.cfg is None:
logging.error("Please check if you have passed the config")
Expand Down

0 comments on commit b03433e

Please sign in to comment.