|
|
@@ -89,6 +89,7 @@ func (s speed) MarshalJSON() ([]byte, error) {
|
|
89
|
89
|
return json.Marshal(value)
|
|
90
|
90
|
}
|
|
91
|
91
|
|
|
|
92
|
+// Stats represents a statistics of the proxy.
|
|
92
|
93
|
type Stats struct {
|
|
93
|
94
|
URLs config.IPURLs `json:"urls"`
|
|
94
|
95
|
Connections connections `json:"connections"`
|
|
|
@@ -165,6 +166,7 @@ func (s *Stats) handleCrash() {
|
|
165
|
166
|
s.Crashes++
|
|
166
|
167
|
}
|
|
167
|
168
|
|
|
|
169
|
+// NewStats creates a new instance of Stats structure.
|
|
168
|
170
|
func NewStats(conf *config.Config) *Stats {
|
|
169
|
171
|
return &Stats{
|
|
170
|
172
|
URLs: conf.GetURLs(),
|