Sfoglia il codice sorgente

[release] v0.12.0-unstable6

Yann Stepienik 1 anno fa
parent
commit
5e26d6ad90
3 ha cambiato i file con 8 aggiunte e 1 eliminazioni
  1. 1 1
      package.json
  2. 2 0
      src/metrics/index.go
  3. 5 0
      src/metrics/system.go

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "cosmos-server",
-  "version": "0.12.0-unstable5",
+  "version": "0.12.0-unstable6",
   "description": "",
   "main": "test-server.js",
   "bugs": {

+ 2 - 0
src/metrics/index.go

@@ -166,6 +166,8 @@ func Run() {
 			utils.Error("Metrics - Cannot start monitoring the server if you don't mount /mnt/host to /. Check the documentation for more information.", nil)
 			return
 		} else {
+			utils.Log("Metrics - Monitoring the server at /mnt/host")
+
 			os.Setenv("HOST_PROC", "/mnt/host/proc")
 			os.Setenv("HOST_SYS", "/mnt/host/sys")
 			os.Setenv("HOST_ETC", "/mnt/host/etc")

+ 5 - 0
src/metrics/system.go

@@ -53,6 +53,11 @@ func GetSystemMetrics() {
 	
 	// Get Network Usage
 	netIO, err := net.IOCounters(false)
+	
+	netIOTest, _ := net.IOCounters(true)
+	for _, v := range netIOTest {
+		utils.Debug("Metrics - Network", v.Name, v.BytesRecv, v.BytesSent, v.Errin, v.Errout, v.Dropin, v.Dropout)
+	}
 
 	PushSetMetric("system.netRx", int(netIO[0].BytesRecv), DataDef{
 		Max: 0,