Clean up log message 15/205115/1
authorjw_wonny.cha <jw_wonny.cha@samsung.com>
Mon, 29 Apr 2019 08:22:15 +0000 (17:22 +0900)
committerjw_wonny.cha <jw_wonny.cha@samsung.com>
Mon, 29 Apr 2019 08:22:35 +0000 (17:22 +0900)
Change-Id: I83798579208aae632f38728710397b447220ed71
Signed-off-by: jw_wonny.cha <jw_wonny.cha@samsung.com>
src/discoverymgr/discovery_init.go
src/scoringmgr/handlers.go
src/scoringmgr/lib_scoring_interface.go
src/scoringmgr/mock/myscoring/myscoring.c

index f09cfb4..36eeeee 100755 (executable)
@@ -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
                        }
index 5d23459..a47aeeb 100755 (executable)
@@ -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
        }
index 37e9631..c126581 100755 (executable)
@@ -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)
 
index e4eedd3..0273fb9 100644 (file)
@@ -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;