1// Copyright (C) MongoDB, Inc. 2014-present.
2//
3// Licensed under the Apache License, Version 2.0 (the "License"); you may
4// not use this file except in compliance with the License. You may obtain
5// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6
7package mongostat
8
9var Usage = `<options> <polling interval in seconds>
10
11Monitor basic MongoDB server statistics.
12
13See http://docs.mongodb.org/manual/reference/program/mongostat/ for more information.`
14
15// StatOptions defines the set of options to use for configuring mongostat.
16type StatOptions struct {
17	Columns       string `short:"o" value-name:"<field>[,<field>]*" description:"fields to show. For custom fields, use dot-syntax to index into serverStatus output, and optional methods .diff() and .rate() e.g. metrics.record.moves.diff()"`
18	AppendColumns string `short:"O" value-name:"<field>[,<field>]*" description:"like -o, but preloaded with default fields. Specified fields inserted after default output"`
19	HumanReadable string `long:"humanReadable" default:"true" description:"print sizes and time in human readable format (e.g. 1K 234M 2G). To use the more precise machine readable format, use --humanReadable=false"`
20	NoHeaders     bool   `long:"noheaders" description:"don't output column names"`
21	RowCount      int64  `long:"rowcount" value-name:"<count>" short:"n" description:"number of stats lines to print (0 for indefinite)"`
22	Discover      bool   `long:"discover" description:"discover nodes and display stats for all"`
23	Http          bool   `long:"http" description:"use HTTP instead of raw db connection"`
24	All           bool   `long:"all" description:"all optional fields"`
25	Json          bool   `long:"json" description:"output as JSON rather than a formatted table"`
26	Deprecated    bool   `long:"useDeprecatedJsonKeys" description:"use old key names; only valid with the json output option."`
27	Interactive   bool   `short:"i" long:"interactive" description:"display stats in a non-scrolling interface"`
28}
29
30// Name returns a human-readable group name for mongostat options.
31func (*StatOptions) Name() string {
32	return "stat"
33}
34