diff --git a/utils/fetch.go b/utils/fetch.go index 01a55f1..83b4047 100644 --- a/utils/fetch.go +++ b/utils/fetch.go @@ -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 { @@ -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