adds abilit to report timing for execution

This commit is contained in:
2022-03-21 16:58:05 -05:00
parent cfc719dae3
commit ff9cc1349f
7 changed files with 35 additions and 0 deletions

View File

@ -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)