Skip to content

Commit

Permalink
Add back the system and return to time format
Browse files Browse the repository at this point in the history
  • Loading branch information
vkuznet committed Mar 27, 2021
1 parent 2b92621 commit cc87488
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions utils/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ func FetchResponse(httpClient *http.Client, rurl, args string) ResponseType {
}
}
} else {
log.Printf("DAS GET url=\"%s\" time=%v\n", rurl, time.Now().Sub(startTime).Seconds())
log.Printf("DAS GET system=%s url=\"%s\" time=%v\n", system(rurl), rurl, time.Now().Sub(startTime))
}
} else {
if WEBSERVER == 0 {
Expand All @@ -377,12 +377,34 @@ func FetchResponse(httpClient *http.Client, rurl, args string) ResponseType {
}
}
} else {
log.Printf("DAS POST url=\"%s\" args=\"%v\" time=%v\n", rurl, args, time.Now().Sub(startTime).Seconds())
log.Printf("DAS POST system=%s url=\"%s\" args=\"%v\" time=%v\n", system(rurl), rurl, args, time.Now().Sub(startTime))
}
}
return response
}

// helper function to extract cmsweb system
func system(rurl string) string {
if strings.Contains(rurl, "dbs") {
return "dbs"
} else if strings.Contains(rurl, "rucio") {
return "rucio"
} else if strings.Contains(rurl, "reqmgr") {
return "reqmgr"
} else if strings.Contains(rurl, "mcm") {
return "mcm"
} else if strings.Contains(rurl, "conddb") {
return "conddb"
} else if strings.Contains(rurl, "phedex") {
return "phedex"
} else if strings.Contains(rurl, "runregistry") {
return "runregistry"
} else if strings.Contains(rurl, "dashboard") {
return "dashboard"
}
return "combined"
}

// Fetch data for provided URL and redirect results to given channel
// This wrapper function look-up UrlQueueLimit and either redirect to
// URULFetchWorker go-routine or pass the call to local fetch function
Expand Down

0 comments on commit cc87488

Please sign in to comment.