adds abilit to report timing for execution
This commit is contained in:
@ -15,6 +15,8 @@ import (
|
||||
|
||||
// getEnvString returns string from environment variable
|
||||
func getEnvString(env, def string) (val string) { //nolint:deadcode
|
||||
defer timeTrack(time.Now(), "getEnvString")
|
||||
|
||||
val = os.Getenv(env)
|
||||
|
||||
if val == "" {
|
||||
@ -26,6 +28,8 @@ func getEnvString(env, def string) (val string) { //nolint:deadcode
|
||||
|
||||
// getEnvInt returns int from environment variable
|
||||
func getEnvInt(env string, def int) (ret int) {
|
||||
defer timeTrack(time.Now(), "getEnvInt")
|
||||
|
||||
val := os.Getenv(env)
|
||||
|
||||
if val == "" {
|
||||
@ -41,6 +45,8 @@ func getEnvInt(env string, def int) (ret int) {
|
||||
}
|
||||
|
||||
func initialize() {
|
||||
defer timeTrack(time.Now(), "initialize")
|
||||
|
||||
config.TimeZone, _ = time.LoadLocation("America/Chicago")
|
||||
config.TimeZoneUTC, _ = time.LoadLocation("UTC")
|
||||
|
||||
@ -189,6 +195,8 @@ func initialize() {
|
||||
}
|
||||
|
||||
func readConfigFile(configFileLocation string) (configFileStruct, error) {
|
||||
defer timeTrack(time.Now(), "readConfigFile")
|
||||
|
||||
var output configFileStruct
|
||||
|
||||
rd, err := ioutil.ReadFile(configFileLocation)
|
||||
|
Reference in New Issue
Block a user