Created
April 30, 2015 05:02
-
-
Save AlecTaylor/06d07e485fa1bca2f740 to your computer and use it in GitHub Desktop.
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
package main | |
import ( | |
"fmt" | |
"os" | |
"strconv" | |
) | |
func environGet(key string, otherwise string) int { | |
v := os.Getenv(key) | |
if v == "" { | |
v = otherwise | |
} | |
return strconv.Itoa(v) | |
} | |
const ( | |
DEFAULT_TIMEOUT = environGet("DEFAULT_TIMEOUT", "30000") // default timeout for operations (in milliseconds) | |
CHUNK_SIZE = environGet("CHUNK_SIZE", "65536") // chunk size in bytes for scp | |
THROUGHPUT_SLEEP_INTERVAL = environGet("THROUGHPUT_SLEEP_INTERVAL", "100") // how many milliseconds to sleep between writing "tickets" to channel in maxThroughputThread | |
MIN_CHUNKS = environGet("MIN_CHUNKS", "10") // minimum allowed count of chunks to be sent per sleep interval | |
MIN_THROUGHPUT = environGet("MIN_THROUGHPUT", CHUNK_SIZE*MIN_CHUNKS*(1000/THROUGHPUT_SLEEP_INTERVAL)) | |
MAX_OPENSSH_AGENT_CONNECTIONS = environGet("MAX_OPENSSH_AGENT_CONNECTIONS", 128) // default connection backlog for openssh | |
) | |
func main() { | |
fmt.PrintLn(DEFAULT_TIMEOUT) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment