forked from influxdata/telegraf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for SIGUSR1 to trigger flush (influxdata#7366)
- Loading branch information
Showing
9 changed files
with
218 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// +build !windows | ||
|
||
package agent | ||
|
||
import ( | ||
"os" | ||
"os/signal" | ||
"syscall" | ||
) | ||
|
||
const flushSignal = syscall.SIGUSR1 | ||
|
||
func watchForFlushSignal(flushRequested chan os.Signal) { | ||
signal.Notify(flushRequested, flushSignal) | ||
defer signal.Stop(flushRequested) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// +build windows | ||
|
||
package agent | ||
|
||
import "os" | ||
|
||
func watchForFlushSignal(flushRequested chan os.Signal) { | ||
// not implemented | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// +build !windows | ||
|
||
package main | ||
|
||
func run(inputFilters, outputFilters, aggregatorFilters, processorFilters []string) { | ||
stop = make(chan struct{}) | ||
reloadLoop( | ||
inputFilters, | ||
outputFilters, | ||
aggregatorFilters, | ||
processorFilters, | ||
) | ||
} |
Oops, something went wrong.