ceremonyclient/pebble/tool/logs/tool.go
Cassandra Heart 2e2a1e4789
v1.2.0 (#31)
2024-01-03 01:31:42 -06:00

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
}