fn: reorg agent config (#853)

* fn: reorg agent config

*) Moving constants in agent to agent config, which helps
with testing, tuning.
*) Added max total cpu & memory for testing & clamping max
mem & cpu usage if needed.

* fn: adjust PipeIO time
* fn: for hot, cannot reliably test EndOfLogs in TestRouteRunnerExecution
This commit is contained in:
Tolga Ceylan
2018-03-13 18:38:47 -07:00
committed by GitHub
parent 1988d92c83
commit 74a51f3f88
7 changed files with 105 additions and 68 deletions

View File

@@ -615,6 +615,6 @@ const megabyte uint64 = 1024 * 1024
func getAvailableMemoryUnits() uint64 {
// To reuse code - but it's a bit of a hack. TODO: refactor the OS-specific get memory funcs out of that.
throwawayRT := NewResourceTracker().(*resourceTracker)
throwawayRT := NewResourceTracker(nil).(*resourceTracker)
return throwawayRT.ramAsyncTotal / megabyte
}