From ba6afd5789d129587e6416c13e4c5ee1374568f9 Mon Sep 17 00:00:00 2001 From: fatedier Date: Fri, 19 May 2017 02:59:51 +0800 Subject: [PATCH 1/2] doc: update --- README.md | 2 +- README_zh.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8b4fe71..349ddfd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # frp -[![Build Status](https://travis-ci.org/fatedier/frp.svg)](https://travis-ci.org/fatedier/frp) +[![Build Status](https://travis-ci.org/fatedier/frp.svg?branch=master)](https://travis-ci.org/fatedier/frp) [README](README.md) | [中文文档](README_zh.md) diff --git a/README_zh.md b/README_zh.md index 33c1491..0cedd93 100644 --- a/README_zh.md +++ b/README_zh.md @@ -1,6 +1,6 @@ # frp -[![Build Status](https://travis-ci.org/fatedier/frp.svg)](https://travis-ci.org/fatedier/frp) +[![Build Status](https://travis-ci.org/fatedier/frp.svg?branch=master)](https://travis-ci.org/fatedier/frp) [README](README.md) | [中文文档](README_zh.md) From faf584e1dd7b0013bc81e0393f80b36be1bb2502 Mon Sep 17 00:00:00 2001 From: fatedier Date: Fri, 19 May 2017 18:38:31 +0800 Subject: [PATCH 2/2] metric: fix statistics error --- server/metric.go | 9 +++++++-- server/service.go | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/server/metric.go b/server/metric.go index 5c76e64..569330e 100644 --- a/server/metric.go +++ b/server/metric.go @@ -32,9 +32,14 @@ type ServerStatistics struct { TotalTrafficOut metric.DateCounter CurConns metric.Counter - ClientCounts metric.Counter + // counter for clients + ClientCounts metric.Counter + + // counter for proxy types ProxyTypeCounts map[string]metric.Counter + // statistics for different proxies + // key is proxy name ProxyStatistics map[string]*ProxyStatistics mu sync.Mutex @@ -84,7 +89,7 @@ func StatsNewProxy(name string, proxyType string) { globalStats.ProxyTypeCounts[proxyType] = counter proxyStats, ok := globalStats.ProxyStatistics[name] - if !ok { + if !(ok && proxyStats.ProxyType == proxyType) { proxyStats = &ProxyStatistics{ ProxyType: proxyType, CurConns: metric.NewCounter(), diff --git a/server/service.go b/server/service.go index b9e6cfb..8cd23b6 100644 --- a/server/service.go +++ b/server/service.go @@ -111,6 +111,7 @@ func NewService() (svr *Service, err error) { err = fmt.Errorf("Create dashboard web server error, %v", err) return } + log.Info("Dashboard listen on %s:%d", config.ServerCommonCfg.BindAddr, config.ServerCommonCfg.DashboardPort) } return }