mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-12-12 02:00:49 +08:00
PT-1979 Improved mdb summary information
Added the MongoDB instance command line options to the output. Also fixed the spacing in the replicaset section.
This commit is contained in:
@@ -93,6 +93,7 @@ type hostInfo struct {
|
|||||||
ProcCreateTime time.Time
|
ProcCreateTime time.Time
|
||||||
ProcProcessCount int
|
ProcProcessCount int
|
||||||
|
|
||||||
|
CmdlineArgs []string
|
||||||
// Server Status
|
// Server Status
|
||||||
ProcessName string
|
ProcessName string
|
||||||
ReplicasetName string
|
ReplicasetName string
|
||||||
@@ -326,6 +327,11 @@ func formatResults(ci *collectedInfo, format string) ([]byte, error) {
|
|||||||
return nil, errors.Wrap(err, "cannot parse hosttemplateData section of the output template")
|
return nil, errors.Wrap(err, "cannot parse hosttemplateData section of the output template")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
t = template.Must(template.New("cmdlineargsa").Parse(templates.CmdlineArgs))
|
||||||
|
if err := t.Execute(buf, ci.HostInfo); err != nil {
|
||||||
|
return nil, errors.Wrap(err, "cannot parse the command line args section of the output template")
|
||||||
|
}
|
||||||
|
|
||||||
t = template.Must(template.New("runningOps").Parse(templates.RunningOps))
|
t = template.Must(template.New("runningOps").Parse(templates.RunningOps))
|
||||||
if err := t.Execute(buf, ci.RunningOps); err != nil {
|
if err := t.Execute(buf, ci.RunningOps); err != nil {
|
||||||
return nil, errors.Wrap(err, "cannot parse runningOps section of the output template")
|
return nil, errors.Wrap(err, "cannot parse runningOps section of the output template")
|
||||||
@@ -400,6 +406,7 @@ func getHostInfo(ctx context.Context, client *mongo.Client) (*hostInfo, error) {
|
|||||||
ProcPath: pi.Path,
|
ProcPath: pi.Path,
|
||||||
ProcUserName: pi.UserName,
|
ProcUserName: pi.UserName,
|
||||||
ProcCreateTime: pi.CreateTime,
|
ProcCreateTime: pi.CreateTime,
|
||||||
|
CmdlineArgs: cmdOpts.Argv,
|
||||||
}
|
}
|
||||||
if ss.Repl != nil {
|
if ss.Repl != nil {
|
||||||
i.ReplicasetName = ss.Repl.SetName
|
i.ReplicasetName = ss.Repl.SetName
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ const HostInfo = `# This host
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
Processes | {{.ProcProcessCount}}
|
Processes | {{.ProcProcessCount}}
|
||||||
Process Type | {{.NodeType}}
|
Process Type | {{.NodeType}}
|
||||||
{{ if .ReplicasetName -}}
|
{{- if .ReplicasetName }}
|
||||||
ReplSet | {{.ReplicasetName}}
|
ReplSet | {{.ReplicasetName}}
|
||||||
Repl Status |
|
Repl Status |
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|||||||
Reference in New Issue
Block a user