File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,9 @@ type Sysstat struct {
3333 // Sadc represents the path to the sadc collector utility.
3434 Sadc string `toml:"sadc_path"`
3535
36+ // Force the execution time of sadc
37+ SadcInterval internal.Duration `toml:"sadc_interval"`
38+
3639 // Sadf represents the path to the sadf cmd.
3740 Sadf string `toml:"sadf_path"`
3841
@@ -136,6 +139,11 @@ func (*Sysstat) SampleConfig() string {
136139}
137140
138141func (s * Sysstat ) Gather (acc telegraf.Accumulator ) error {
142+ if s .SadcInterval .Duration != 0 {
143+ // Collect interval is calculated as interval - parseInterval
144+ s .interval = int (s .SadcInterval .Duration .Seconds ()) + parseInterval
145+ }
146+
139147 if s .interval == 0 {
140148 if firstTimestamp .IsZero () {
141149 firstTimestamp = time .Now ()
You can’t perform that action at this time.
0 commit comments