Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
c491d94a
Commit
c491d94a
authored
Sep 14, 2015
by
Tamer Tas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve documentation for client/metrics pkg
parent
50d80511
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
metrics.go
pkg/client/metrics/metrics.go
+6
-2
No files found.
pkg/client/metrics/metrics.go
View file @
c491d94a
...
...
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Package metrics provides utilities for registering client metrics to Prometheus.
package
metrics
import
(
...
...
@@ -26,6 +27,8 @@ import (
const
restClientSubsystem
=
"rest_client"
var
(
// RequestLatency is a Prometheus Summary metric type partitioned by
// "verb" and "url" labels. It is used for the rest client latency metrics.
RequestLatency
=
prometheus
.
NewSummaryVec
(
prometheus
.
SummaryOpts
{
Subsystem
:
restClientSubsystem
,
...
...
@@ -39,7 +42,8 @@ var (
var
registerMetrics
sync
.
Once
// Register all metrics.
// Register registers all metrics to Prometheus with
// respect to the RequestLatency.
func
Register
()
{
// Register the metrics.
registerMetrics
.
Do
(
func
()
{
...
...
@@ -47,7 +51,7 @@ func Register() {
})
}
//
Get
s the time since the specified start in microseconds.
//
Calculate
s the time since the specified start in microseconds.
func
SinceInMicroseconds
(
start
time
.
Time
)
float64
{
return
float64
(
time
.
Since
(
start
)
.
Nanoseconds
()
/
time
.
Microsecond
.
Nanoseconds
())
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment