| 
									
										
										
										
											2017-01-24 04:26:24 -08:00
										 |  |  | // Copyright 2017 The Prometheus Authors
 | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | // Licensed under the Apache License, Version 2.0 (the "License");
 | 
					
						
							|  |  |  | // you may not use this file except in compliance with the License.
 | 
					
						
							|  |  |  | // You may obtain a copy of the License at
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // http://www.apache.org/licenses/LICENSE-2.0
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // Unless required by applicable law or agreed to in writing, software
 | 
					
						
							|  |  |  | // distributed under the License is distributed on an "AS IS" BASIS,
 | 
					
						
							|  |  |  | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
					
						
							|  |  |  | // See the License for the specific language governing permissions and
 | 
					
						
							|  |  |  | // limitations under the License.
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-03 04:35:24 -07:00
										 |  |  | //go:build !nomountstats
 | 
					
						
							| 
									
										
										
										
											2020-06-12 01:26:30 -07:00
										 |  |  | // +build !nomountstats
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | package collector | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | import ( | 
					
						
							|  |  |  | 	"fmt" | 
					
						
							| 
									
										
										
										
											2024-09-11 01:51:28 -07:00
										 |  |  | 	"log/slog" | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	"github.com/prometheus/client_golang/prometheus" | 
					
						
							|  |  |  | 	"github.com/prometheus/procfs" | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-31 09:30:37 -07:00
										 |  |  | var ( | 
					
						
							|  |  |  | 	// 64-bit float mantissa: https://en.wikipedia.org/wiki/Double-precision_floating-point_format
 | 
					
						
							|  |  |  | 	float64Mantissa uint64 = 9007199254740992 | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | type mountStatsCollector struct { | 
					
						
							|  |  |  | 	// General statistics
 | 
					
						
							|  |  |  | 	NFSAgeSecondsTotal *prometheus.Desc | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Byte statistics
 | 
					
						
							|  |  |  | 	NFSReadBytesTotal        *prometheus.Desc | 
					
						
							|  |  |  | 	NFSWriteBytesTotal       *prometheus.Desc | 
					
						
							|  |  |  | 	NFSDirectReadBytesTotal  *prometheus.Desc | 
					
						
							|  |  |  | 	NFSDirectWriteBytesTotal *prometheus.Desc | 
					
						
							|  |  |  | 	NFSTotalReadBytesTotal   *prometheus.Desc | 
					
						
							|  |  |  | 	NFSTotalWriteBytesTotal  *prometheus.Desc | 
					
						
							|  |  |  | 	NFSReadPagesTotal        *prometheus.Desc | 
					
						
							|  |  |  | 	NFSWritePagesTotal       *prometheus.Desc | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Per-operation statistics
 | 
					
						
							|  |  |  | 	NFSOperationsRequestsTotal            *prometheus.Desc | 
					
						
							|  |  |  | 	NFSOperationsTransmissionsTotal       *prometheus.Desc | 
					
						
							|  |  |  | 	NFSOperationsMajorTimeoutsTotal       *prometheus.Desc | 
					
						
							|  |  |  | 	NFSOperationsSentBytesTotal           *prometheus.Desc | 
					
						
							|  |  |  | 	NFSOperationsReceivedBytesTotal       *prometheus.Desc | 
					
						
							|  |  |  | 	NFSOperationsQueueTimeSecondsTotal    *prometheus.Desc | 
					
						
							|  |  |  | 	NFSOperationsResponseTimeSecondsTotal *prometheus.Desc | 
					
						
							|  |  |  | 	NFSOperationsRequestTimeSecondsTotal  *prometheus.Desc | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Transport statistics
 | 
					
						
							|  |  |  | 	NFSTransportBindTotal              *prometheus.Desc | 
					
						
							|  |  |  | 	NFSTransportConnectTotal           *prometheus.Desc | 
					
						
							|  |  |  | 	NFSTransportIdleTimeSeconds        *prometheus.Desc | 
					
						
							|  |  |  | 	NFSTransportSendsTotal             *prometheus.Desc | 
					
						
							|  |  |  | 	NFSTransportReceivesTotal          *prometheus.Desc | 
					
						
							|  |  |  | 	NFSTransportBadTransactionIDsTotal *prometheus.Desc | 
					
						
							|  |  |  | 	NFSTransportBacklogQueueTotal      *prometheus.Desc | 
					
						
							|  |  |  | 	NFSTransportMaximumRPCSlots        *prometheus.Desc | 
					
						
							|  |  |  | 	NFSTransportSendingQueueTotal      *prometheus.Desc | 
					
						
							|  |  |  | 	NFSTransportPendingQueueTotal      *prometheus.Desc | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 	// Event statistics
 | 
					
						
							|  |  |  | 	NFSEventInodeRevalidateTotal     *prometheus.Desc | 
					
						
							|  |  |  | 	NFSEventDnodeRevalidateTotal     *prometheus.Desc | 
					
						
							|  |  |  | 	NFSEventDataInvalidateTotal      *prometheus.Desc | 
					
						
							|  |  |  | 	NFSEventAttributeInvalidateTotal *prometheus.Desc | 
					
						
							|  |  |  | 	NFSEventVFSOpenTotal             *prometheus.Desc | 
					
						
							|  |  |  | 	NFSEventVFSLookupTotal           *prometheus.Desc | 
					
						
							|  |  |  | 	NFSEventVFSAccessTotal           *prometheus.Desc | 
					
						
							|  |  |  | 	NFSEventVFSUpdatePageTotal       *prometheus.Desc | 
					
						
							|  |  |  | 	NFSEventVFSReadPageTotal         *prometheus.Desc | 
					
						
							|  |  |  | 	NFSEventVFSReadPagesTotal        *prometheus.Desc | 
					
						
							|  |  |  | 	NFSEventVFSWritePageTotal        *prometheus.Desc | 
					
						
							|  |  |  | 	NFSEventVFSWritePagesTotal       *prometheus.Desc | 
					
						
							|  |  |  | 	NFSEventVFSGetdentsTotal         *prometheus.Desc | 
					
						
							|  |  |  | 	NFSEventVFSSetattrTotal          *prometheus.Desc | 
					
						
							|  |  |  | 	NFSEventVFSFlushTotal            *prometheus.Desc | 
					
						
							|  |  |  | 	NFSEventVFSFsyncTotal            *prometheus.Desc | 
					
						
							|  |  |  | 	NFSEventVFSLockTotal             *prometheus.Desc | 
					
						
							|  |  |  | 	NFSEventVFSFileReleaseTotal      *prometheus.Desc | 
					
						
							|  |  |  | 	NFSEventTruncationTotal          *prometheus.Desc | 
					
						
							|  |  |  | 	NFSEventWriteExtensionTotal      *prometheus.Desc | 
					
						
							|  |  |  | 	NFSEventSillyRenameTotal         *prometheus.Desc | 
					
						
							|  |  |  | 	NFSEventShortReadTotal           *prometheus.Desc | 
					
						
							|  |  |  | 	NFSEventShortWriteTotal          *prometheus.Desc | 
					
						
							|  |  |  | 	NFSEventJukeboxDelayTotal        *prometheus.Desc | 
					
						
							|  |  |  | 	NFSEventPNFSReadTotal            *prometheus.Desc | 
					
						
							|  |  |  | 	NFSEventPNFSWriteTotal           *prometheus.Desc | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 	proc procfs.Proc | 
					
						
							| 
									
										
										
										
											2019-12-31 08:19:37 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-09-11 01:51:28 -07:00
										 |  |  | 	logger *slog.Logger | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-23 15:47:12 -07:00
										 |  |  | // used to uniquely identify an NFS mount to prevent duplicates
 | 
					
						
							|  |  |  | type nfsDeviceIdentifier struct { | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 	Device       string | 
					
						
							|  |  |  | 	Protocol     string | 
					
						
							|  |  |  | 	MountAddress string | 
					
						
							| 
									
										
										
										
											2018-07-23 15:47:12 -07:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | func init() { | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 	registerCollector("mountstats", defaultDisabled, NewMountStatsCollector) | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-28 08:44:53 -08:00
										 |  |  | // NewMountStatsCollector returns a new Collector exposing NFS statistics.
 | 
					
						
							| 
									
										
										
										
											2024-09-11 01:51:28 -07:00
										 |  |  | func NewMountStatsCollector(logger *slog.Logger) (Collector, error) { | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 	fs, err := procfs.NewFS(*procPath) | 
					
						
							|  |  |  | 	if err != nil { | 
					
						
							| 
									
										
										
										
											2019-11-29 05:51:31 -08:00
										 |  |  | 		return nil, fmt.Errorf("failed to open procfs: %w", err) | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	proc, err := fs.Self() | 
					
						
							|  |  |  | 	if err != nil { | 
					
						
							| 
									
										
										
										
											2019-11-29 05:51:31 -08:00
										 |  |  | 		return nil, fmt.Errorf("failed to open /proc/self: %w", err) | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	const ( | 
					
						
							| 
									
										
										
										
											2017-02-28 08:44:53 -08:00
										 |  |  | 		// For the time being, only NFS statistics are available via this mechanism.
 | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 		subsystem = "mountstats_nfs" | 
					
						
							|  |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	var ( | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 		labels   = []string{"export", "protocol", "mountaddr"} | 
					
						
							|  |  |  | 		opLabels = []string{"export", "protocol", "mountaddr", "operation"} | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	return &mountStatsCollector{ | 
					
						
							|  |  |  | 		NFSAgeSecondsTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "age_seconds_total"), | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 			"The age of the NFS mount in seconds.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSReadBytesTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "read_bytes_total"), | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 			"Number of bytes read using the read() syscall.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSWriteBytesTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "write_bytes_total"), | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 			"Number of bytes written using the write() syscall.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSDirectReadBytesTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "direct_read_bytes_total"), | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 			"Number of bytes read using the read() syscall in O_DIRECT mode.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSDirectWriteBytesTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "direct_write_bytes_total"), | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 			"Number of bytes written using the write() syscall in O_DIRECT mode.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSTotalReadBytesTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "total_read_bytes_total"), | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 			"Number of bytes read from the NFS server, in total.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSTotalWriteBytesTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "total_write_bytes_total"), | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 			"Number of bytes written to the NFS server, in total.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSReadPagesTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "read_pages_total"), | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 			"Number of pages read directly via mmap()'d files.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSWritePagesTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "write_pages_total"), | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 			"Number of pages written directly via mmap()'d files.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSTransportBindTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "transport_bind_total"), | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 			"Number of times the client has had to establish a connection from scratch to the NFS server.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSTransportConnectTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "transport_connect_total"), | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 			"Number of times the client has made a TCP connection to the NFS server.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSTransportIdleTimeSeconds: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "transport_idle_time_seconds"), | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 			"Duration since the NFS mount last saw any RPC traffic, in seconds.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSTransportSendsTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "transport_sends_total"), | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 			"Number of RPC requests for this mount sent to the NFS server.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSTransportReceivesTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "transport_receives_total"), | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 			"Number of RPC responses for this mount received from the NFS server.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSTransportBadTransactionIDsTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "transport_bad_transaction_ids_total"), | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 			"Number of times the NFS server sent a response with a transaction ID unknown to this client.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSTransportBacklogQueueTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "transport_backlog_queue_total"), | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 			"Total number of items added to the RPC backlog queue.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSTransportMaximumRPCSlots: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "transport_maximum_rpc_slots"), | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 			"Maximum number of simultaneously active RPC requests ever used.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSTransportSendingQueueTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "transport_sending_queue_total"), | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 			"Total number of items added to the RPC transmission sending queue.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSTransportPendingQueueTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "transport_pending_queue_total"), | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 			"Total number of items added to the RPC transmission pending queue.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSOperationsRequestsTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "operations_requests_total"), | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 			"Number of requests performed for a given operation.", | 
					
						
							|  |  |  | 			opLabels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSOperationsTransmissionsTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "operations_transmissions_total"), | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 			"Number of times an actual RPC request has been transmitted for a given operation.", | 
					
						
							|  |  |  | 			opLabels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSOperationsMajorTimeoutsTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "operations_major_timeouts_total"), | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 			"Number of times a request has had a major timeout for a given operation.", | 
					
						
							|  |  |  | 			opLabels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSOperationsSentBytesTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "operations_sent_bytes_total"), | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 			"Number of bytes sent for a given operation, including RPC headers and payload.", | 
					
						
							|  |  |  | 			opLabels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSOperationsReceivedBytesTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "operations_received_bytes_total"), | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 			"Number of bytes received for a given operation, including RPC headers and payload.", | 
					
						
							|  |  |  | 			opLabels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSOperationsQueueTimeSecondsTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "operations_queue_time_seconds_total"), | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 			"Duration all requests spent queued for transmission for a given operation before they were sent, in seconds.", | 
					
						
							|  |  |  | 			opLabels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSOperationsResponseTimeSecondsTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "operations_response_time_seconds_total"), | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 			"Duration all requests took to get a reply back after a request for a given operation was transmitted, in seconds.", | 
					
						
							|  |  |  | 			opLabels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSOperationsRequestTimeSecondsTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "operations_request_time_seconds_total"), | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 			"Duration all requests took from when a request was enqueued to when it was completely handled for a given operation, in seconds.", | 
					
						
							|  |  |  | 			opLabels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 		NFSEventInodeRevalidateTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "event_inode_revalidate_total"), | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 			"Number of times cached inode attributes are re-validated from the server.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSEventDnodeRevalidateTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "event_dnode_revalidate_total"), | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 			"Number of times cached dentry nodes are re-validated from the server.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSEventDataInvalidateTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "event_data_invalidate_total"), | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 			"Number of times an inode cache is cleared.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSEventAttributeInvalidateTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "event_attribute_invalidate_total"), | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 			"Number of times cached inode attributes are invalidated.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSEventVFSOpenTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "event_vfs_open_total"), | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 			"Number of times cached inode attributes are invalidated.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSEventVFSLookupTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "event_vfs_lookup_total"), | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 			"Number of times a directory lookup has occurred.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSEventVFSAccessTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "event_vfs_access_total"), | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 			"Number of times permissions have been checked.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSEventVFSUpdatePageTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "event_vfs_update_page_total"), | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 			"Number of updates (and potential writes) to pages.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSEventVFSReadPageTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "event_vfs_read_page_total"), | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 			"Number of pages read directly via mmap()'d files.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSEventVFSReadPagesTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "event_vfs_read_pages_total"), | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 			"Number of times a group of pages have been read.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSEventVFSWritePageTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "event_vfs_write_page_total"), | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 			"Number of pages written directly via mmap()'d files.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSEventVFSWritePagesTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "event_vfs_write_pages_total"), | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 			"Number of times a group of pages have been written.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSEventVFSGetdentsTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "event_vfs_getdents_total"), | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 			"Number of times directory entries have been read with getdents().", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSEventVFSSetattrTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "event_vfs_setattr_total"), | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 			"Number of times directory entries have been read with getdents().", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSEventVFSFlushTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "event_vfs_flush_total"), | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 			"Number of pending writes that have been forcefully flushed to the server.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSEventVFSFsyncTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "event_vfs_fsync_total"), | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 			"Number of times fsync() has been called on directories and files.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSEventVFSLockTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "event_vfs_lock_total"), | 
					
						
							| 
									
										
										
										
											2017-02-28 09:50:45 -08:00
										 |  |  | 			"Number of times locking has been attempted on a file.", | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSEventVFSFileReleaseTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "event_vfs_file_release_total"), | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 			"Number of times files have been closed and released.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSEventTruncationTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "event_truncation_total"), | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 			"Number of times files have been truncated.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSEventWriteExtensionTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "event_write_extension_total"), | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 			"Number of times a file has been grown due to writes beyond its existing end.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSEventSillyRenameTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "event_silly_rename_total"), | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 			"Number of times a file was removed while still open by another process.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSEventShortReadTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "event_short_read_total"), | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 			"Number of times the NFS server gave less data than expected while reading.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSEventShortWriteTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "event_short_write_total"), | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 			"Number of times the NFS server wrote less data than expected while writing.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSEventJukeboxDelayTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "event_jukebox_delay_total"), | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 			"Number of times the NFS server indicated EJUKEBOX; retrieving data from offline storage.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSEventPNFSReadTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "event_pnfs_read_total"), | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 			"Number of NFS v4.1+ pNFS reads.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		NFSEventPNFSWriteTotal: prometheus.NewDesc( | 
					
						
							| 
									
										
										
										
											2017-09-28 06:06:26 -07:00
										 |  |  | 			prometheus.BuildFQName(namespace, subsystem, "event_pnfs_write_total"), | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 			"Number of NFS v4.1+ pNFS writes.", | 
					
						
							|  |  |  | 			labels, | 
					
						
							|  |  |  | 			nil, | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-31 08:19:37 -08:00
										 |  |  | 		proc:   proc, | 
					
						
							|  |  |  | 		logger: logger, | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 	}, nil | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | func (c *mountStatsCollector) Update(ch chan<- prometheus.Metric) error { | 
					
						
							|  |  |  | 	mounts, err := c.proc.MountStats() | 
					
						
							|  |  |  | 	if err != nil { | 
					
						
							| 
									
										
										
										
											2019-11-29 05:51:31 -08:00
										 |  |  | 		return fmt.Errorf("failed to parse mountstats: %w", err) | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2018-07-23 15:47:12 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 	mountsInfo, err := c.proc.MountInfo() | 
					
						
							|  |  |  | 	if err != nil { | 
					
						
							| 
									
										
										
										
											2019-11-29 05:51:31 -08:00
										 |  |  | 		return fmt.Errorf("failed to parse mountinfo: %w", err) | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-23 15:47:12 -07:00
										 |  |  | 	// store all seen nfsDeviceIdentifiers for deduplication
 | 
					
						
							|  |  |  | 	deviceList := make(map[nfsDeviceIdentifier]bool) | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 	for idx, m := range mounts { | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 		// For the time being, only NFS statistics are available via this mechanism
 | 
					
						
							|  |  |  | 		stats, ok := m.Stats.(*procfs.MountStatsNFS) | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 		if !ok { | 
					
						
							|  |  |  | 			continue | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 		var mountAddress string | 
					
						
							|  |  |  | 		if idx < len(mountsInfo) { | 
					
						
							|  |  |  | 			// The mount entry order in the /proc/self/mountstats and /proc/self/mountinfo is the same.
 | 
					
						
							|  |  |  | 			miStats := mountsInfo[idx] | 
					
						
							|  |  |  | 			mountAddress = miStats.SuperOptions["addr"] | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-10 06:58:57 -07:00
										 |  |  | 		for k := range stats.Transport { | 
					
						
							|  |  |  | 			deviceIdentifier := nfsDeviceIdentifier{m.Device, stats.Transport[k].Protocol, mountAddress} | 
					
						
							|  |  |  | 			i := deviceList[deviceIdentifier] | 
					
						
							|  |  |  | 			if i { | 
					
						
							| 
									
										
										
										
											2024-09-11 01:51:28 -07:00
										 |  |  | 				c.logger.Debug("Skipping duplicate device entry", "device", deviceIdentifier) | 
					
						
							| 
									
										
										
										
											2024-07-10 06:58:57 -07:00
										 |  |  | 				break | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 			deviceList[deviceIdentifier] = true | 
					
						
							|  |  |  | 			c.updateNFSStats(ch, stats, m.Device, stats.Transport[k].Protocol, mountAddress) | 
					
						
							| 
									
										
										
										
											2017-01-24 04:26:24 -08:00
										 |  |  | 		} | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	return nil | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | func (c *mountStatsCollector) updateNFSStats(ch chan<- prometheus.Metric, s *procfs.MountStatsNFS, export, protocol, mountAddress string) { | 
					
						
							|  |  |  | 	labelValues := []string{export, protocol, mountAddress} | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 	ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 		c.NFSAgeSecondsTotal, | 
					
						
							|  |  |  | 		prometheus.CounterValue, | 
					
						
							|  |  |  | 		s.Age.Seconds(), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 		labelValues..., | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 		c.NFSReadBytesTotal, | 
					
						
							|  |  |  | 		prometheus.CounterValue, | 
					
						
							|  |  |  | 		float64(s.Bytes.Read), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 		labelValues..., | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 		c.NFSWriteBytesTotal, | 
					
						
							|  |  |  | 		prometheus.CounterValue, | 
					
						
							|  |  |  | 		float64(s.Bytes.Write), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 		labelValues..., | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 		c.NFSDirectReadBytesTotal, | 
					
						
							|  |  |  | 		prometheus.CounterValue, | 
					
						
							|  |  |  | 		float64(s.Bytes.DirectRead), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 		labelValues..., | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 		c.NFSDirectWriteBytesTotal, | 
					
						
							|  |  |  | 		prometheus.CounterValue, | 
					
						
							|  |  |  | 		float64(s.Bytes.DirectWrite), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 		labelValues..., | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 		c.NFSTotalReadBytesTotal, | 
					
						
							|  |  |  | 		prometheus.CounterValue, | 
					
						
							|  |  |  | 		float64(s.Bytes.ReadTotal), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 		labelValues..., | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 		c.NFSTotalWriteBytesTotal, | 
					
						
							|  |  |  | 		prometheus.CounterValue, | 
					
						
							|  |  |  | 		float64(s.Bytes.WriteTotal), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 		labelValues..., | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 		c.NFSReadPagesTotal, | 
					
						
							|  |  |  | 		prometheus.CounterValue, | 
					
						
							|  |  |  | 		float64(s.Bytes.ReadPages), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 		labelValues..., | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 		c.NFSWritePagesTotal, | 
					
						
							|  |  |  | 		prometheus.CounterValue, | 
					
						
							|  |  |  | 		float64(s.Bytes.WritePages), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 		labelValues..., | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-10 06:58:57 -07:00
										 |  |  | 	for i := range s.Transport { | 
					
						
							|  |  |  | 		ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 			c.NFSTransportBindTotal, | 
					
						
							|  |  |  | 			prometheus.CounterValue, | 
					
						
							|  |  |  | 			float64(s.Transport[i].Bind), | 
					
						
							|  |  |  | 			labelValues..., | 
					
						
							|  |  |  | 		) | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-10 06:58:57 -07:00
										 |  |  | 		ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 			c.NFSTransportConnectTotal, | 
					
						
							|  |  |  | 			prometheus.CounterValue, | 
					
						
							|  |  |  | 			float64(s.Transport[i].Connect), | 
					
						
							|  |  |  | 			labelValues..., | 
					
						
							|  |  |  | 		) | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-10 06:58:57 -07:00
										 |  |  | 		ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 			c.NFSTransportIdleTimeSeconds, | 
					
						
							|  |  |  | 			prometheus.GaugeValue, | 
					
						
							|  |  |  | 			float64(s.Transport[i].IdleTimeSeconds%float64Mantissa), | 
					
						
							|  |  |  | 			labelValues..., | 
					
						
							|  |  |  | 		) | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-10 06:58:57 -07:00
										 |  |  | 		ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 			c.NFSTransportSendsTotal, | 
					
						
							|  |  |  | 			prometheus.CounterValue, | 
					
						
							|  |  |  | 			float64(s.Transport[i].Sends), | 
					
						
							|  |  |  | 			labelValues..., | 
					
						
							|  |  |  | 		) | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-10 06:58:57 -07:00
										 |  |  | 		ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 			c.NFSTransportReceivesTotal, | 
					
						
							|  |  |  | 			prometheus.CounterValue, | 
					
						
							|  |  |  | 			float64(s.Transport[i].Receives), | 
					
						
							|  |  |  | 			labelValues..., | 
					
						
							|  |  |  | 		) | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-10 06:58:57 -07:00
										 |  |  | 		ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 			c.NFSTransportBadTransactionIDsTotal, | 
					
						
							|  |  |  | 			prometheus.CounterValue, | 
					
						
							|  |  |  | 			float64(s.Transport[i].BadTransactionIDs), | 
					
						
							|  |  |  | 			labelValues..., | 
					
						
							|  |  |  | 		) | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-10 06:58:57 -07:00
										 |  |  | 		ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 			c.NFSTransportBacklogQueueTotal, | 
					
						
							|  |  |  | 			prometheus.CounterValue, | 
					
						
							|  |  |  | 			float64(s.Transport[i].CumulativeBacklog), | 
					
						
							|  |  |  | 			labelValues..., | 
					
						
							|  |  |  | 		) | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-10 06:58:57 -07:00
										 |  |  | 		ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 			c.NFSTransportMaximumRPCSlots, | 
					
						
							|  |  |  | 			prometheus.GaugeValue, | 
					
						
							|  |  |  | 			float64(s.Transport[i].MaximumRPCSlotsUsed), | 
					
						
							|  |  |  | 			labelValues..., | 
					
						
							|  |  |  | 		) | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-10 06:58:57 -07:00
										 |  |  | 		ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 			c.NFSTransportSendingQueueTotal, | 
					
						
							|  |  |  | 			prometheus.CounterValue, | 
					
						
							|  |  |  | 			float64(s.Transport[i].CumulativeSendingQueue), | 
					
						
							|  |  |  | 			labelValues..., | 
					
						
							|  |  |  | 		) | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-10 06:58:57 -07:00
										 |  |  | 		ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 			c.NFSTransportPendingQueueTotal, | 
					
						
							|  |  |  | 			prometheus.CounterValue, | 
					
						
							|  |  |  | 			float64(s.Transport[i].CumulativePendingQueue), | 
					
						
							|  |  |  | 			labelValues..., | 
					
						
							|  |  |  | 		) | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	for _, op := range s.Operations { | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 		opLabelValues := []string{export, protocol, mountAddress, op.Operation} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 		ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 			c.NFSOperationsRequestsTotal, | 
					
						
							|  |  |  | 			prometheus.CounterValue, | 
					
						
							|  |  |  | 			float64(op.Requests), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 			opLabelValues..., | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 		) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 			c.NFSOperationsTransmissionsTotal, | 
					
						
							|  |  |  | 			prometheus.CounterValue, | 
					
						
							|  |  |  | 			float64(op.Transmissions), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 			opLabelValues..., | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 		) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 			c.NFSOperationsMajorTimeoutsTotal, | 
					
						
							|  |  |  | 			prometheus.CounterValue, | 
					
						
							|  |  |  | 			float64(op.MajorTimeouts), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 			opLabelValues..., | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 		) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 			c.NFSOperationsSentBytesTotal, | 
					
						
							|  |  |  | 			prometheus.CounterValue, | 
					
						
							|  |  |  | 			float64(op.BytesSent), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 			opLabelValues..., | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 		) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 			c.NFSOperationsReceivedBytesTotal, | 
					
						
							|  |  |  | 			prometheus.CounterValue, | 
					
						
							|  |  |  | 			float64(op.BytesReceived), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 			opLabelValues..., | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 		) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 			c.NFSOperationsQueueTimeSecondsTotal, | 
					
						
							|  |  |  | 			prometheus.CounterValue, | 
					
						
							| 
									
										
										
										
											2019-05-31 09:30:37 -07:00
										 |  |  | 			float64(op.CumulativeQueueMilliseconds%float64Mantissa)/1000.0, | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 			opLabelValues..., | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 		) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 			c.NFSOperationsResponseTimeSecondsTotal, | 
					
						
							|  |  |  | 			prometheus.CounterValue, | 
					
						
							| 
									
										
										
										
											2019-05-31 09:30:37 -07:00
										 |  |  | 			float64(op.CumulativeTotalResponseMilliseconds%float64Mantissa)/1000.0, | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 			opLabelValues..., | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 		) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 			c.NFSOperationsRequestTimeSecondsTotal, | 
					
						
							|  |  |  | 			prometheus.CounterValue, | 
					
						
							| 
									
										
										
										
											2019-05-31 09:30:37 -07:00
										 |  |  | 			float64(op.CumulativeTotalRequestMilliseconds%float64Mantissa)/1000.0, | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 			opLabelValues..., | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | 		) | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 		c.NFSEventInodeRevalidateTotal, | 
					
						
							|  |  |  | 		prometheus.CounterValue, | 
					
						
							|  |  |  | 		float64(s.Events.InodeRevalidate), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 		labelValues..., | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 		c.NFSEventDnodeRevalidateTotal, | 
					
						
							|  |  |  | 		prometheus.CounterValue, | 
					
						
							|  |  |  | 		float64(s.Events.DnodeRevalidate), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 		labelValues..., | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 		c.NFSEventDataInvalidateTotal, | 
					
						
							|  |  |  | 		prometheus.CounterValue, | 
					
						
							|  |  |  | 		float64(s.Events.DataInvalidate), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 		labelValues..., | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 		c.NFSEventAttributeInvalidateTotal, | 
					
						
							|  |  |  | 		prometheus.CounterValue, | 
					
						
							|  |  |  | 		float64(s.Events.AttributeInvalidate), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 		labelValues..., | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 		c.NFSEventVFSOpenTotal, | 
					
						
							|  |  |  | 		prometheus.CounterValue, | 
					
						
							|  |  |  | 		float64(s.Events.VFSOpen), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 		labelValues..., | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 		c.NFSEventVFSLookupTotal, | 
					
						
							|  |  |  | 		prometheus.CounterValue, | 
					
						
							|  |  |  | 		float64(s.Events.VFSLookup), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 		labelValues..., | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 		c.NFSEventVFSAccessTotal, | 
					
						
							|  |  |  | 		prometheus.CounterValue, | 
					
						
							|  |  |  | 		float64(s.Events.VFSAccess), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 		labelValues..., | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 		c.NFSEventVFSUpdatePageTotal, | 
					
						
							|  |  |  | 		prometheus.CounterValue, | 
					
						
							|  |  |  | 		float64(s.Events.VFSUpdatePage), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 		labelValues..., | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 		c.NFSEventVFSReadPageTotal, | 
					
						
							|  |  |  | 		prometheus.CounterValue, | 
					
						
							|  |  |  | 		float64(s.Events.VFSReadPage), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 		labelValues..., | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 		c.NFSEventVFSReadPagesTotal, | 
					
						
							|  |  |  | 		prometheus.CounterValue, | 
					
						
							|  |  |  | 		float64(s.Events.VFSReadPages), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 		labelValues..., | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 		c.NFSEventVFSWritePageTotal, | 
					
						
							|  |  |  | 		prometheus.CounterValue, | 
					
						
							|  |  |  | 		float64(s.Events.VFSWritePage), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 		labelValues..., | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 		c.NFSEventVFSWritePagesTotal, | 
					
						
							|  |  |  | 		prometheus.CounterValue, | 
					
						
							|  |  |  | 		float64(s.Events.VFSWritePages), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 		labelValues..., | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 		c.NFSEventVFSGetdentsTotal, | 
					
						
							|  |  |  | 		prometheus.CounterValue, | 
					
						
							|  |  |  | 		float64(s.Events.VFSGetdents), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 		labelValues..., | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 		c.NFSEventVFSSetattrTotal, | 
					
						
							|  |  |  | 		prometheus.CounterValue, | 
					
						
							|  |  |  | 		float64(s.Events.VFSSetattr), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 		labelValues..., | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 		c.NFSEventVFSFlushTotal, | 
					
						
							|  |  |  | 		prometheus.CounterValue, | 
					
						
							|  |  |  | 		float64(s.Events.VFSFlush), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 		labelValues..., | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 		c.NFSEventVFSFsyncTotal, | 
					
						
							|  |  |  | 		prometheus.CounterValue, | 
					
						
							|  |  |  | 		float64(s.Events.VFSFsync), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 		labelValues..., | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 		c.NFSEventVFSLockTotal, | 
					
						
							|  |  |  | 		prometheus.CounterValue, | 
					
						
							|  |  |  | 		float64(s.Events.VFSLock), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 		labelValues..., | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 		c.NFSEventVFSFileReleaseTotal, | 
					
						
							|  |  |  | 		prometheus.CounterValue, | 
					
						
							|  |  |  | 		float64(s.Events.VFSFileRelease), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 		labelValues..., | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 		c.NFSEventTruncationTotal, | 
					
						
							|  |  |  | 		prometheus.CounterValue, | 
					
						
							|  |  |  | 		float64(s.Events.Truncation), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 		labelValues..., | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 		c.NFSEventWriteExtensionTotal, | 
					
						
							|  |  |  | 		prometheus.CounterValue, | 
					
						
							|  |  |  | 		float64(s.Events.WriteExtension), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 		labelValues..., | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 		c.NFSEventSillyRenameTotal, | 
					
						
							|  |  |  | 		prometheus.CounterValue, | 
					
						
							|  |  |  | 		float64(s.Events.SillyRename), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 		labelValues..., | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 		c.NFSEventShortReadTotal, | 
					
						
							|  |  |  | 		prometheus.CounterValue, | 
					
						
							|  |  |  | 		float64(s.Events.ShortRead), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 		labelValues..., | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 		c.NFSEventShortWriteTotal, | 
					
						
							|  |  |  | 		prometheus.CounterValue, | 
					
						
							|  |  |  | 		float64(s.Events.ShortWrite), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 		labelValues..., | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 		c.NFSEventJukeboxDelayTotal, | 
					
						
							|  |  |  | 		prometheus.CounterValue, | 
					
						
							|  |  |  | 		float64(s.Events.JukeboxDelay), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 		labelValues..., | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 		c.NFSEventPNFSReadTotal, | 
					
						
							|  |  |  | 		prometheus.CounterValue, | 
					
						
							|  |  |  | 		float64(s.Events.PNFSRead), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 		labelValues..., | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ch <- prometheus.MustNewConstMetric( | 
					
						
							|  |  |  | 		c.NFSEventPNFSWriteTotal, | 
					
						
							|  |  |  | 		prometheus.CounterValue, | 
					
						
							|  |  |  | 		float64(s.Events.PNFSWrite), | 
					
						
							| 
									
										
										
										
											2019-07-28 02:32:40 -07:00
										 |  |  | 		labelValues..., | 
					
						
							| 
									
										
										
										
											2017-01-11 08:41:13 -08:00
										 |  |  | 	) | 
					
						
							| 
									
										
										
										
											2016-12-12 13:46:45 -08:00
										 |  |  | } |