Skip to content

Commit

Permalink
feat(inputs.mock): Add sine phase
Browse files Browse the repository at this point in the history
  • Loading branch information
LarsStegman committed Oct 7, 2024
1 parent c27fcca commit 505996d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/inputs/mock/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func (m *Mock) generateRandomFloat64(fields map[string]interface{}) {
// Create sine waves
func (m *Mock) generateSineWave(fields map[string]interface{}) {
for _, field := range m.SineWave {
fields[field.Name] = math.Sin((float64(m.counter)-field.Phase)*field.Period*math.Pi)*field.Amplitude + field.BaseLine
fields[field.Name] = math.Sin(float64(m.counter)*field.Period*math.Pi+field.Phase)*field.Amplitude + field.BaseLine
}
}

Expand Down

0 comments on commit 505996d

Please sign in to comment.