Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Add missing CLI metrics from inputs (part of #551) #555

Merged
merged 3 commits into from
Oct 28, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cmd/trade.go
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ func runTradeCmd(options inputs) {
env,
runtime.GOOS,
runtime.GOARCH,
runtime.Version(),
debnil marked this conversation as resolved.
Show resolved Hide resolved
"unknown_todo", // TODO DS Determine how to get GOARM.
guiVersionFlag,
*options.strategy,
Expand All @@ -558,6 +559,11 @@ func runTradeCmd(options inputs) {
int(botConfig.MonitoringPort) != 0,
len(botConfig.Filters) > 0,
botConfig.PostgresDbConfig != nil,
*options.operationalBuffer,
*options.operationalBufferNonNativePct,
*options.simMode,
*options.logPrefix,
debnil marked this conversation as resolved.
Show resolved Hide resolved
*options.fixedIterations,
)
if e != nil {
logger.Fatal(l, fmt.Errorf("could not generate metrics tracker: %s", e))
Expand Down
18 changes: 18 additions & 0 deletions support/metrics/metricsTracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ type commonProps struct {
Goos string `json:"goos"`
Goarch string `json:"goarch"`
Goarm string `json:"goarm"`
GoVersion string `json:"go_version"`
GuiVersion string `json:"gui_version"`
Strategy string `json:"strategy"`
UpdateTimeIntervalSeconds int32 `json:"update_time_interval_seconds"`
Expand All @@ -75,6 +76,11 @@ type commonProps struct {
EnabledFeatureMonitoring bool `json:"enabled_feature_monitoring"`
EnabledFeatureFilters bool `json:"enabled_feature_filters"`
EnabledFeaturePostgres bool `json:"enabled_feature_postgres"`
OperationalBuffer float64 `json:"operational_buffer"`
OperationalBufferNonNativePct float64 `json:"operational_buffer_non_native_pct"`
SimMode bool `json:"sim_mode"`
LogPrefix string `json:"log_prefix"`
debnil marked this conversation as resolved.
Show resolved Hide resolved
FixedIterations uint64 `json:"fixed_iterations"`
}

// updateProps holds the properties for the update Amplitude event.
Expand Down Expand Up @@ -131,6 +137,7 @@ func MakeMetricsTracker(
goos string,
goarch string,
goarm string,
goVersion string,
guiVersion string,
strategy string,
updateTimeIntervalSeconds int32,
Expand All @@ -150,6 +157,11 @@ func MakeMetricsTracker(
enabledFeatureMonitoring bool,
enabledFeatureFilters bool,
enabledFeaturePostgres bool,
operationalBuffer float64,
operationalBufferNonNativePct float64,
simMode bool,
logPrefix string,
fixedIterations uint64,
) (*MetricsTracker, error) {
props := commonProps{
CliVersion: version,
Expand All @@ -158,6 +170,7 @@ func MakeMetricsTracker(
Goos: goos,
Goarch: goarch,
Goarm: goarm,
GoVersion: goVersion,
GuiVersion: guiVersion,
Strategy: strategy,
UpdateTimeIntervalSeconds: updateTimeIntervalSeconds,
Expand All @@ -176,6 +189,11 @@ func MakeMetricsTracker(
EnabledFeatureMonitoring: enabledFeatureMonitoring,
EnabledFeatureFilters: enabledFeatureFilters,
EnabledFeaturePostgres: enabledFeaturePostgres,
OperationalBuffer: operationalBuffer,
OperationalBufferNonNativePct: operationalBufferNonNativePct,
SimMode: simMode,
LogPrefix: logPrefix,
FixedIterations: fixedIterations,
}

return &MetricsTracker{
Expand Down