From ed7ae701d584b7c4063d2151ee12df6b0aff6a8f Mon Sep 17 00:00:00 2001 From: "jw_wonny.cha" Date: Mon, 29 Apr 2019 17:22:15 +0900 Subject: [PATCH] Clean up log message Change-Id: I83798579208aae632f38728710397b447220ed71 Signed-off-by: jw_wonny.cha --- src/discoverymgr/discovery_init.go | 4 ++-- src/scoringmgr/handlers.go | 5 ++--- src/scoringmgr/lib_scoring_interface.go | 3 +-- src/scoringmgr/mock/myscoring/myscoring.c | 27 +++++++++++++++------------ 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/discoverymgr/discovery_init.go b/src/discoverymgr/discovery_init.go index f09cfb4..36eeeee 100755 --- a/src/discoverymgr/discovery_init.go +++ b/src/discoverymgr/discovery_init.go @@ -39,7 +39,7 @@ func InitDiscovery() (err error) { //NOTE : Need to gPollingError Because it can call not initialized. _, gPollingError = common.GetOutboundIP() - log.Println("poilling Errrrrrrrrrrror ", gPollingError) + log.Println("poilling Error : ", gPollingError) go func() { @@ -164,7 +164,7 @@ func pollGettingOutBoundIP() (string, error) { select { case <-ticker.C: ip, gPollingError = common.GetOutboundIP() - log.Println("pollGettingOutBoundIP : ", gPollingError) + // log.Println("pollGettingOutBoundIP : ", gPollingError) if len(ip) != 0 { return ip, gPollingError } diff --git a/src/scoringmgr/handlers.go b/src/scoringmgr/handlers.go index 5d23459..a47aeeb 100755 --- a/src/scoringmgr/handlers.go +++ b/src/scoringmgr/handlers.go @@ -24,7 +24,6 @@ package scoringmgr */ import "C" import ( - "fmt" "log" "time" "unsafe" @@ -180,7 +179,7 @@ func (handler *Handler) runScoring() { default: handler.statusSignal <- constLibStatusRun time.Sleep(time.Duration(1000) * time.Millisecond) - fmt.Printf("[scoringmgr] status run sleep time : %d\n", handler.intervalMs) + // fmt.Printf("[scoringmgr] status run sleep time : %d\n", handler.intervalMs) } } @@ -198,7 +197,7 @@ func (handler *Handler) process(status int) { handler.init() break case constLibStatusRun: - fmt.Printf("[scoringmgr] run\n") + // fmt.Printf("[scoringmgr] run\n") handler.running() break } diff --git a/src/scoringmgr/lib_scoring_interface.go b/src/scoringmgr/lib_scoring_interface.go index 37e9631..c126581 100755 --- a/src/scoringmgr/lib_scoring_interface.go +++ b/src/scoringmgr/lib_scoring_interface.go @@ -22,7 +22,6 @@ package scoringmgr */ import "C" import ( - "fmt" "unsafe" ) @@ -30,7 +29,7 @@ import ( func LoadScoringGeneralInterface(symbol uintptr) float64 { ret := C.wrap_myscoring(unsafe.Pointer(symbol)) - fmt.Println("[scoringmgr]", ret) + // fmt.Println("[scoringmgr]", ret) return float64(ret) diff --git a/src/scoringmgr/mock/myscoring/myscoring.c b/src/scoringmgr/mock/myscoring/myscoring.c index e4eedd3..0273fb9 100644 --- a/src/scoringmgr/mock/myscoring/myscoring.c +++ b/src/scoringmgr/mock/myscoring/myscoring.c @@ -17,31 +17,34 @@ features : */ //network score mmDiscovery/service_provider.cpp -static double networkScore(double n) { +static double networkScore(double n) +{ return 1 / (8770 * pow(n, -0.9)); } //cpu score mmDiscovery/service_provider.cpp -static double cpuScore(double freq, double usage, double count){ - return ((1 / (5.66 * pow(freq, -0.66))) + +static double cpuScore(double freq, double usage, double count) +{ + return ((1 / (5.66 * pow(freq, -0.66))) + (1 / (3.22 * pow(usage, -0.241))) + - (1 / (4 * pow(count, -0.3)))) / 3; + (1 / (4 * pow(count, -0.3)))) / + 3; } //render score mmDiscovery/service_provider.cpp //https://github.com/Samsung/Castanets/blob/castanets_63/service_discovery_manager/Component/mmDiscovery/monitor_client.cpp -static double renderingScore(double r) { +static double renderingScore(double r) +{ return (r < 0) ? 0 : 0.77 * pow(r, -0.43); } //============== INTERFACE API ============== double myscoring(double (*getResource)(const char *)) { - + printf("myscoring\n"); double score; - - + score = 0.0; score += networkScore(getResource("network/bandwidth")); score += cpuScore(getResource("cpu/freq"), getResource("cpu/usage"), getResource("cpu/count")); @@ -60,7 +63,7 @@ double myscoring2(double (*getResource)(const char *)) double score; const char *resourceNames[CNT] = {"cpu/usage", "cpu/count", "memory/free", "memory/available", "network/mbps", "network/bandwidth"}; - double W[CNT] = {1.48271, 4.125421, 5.3381723, 9.194717234, 2.323, 1.123}; + double W[CNT] = {1.48271, 4.125421, 5.3381723, 9.194717234, 2.323, 1.123}; double resourceValues[CNT]; // double someResource; @@ -86,11 +89,11 @@ double myscoring2(double (*getResource)(const char *)) double myscoring3(double (*getResource)(const char *)) { - printf("myscoring\n"); + // printf("myscoring\n"); double score; const char *resourceNames[MY_SCORING_3_CNT] = {"cpu/usage", "cpu/count", "memory/free", "memory/available"}; - double W[MY_SCORING_3_CNT] = {1.48271, 4.125421, 5.3381723, 9.194717234}; + double W[MY_SCORING_3_CNT] = {1.48271, 4.125421, 5.3381723, 9.194717234}; double resourceValues[MY_SCORING_3_CNT]; // double someResource; @@ -100,7 +103,7 @@ double myscoring3(double (*getResource)(const char *)) for (int i = 0; i < MY_SCORING_3_CNT; i++) { resourceValues[i] = getResource(resourceNames[i]); - printf("resourceNames : %s %f\n", resourceNames[i], resourceValues[i]); + // printf("resourceNames : %s %f\n", resourceNames[i], resourceValues[i]); } score = 0.0; -- 2.7.4