Documentation ¶
Overview ¶
Package stats collects statistics of HTTP requests.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSection ¶
GetSection returns the "section", which is defined as the host and up to the first part of the path before the second /.
Example ¶
package main import ( "fmt" "net/url" "github.com/raypereda/wiredog/pkg/stats" ) func main() { urls := []string{ "http://datadog.com", "http://datadog.com/", "http://datadog.com/section/", "http://datadog.com/section/misc", } for _, u := range urls { url, _ := url.Parse(u) section := stats.GetSection(url) fmt.Println(u, "==>", section) } }
Output: http://datadog.com ==> datadog.com http://datadog.com/ ==> datadog.com http://datadog.com/section/ ==> datadog.com/section http://datadog.com/section/misc ==> datadog.com/section
Types ¶
type Metrics ¶
Metrics stores HTTP metrics for a stream of requests.
func (*Metrics) GetTopSections ¶
GetTopSections returns the top 10 sections
Click to show internal directories.
Click to hide internal directories.