<commit_before>// Copyright 2016 tsuru authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package reverseproxy

import (
	"errors"
	"fmt"
	"io"
	"net"
	"net/http"
	"net/http/httputil"
	"net/url"
	"strconv"
	"strings"
	"sync"
	"sync/atomic"
	"time"

	"github.com/braintree/manners"
	"github.com/nu7hatch/gouuid"
	"github.com/prometheus/client_golang/prometheus"
	"github.com/tsuru/planb/log"
)

var (
	emptyResponseBody   = &fixedReadCloser{}
	noRouteResponseBody = &fixedReadCloser{value: noRouteResponseContent}
	noopDirector        = func(*http.Request) {}

	_ ReverseProxy = &NativeReverseProxy{}

	openConnections = prometheus.NewGauge(prometheus.GaugeOpts{
		Namespace: "planb",
		Subsystem: "reverseproxy",
		Name:      "connections_open",
		Help:      "The current number of open connections.",
	})

	requestDurations = prometheus.NewHistogram(prometheus.HistogramOpts{
		Namespace: "planb",
		Subsystem: "reverseproxy",
		Name:      "request_duration_seconds",
		Help:      "The total request latencies in seconds.",
	})

	backendDurations = prometheus.NewHistogram(prometheus.HistogramOpts{
		Namespace: "planb",
		Subsystem: "reverseproxy",
		Name:      "backend_request_duration_seconds",
		Help:      "The HTTP request latencies in seconds.",
	})<commit_msg>reverseproxy: rework backend_request_duration_seconds help text<commit_after>// Copyright 2016 tsuru authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package reverseproxy

import (
	"errors"
	"fmt"
	"io"
	"net"
	"net/http"
	"net/http/httputil"
	"net/url"
	"strconv"
	"strings"
	"sync"
	"sync/atomic"
	"time"

	"github.com/braintree/manners"
	"github.com/nu7hatch/gouuid"
	"github.com/prometheus/client_golang/prometheus"
	"github.com/tsuru/planb/log"
)

var (
	emptyResponseBody   = &fixedReadCloser{}
	noRouteResponseBody = &fixedReadCloser{value: noRouteResponseContent}
	noopDirector        = func(*http.Request) {}

	_ ReverseProxy = &NativeReverseProxy{}

	openConnections = prometheus.NewGauge(prometheus.GaugeOpts{
		Namespace: "planb",
		Subsystem: "reverseproxy",
		Name:      "connections_open",
		Help:      "The current number of open connections.",
	})

	requestDurations = prometheus.NewHistogram(prometheus.HistogramOpts{
		Namespace: "planb",
		Subsystem: "reverseproxy",
		Name:      "request_duration_seconds",
		Help:      "The total request latencies in seconds.",
	})

	backendDurations = prometheus.NewHistogram(prometheus.HistogramOpts{
		Namespace: "planb",
		Subsystem: "reverseproxy",
		Name:      "backend_request_duration_seconds",
		Help:      "The backends HTTP request latencies in seconds.",
	})
{'fraction_non_alphanumeric': 0.11528731478135164, 'fraction_numerical': 0.003614022406938923, 'mean_word_length': 4.40625, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1167382', 'n_tokens_mistral': 990, 'n_tokens_neox': 923, 'n_words': 207}