From cf103b0e1e41c253411ca905b961bdc184c75e94 Mon Sep 17 00:00:00 2001 From: Fenny <25108519+Fenny@users.noreply.github.com> Date: Tue, 29 Sep 2020 04:03:13 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=88=20fix=20response=20time?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- middleware/monitor/index.go | 118 ++++++++++++++++++---------------- middleware/monitor/index.html | 118 ++++++++++++++++++---------------- middleware/monitor/monitor.go | 2 - 3 files changed, 128 insertions(+), 110 deletions(-) diff --git a/middleware/monitor/index.go b/middleware/monitor/index.go index 8e3162ff..08da5595 100644 --- a/middleware/monitor/index.go +++ b/middleware/monitor/index.go @@ -3,13 +3,16 @@ package monitor var index = []byte(` - - - - - - Fiber Monitor - - + - -
-
-

Fiber Status Monitor

-
- -
-
-
-
CPU Usage
-

0.00%

-
-
- -
+ +
+
+

Fiber Monitor

-
-
-
Memory Usage
-

0.00 MB

+
+
+
+
CPU Usage
+

0.00%

+
+
+ +
-
- -
-
-
-
-
Response Time
-

0ms

+
+
+
Memory Usage
+

0.00 MB

+
+
+ +
-
- -
-
-
-
-
Open Connections
-

0

+
+
+
Response Time
+

0ms

+
+
+ +
-
- + +
+
+
Open Connections
+

0

+
+
+ +
-
+
-
- - + `) diff --git a/middleware/monitor/index.html b/middleware/monitor/index.html index 5cc8a28c..2543d688 100644 --- a/middleware/monitor/index.html +++ b/middleware/monitor/index.html @@ -1,13 +1,16 @@ - - - - - - Fiber Monitor - - + - -
-
-

Fiber Status Monitor

-
- -
-
-
-
CPU Usage
-

0.00%

-
-
- -
+ +
+
+

Fiber Monitor

-
-
-
Memory Usage
-

0.00 MB

+
+
+
+
CPU Usage
+

0.00%

+
+
+ +
-
- -
-
-
-
-
Response Time
-

0ms

+
+
+
Memory Usage
+

0.00 MB

+
+
+ +
-
- -
-
-
-
-
Open Connections
-

0

+
+
+
Response Time
+

0ms

+
+
+ +
-
- + +
+
+
Open Connections
+

0

+
+
+ +
-
+
-
- - + \ No newline at end of file diff --git a/middleware/monitor/monitor.go b/middleware/monitor/monitor.go index a6bf76d5..01b1da17 100644 --- a/middleware/monitor/monitor.go +++ b/middleware/monitor/monitor.go @@ -14,7 +14,6 @@ import ( type stats struct { PID statsPID `json:"pid"` OS statsOS `json:"os"` - Rtime int64 `json:"rtime"` Conns uint32 `json:"conns"` } @@ -76,7 +75,6 @@ func New() fiber.Handler { data.PID.RAM = monitPidRam data.OS.CPU = monitOsCpu data.OS.RAM = monitOsRam - data.Rtime = (time.Now().UnixNano() - c.Context().Time().UnixNano()) / 1000000 data.Conns = c.App().Server().GetCurrentConcurrency() mutex.Unlock() return c.Status(fiber.StatusOK).JSON(data)