Skip to content

Commit 5ca9461

Browse files
authored
Merge pull request #234 from DIMO-Network/feature/modify_segment_defaults
Updating defaults
2 parents cc62162 + 1621481 commit 5ca9461

7 files changed

Lines changed: 17 additions & 17 deletions

File tree

internal/graph/generated.go

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/graph/model/models_gen.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/repositories/segments.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ func validateSegmentConfig(config *model.SegmentConfig) error {
5252
}
5353

5454
if config.MinSegmentDurationSeconds != nil {
55-
if *config.MinSegmentDurationSeconds < 1 || *config.MinSegmentDurationSeconds > 3600 {
56-
return fmt.Errorf("minSegmentDurationSeconds must be between 1 and 3600")
55+
if *config.MinSegmentDurationSeconds < 60 || *config.MinSegmentDurationSeconds > 3600 {
56+
return fmt.Errorf("minSegmentDurationSeconds must be between 60 and 3600")
5757
}
5858
}
5959

6060
if config.SignalCountThreshold != nil {
61-
if *config.SignalCountThreshold < 3 || *config.SignalCountThreshold > 100 {
62-
return fmt.Errorf("signalCountThreshold must be between 3 and 100")
61+
if *config.SignalCountThreshold < 1 || *config.SignalCountThreshold > 3600 {
62+
return fmt.Errorf("signalCountThreshold must be between 1 and 3600")
6363
}
6464
}
6565

internal/service/ch/changepoint_detector.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const (
1414
defaultCUSUMThreshold = 5.0 // CUSUM threshold for detecting change points
1515
defaultCUSUMDrift = 0.5 // Drift parameter (half of expected change magnitude)
1616
defaultCUSUMBaselineSignalCount = 1.0 // Baseline signal count per window when idle
17-
defaultCUSUMSignalCountThreshold = 12 // Minimum signals per window for activity
17+
defaultCUSUMSignalCountThreshold = 10 // Minimum signals per window for activity
1818
defaultCUSUMDistinctSignalCountThreshold = 2 // Minimum distinct signal types per window
1919
)
2020

internal/service/ch/frequency_detector.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111

1212
const (
1313
defaultWindowSizeSeconds = 60 // 1 minute windows
14-
defaultSignalCountThreshold = 12 // Minimum signals per window for activity
14+
defaultSignalCountThreshold = 10 // Minimum signals per window for activity
1515
defaultDistinctSignalCountThreshold = 2 // Minimum distinct signal types per window
1616
)
1717

internal/service/ch/ignition_detector.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010
)
1111

1212
const (
13-
defaultMinIdleSeconds = 600 // 5 minutes
14-
defaultMinSegmentDurationSeconds = 150 // 5 minutes
13+
defaultMinIdleSeconds = 300 // 5 minutes
14+
defaultMinSegmentDurationSeconds = 240 // 4 minutes
1515
)
1616

1717
// IgnitionDetector detects segments using ignition state transitions

schema/segments.graphqls

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,16 @@ input SegmentConfig {
5555
"""
5656
Minimum segment duration (seconds) to include in results.
5757
Filters very short segments (testing, engine cycling).
58-
Default: 60 (1 minute), Min: 1, Max: 3600
58+
Default: 240 (4 minutes), Min: 60, Max: 3600
5959
"""
60-
minSegmentDurationSeconds: Int = 60
60+
minSegmentDurationSeconds: Int = 240
6161

6262
"""
6363
[frequencyAnalysis only] Minimum signal count per window for activity detection.
6464
Higher values = more conservative (filters parked telemetry better).
6565
Lower values = more sensitive (works for sparse signal vehicles).
6666
Default: 10 (tuned to match ignition detection accuracy)
67-
Min: 3, Max: 100
67+
Min: 1, Max: 3600
6868
"""
6969
signalCountThreshold: Int = 10
7070
}

0 commit comments

Comments
 (0)