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 all commits
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 @@ -579,6 +579,7 @@ func runTradeCmd(options inputs) {
runtime.GOOS,
runtime.GOARCH,
"unknown_todo", // TODO DS Determine how to get GOARM.
runtime.Version(),
guiVersionFlag,
*options.strategy,
botConfig.TickIntervalSeconds,
Expand All @@ -598,6 +599,11 @@ func runTradeCmd(options inputs) {
int(botConfig.MonitoringPort) != 0,
len(botConfig.Filters) > 0,
botConfig.PostgresDbConfig != nil,
*options.logPrefix != "",
*options.operationalBuffer,
*options.operationalBufferNonNativePct,
*options.simMode,
*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"`
EnabledFeatureLogging bool `json:"enabled_feature_logging"`
OperationalBuffer float64 `json:"operational_buffer"`
OperationalBufferNonNativePct float64 `json:"operational_buffer_non_native_pct"`
SimMode bool `json:"sim_mode"`
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,
enabledFeatureLogging bool,
operationalBuffer float64,
operationalBufferNonNativePct float64,
simMode bool,
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,
EnabledFeatureLogging: enabledFeatureLogging,
OperationalBuffer: operationalBuffer,
OperationalBufferNonNativePct: operationalBufferNonNativePct,
SimMode: simMode,
FixedIterations: fixedIterations,
}

return &MetricsTracker{
Expand Down