Skip to content

Commit

Permalink
add integration alloc 1g cmd: to hold ram on server (#12231)
Browse files Browse the repository at this point in the history
Co-authored-by: awskii <[email protected]>
  • Loading branch information
AskAlexSharov and awskii authored Oct 10, 2024
1 parent 792addd commit 4311fe9
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions cmd/integration/commands/stages.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,21 @@ var cmdPrintStages = &cobra.Command{
},
}

var cmdAlloc = &cobra.Command{
Use: "alloc",
Example: "integration allocates and holds 1Gb (or given size)",
Run: func(cmd *cobra.Command, args []string) {
cmd.Flags().Set(logging.LogConsoleVerbosityFlag.Name, "debug")
v, err := datasize.ParseString(args[0])
if err != nil {
panic(err)
}
n := make([]byte, v.Bytes())
libcommon.Sleep(cmd.Context(), 265*24*time.Hour)
_ = n
},
}

var cmdPrintTableSizes = &cobra.Command{
Use: "print_table_sizes",
Short: "",
Expand Down Expand Up @@ -471,6 +486,8 @@ func init() {
withHeimdall(cmdPrintStages)
rootCmd.AddCommand(cmdPrintStages)

rootCmd.AddCommand(cmdAlloc)

withDataDir(cmdPrintTableSizes)
withOutputCsvFile(cmdPrintTableSizes)
rootCmd.AddCommand(cmdPrintTableSizes)
Expand Down

0 comments on commit 4311fe9

Please sign in to comment.