| 
									
										
										
										
											2021-04-19 03:41:13 +08:00
										 |  |  | // Copyright (c) 2015-2021 MinIO, Inc.
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // This file is part of MinIO Object Storage stack
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // This program is free software: you can redistribute it and/or modify
 | 
					
						
							|  |  |  | // it under the terms of the GNU Affero General Public License as published by
 | 
					
						
							|  |  |  | // the Free Software Foundation, either version 3 of the License, or
 | 
					
						
							|  |  |  | // (at your option) any later version.
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // This program is distributed in the hope that it will be useful
 | 
					
						
							|  |  |  | // but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
					
						
							|  |  |  | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
					
						
							|  |  |  | // GNU Affero General Public License for more details.
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // You should have received a copy of the GNU Affero General Public License
 | 
					
						
							|  |  |  | // along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
					
						
							| 
									
										
										
										
											2015-12-08 06:12:47 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-10-18 10:09:43 +08:00
										 |  |  | package disk | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-01-25 15:03:38 +08:00
										 |  |  | // Info stat fs struct is container which holds following values
 | 
					
						
							| 
									
										
										
										
											2015-10-18 10:09:43 +08:00
										 |  |  | // Total - total size of the volume / disk
 | 
					
						
							|  |  |  | // Free - free size of the volume / disk
 | 
					
						
							| 
									
										
										
										
											2017-08-04 11:07:22 +08:00
										 |  |  | // Files - total inodes available
 | 
					
						
							|  |  |  | // Ffree - free inodes available
 | 
					
						
							|  |  |  | // FSType - file system type
 | 
					
						
							| 
									
										
										
										
											2023-07-25 00:30:19 +08:00
										 |  |  | // Major - major dev id
 | 
					
						
							|  |  |  | // Minor - minor dev id
 | 
					
						
							|  |  |  | // Devname - device name
 | 
					
						
							| 
									
										
										
										
											2016-01-25 15:03:38 +08:00
										 |  |  | type Info struct { | 
					
						
							| 
									
										
										
										
											2023-07-25 00:30:19 +08:00
										 |  |  | 	Total      uint64 | 
					
						
							|  |  |  | 	Free       uint64 | 
					
						
							|  |  |  | 	Used       uint64 | 
					
						
							|  |  |  | 	Files      uint64 | 
					
						
							|  |  |  | 	Ffree      uint64 | 
					
						
							|  |  |  | 	FSType     string | 
					
						
							|  |  |  | 	Major      uint32 | 
					
						
							|  |  |  | 	Minor      uint32 | 
					
						
							|  |  |  | 	Name       string | 
					
						
							|  |  |  | 	Rotational *bool | 
					
						
							| 
									
										
										
										
											2022-08-16 22:13:49 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // DevID is the drive major and minor ids
 | 
					
						
							|  |  |  | type DevID struct { | 
					
						
							|  |  |  | 	Major uint32 | 
					
						
							|  |  |  | 	Minor uint32 | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // AllDrivesIOStats is map between drive devices and IO stats
 | 
					
						
							|  |  |  | type AllDrivesIOStats map[DevID]IOStats | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // IOStats contains stats of a single drive
 | 
					
						
							|  |  |  | type IOStats struct { | 
					
						
							|  |  |  | 	ReadIOs        uint64 | 
					
						
							|  |  |  | 	ReadMerges     uint64 | 
					
						
							|  |  |  | 	ReadSectors    uint64 | 
					
						
							|  |  |  | 	ReadTicks      uint64 | 
					
						
							|  |  |  | 	WriteIOs       uint64 | 
					
						
							|  |  |  | 	WriteMerges    uint64 | 
					
						
							|  |  |  | 	WriteSectors   uint64 | 
					
						
							|  |  |  | 	WriteTicks     uint64 | 
					
						
							|  |  |  | 	CurrentIOs     uint64 | 
					
						
							|  |  |  | 	TotalTicks     uint64 | 
					
						
							|  |  |  | 	ReqTicks       uint64 | 
					
						
							|  |  |  | 	DiscardIOs     uint64 | 
					
						
							|  |  |  | 	DiscardMerges  uint64 | 
					
						
							|  |  |  | 	DiscardSectors uint64 | 
					
						
							|  |  |  | 	DiscardTicks   uint64 | 
					
						
							|  |  |  | 	FlushIOs       uint64 | 
					
						
							|  |  |  | 	FlushTicks     uint64 | 
					
						
							| 
									
										
										
										
											2015-10-18 10:09:43 +08:00
										 |  |  | } |