mirror of
				https://github.com/coredns/coredns.git
				synced 2025-11-03 18:53:13 -05:00 
			
		
		
		
	
		
			
	
	
		
			15 lines
		
	
	
		
			227 B
		
	
	
	
		
			Go
		
	
	
	
	
	
		
		
			
		
	
	
			15 lines
		
	
	
		
			227 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| 
								 | 
							
								package erratic
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								import (
							 | 
						||
| 
								 | 
							
									"sync/atomic"
							 | 
						||
| 
								 | 
							
								)
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								// Health implements the health.Healther interface.
							 | 
						||
| 
								 | 
							
								func (e *Erratic) Health() bool {
							 | 
						||
| 
								 | 
							
									q := atomic.LoadUint64(&e.q)
							 | 
						||
| 
								 | 
							
									if e.drop > 0 && q%e.drop == 0 {
							 | 
						||
| 
								 | 
							
										return false
							 | 
						||
| 
								 | 
							
									}
							 | 
						||
| 
								 | 
							
									return true
							 | 
						||
| 
								 | 
							
								}
							 |