projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
21461: Improves memory management when running tests in "open" mode.
[arvados.git]
/
lib
/
costanalyzer
/
cmd.go
diff --git
a/lib/costanalyzer/cmd.go
b/lib/costanalyzer/cmd.go
index b08e943c0120e968862c1a35703dbe2d8c90fa01..f2a7af49332037ea98fdc93a357563afe5560aa9 100644
(file)
--- a/
lib/costanalyzer/cmd.go
+++ b/
lib/costanalyzer/cmd.go
@@
-6,31
+6,31
@@
package costanalyzer
import (
"io"
import (
"io"
+ "time"
"git.arvados.org/arvados.git/lib/cmd"
"git.arvados.org/arvados.git/lib/cmd"
- "git.arvados.org/arvados.git/lib/config"
"git.arvados.org/arvados.git/sdk/go/ctxlog"
)
"git.arvados.org/arvados.git/sdk/go/ctxlog"
)
-var Command
command
+var Command
= command{}
-type command struct{}
+type command struct {
+ uuids arrayFlags
+ resultsDir string
+ cache bool
+ begin time.Time
+ end time.Time
+}
// RunCommand implements the subcommand "costanalyzer <collection> <collection> ..."
// RunCommand implements the subcommand "costanalyzer <collection> <collection> ..."
-func (command) RunCommand(prog string, args []string, stdin io.Reader, stdout, stderr io.Writer) int {
+func (c
c
ommand) RunCommand(prog string, args []string, stdin io.Reader, stdout, stderr io.Writer) int {
var err error
logger := ctxlog.New(stderr, "text", "info")
logger.SetFormatter(cmd.NoPrefixFormatter{})
var err error
logger := ctxlog.New(stderr, "text", "info")
logger.SetFormatter(cmd.NoPrefixFormatter{})
- defer func() {
- if err != nil {
- logger.Error("\n" + err.Error())
- }
- }()
-
- loader := config.NewLoader(stdin, logger)
- loader.SkipLegacy = true
-
- exitcode, err := costanalyzer(prog, args, loader, logger, stdout, stderr)
+ exitcode, err := c.costAnalyzer(prog, args, logger, stdout, stderr)
+ if err != nil {
+ logger.Error("\n" + err.Error())
+ }
return exitcode
}
return exitcode
}