mirror of
https://source.quilibrium.com/quilibrium/ceremonyclient.git
synced 2024-11-11 02:35:18 +00:00
33 lines
815 B
Go
33 lines
815 B
Go
|
// Copyright 2021 The LevelDB-Go and Pebble Authors. All rights reserved. Use
|
||
|
// of this source code is governed by a BSD-style license that can be found in
|
||
|
// the LICENSE file.
|
||
|
|
||
|
package logs
|
||
|
|
||
|
import (
|
||
|
"time"
|
||
|
|
||
|
"github.com/spf13/cobra"
|
||
|
)
|
||
|
|
||
|
// NewCmd returns a new cobra.Command for parsing logs.
|
||
|
func NewCmd() *cobra.Command {
|
||
|
cmd := &cobra.Command{
|
||
|
Use: "logs",
|
||
|
Short: "Scan and summarize logs",
|
||
|
}
|
||
|
|
||
|
compactionCmd := &cobra.Command{
|
||
|
Use: "compactions",
|
||
|
Short: "Scan and summarize compaction logs",
|
||
|
RunE: runCompactionLogs,
|
||
|
}
|
||
|
compactionCmd.Flags().Duration(
|
||
|
"window", 10*time.Minute, "time window in which to aggregate compactions")
|
||
|
compactionCmd.Flags().Duration(
|
||
|
"long-running-limit", 0, "log compactions with runtime greater than the limit")
|
||
|
|
||
|
cmd.AddCommand(compactionCmd)
|
||
|
return cmd
|
||
|
}
|