File: snapshotter.go

package info (click to toggle)
golang-github-containerd-nydus-snapshotter 0.13.4-2.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,824 kB
  • sloc: sh: 470; makefile: 129
file content (83 lines) | stat: -rw-r--r-- 1,877 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*
 * Copyright (c) 2022. Nydus Developers. All rights reserved.
 *
 * SPDX-License-Identifier: Apache-2.0
 */

package data

import (
	"github.com/prometheus/client_golang/prometheus"
)

var (
	defaultDurationBuckets = []float64{.5, 1, 5, 10, 50, 100, 150, 200, 250, 300, 350, 400, 600, 1000}
	snapshotEventLabel     = "snapshot_operation"
)

var (
	SnapshotEventElapsedHists = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Name:    "snapshotter_snapshot_operation_elapsed_milliseconds",
			Help:    "The elapsed time for snapshot events.",
			Buckets: defaultDurationBuckets,
		},
		[]string{snapshotEventLabel},
	)

	CacheUsage = prometheus.NewGauge(
		prometheus.GaugeOpts{
			Name: "snapshotter_cache_usage_kilobytes",
			Help: "Disk usage of snapshotter local cache.",
		},
	)

	CPUUsage = prometheus.NewGauge(
		prometheus.GaugeOpts{
			Name: "snapshotter_cpu_usage_percentage",
			Help: "CPU usage percentage of snapshotter.",
		},
	)

	MemoryUsage = prometheus.NewGauge(
		prometheus.GaugeOpts{
			Name: "snapshotter_memory_usage_kilobytes",
			Help: "Memory usage (RSS) of snapshotter.",
		},
	)

	CPUSystem = prometheus.NewGauge(
		prometheus.GaugeOpts{
			Name: "snapshotter_cpu_system_time_seconds",
			Help: "CPU time of snapshotter in system.",
		},
	)

	CPUUser = prometheus.NewGauge(
		prometheus.GaugeOpts{
			Name: "snapshotter_cpu_user_time_seconds",
			Help: "CPU time of snapshotter in user.",
		},
	)

	Fds = prometheus.NewGauge(
		prometheus.GaugeOpts{
			Name: "snapshotter_fd_counts",
			Help: "Fd counts of snapshotter.",
		},
	)

	RunTime = prometheus.NewGauge(
		prometheus.GaugeOpts{
			Name: "snapshotter_run_time_seconds",
			Help: "Running time of snapshotter from starting.",
		},
	)

	Thread = prometheus.NewGauge(
		prometheus.GaugeOpts{
			Name: "snapshotter_thread_counts",
			Help: "Thread counts of snapshotter.",
		},
	)
)