|
@@ -96,16 +96,16 @@ func customScoreInfluxDB(metrics []string, uuid string, socket,
|
|
|
// build the coommand
|
|
|
var command strings.Builder
|
|
|
fmt.Fprintf(&command, "SELECT %s from socket_metrics where uuid = '%s' and socket_id='%d' order by time desc limit %d", columns, uuid, socket, numberOfRows)
|
|
|
- klog.Infof("%s", command.String())
|
|
|
+ //klog.Infof("%s", command.String())
|
|
|
//q := client.NewQuery("select ipc from system_metrics", "evolve", "")
|
|
|
- q := client.NewQuery(command.String(), "evolve", "")
|
|
|
+ q := client.NewQuery(command.String(), cfg.Database.Name, "")
|
|
|
response, err := c.Query(q)
|
|
|
if err != nil {
|
|
|
klog.Infof("Error while executing the query: %v", err.Error())
|
|
|
return nil, err
|
|
|
}
|
|
|
- klog.Infof("Response: %v, UUID: %v, socket: %v", response, uuid, socket)
|
|
|
- klog.Infof("noop")
|
|
|
+ //klog.Infof("Response: %v, UUID: %v, socket: %v", response, uuid, socket)
|
|
|
+ //klog.Infof("noop")
|
|
|
// Calculate the average for the metrics provided
|
|
|
return calculateWeightedAverage(response, numberOfRows, len(metrics))
|
|
|
}
|