mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-10-31 12:52:25 -05:00 
			
		
		
		
	[chore] update otel libraries (#3740)
* chore: update otel dependencies * refactor: combine tracing & metrics in observability package * chore: update example tracing compose file
This commit is contained in:
		
					parent
					
						
							
								baed591a1d
							
						
					
				
			
			
				commit
				
					
						dd094e4012
					
				
			
		
					 217 changed files with 6873 additions and 2734 deletions
				
			
		
							
								
								
									
										36
									
								
								vendor/google.golang.org/grpc/mem/buffers.go
									
										
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										36
									
								
								vendor/google.golang.org/grpc/mem/buffers.go
									
										
									
										generated
									
									
										vendored
									
									
								
							|  | @ -65,6 +65,9 @@ var ( | |||
| 	refObjectPool    = sync.Pool{New: func() any { return new(atomic.Int32) }} | ||||
| ) | ||||
| 
 | ||||
| // IsBelowBufferPoolingThreshold returns true if the given size is less than or | ||||
| // equal to the threshold for buffer pooling. This is used to determine whether | ||||
| // to pool buffers or allocate them directly. | ||||
| func IsBelowBufferPoolingThreshold(size int) bool { | ||||
| 	return size <= bufferPoolingThreshold | ||||
| } | ||||
|  | @ -89,7 +92,11 @@ func newBuffer() *buffer { | |||
| // | ||||
| // Note that the backing array of the given data is not copied. | ||||
| func NewBuffer(data *[]byte, pool BufferPool) Buffer { | ||||
| 	if pool == nil || IsBelowBufferPoolingThreshold(len(*data)) { | ||||
| 	// Use the buffer's capacity instead of the length, otherwise buffers may | ||||
| 	// not be reused under certain conditions. For example, if a large buffer | ||||
| 	// is acquired from the pool, but fewer bytes than the buffering threshold | ||||
| 	// are written to it, the buffer will not be returned to the pool. | ||||
| 	if pool == nil || IsBelowBufferPoolingThreshold(cap(*data)) { | ||||
| 		return (SliceBuffer)(*data) | ||||
| 	} | ||||
| 	b := newBuffer() | ||||
|  | @ -194,19 +201,19 @@ func (b *buffer) read(buf []byte) (int, Buffer) { | |||
| 	return n, b | ||||
| } | ||||
| 
 | ||||
| // String returns a string representation of the buffer. May be used for | ||||
| // debugging purposes. | ||||
| func (b *buffer) String() string { | ||||
| 	return fmt.Sprintf("mem.Buffer(%p, data: %p, length: %d)", b, b.ReadOnlyData(), len(b.ReadOnlyData())) | ||||
| } | ||||
| 
 | ||||
| // ReadUnsafe reads bytes from the given Buffer into the provided slice. | ||||
| // It does not perform safety checks. | ||||
| func ReadUnsafe(dst []byte, buf Buffer) (int, Buffer) { | ||||
| 	return buf.read(dst) | ||||
| } | ||||
| 
 | ||||
| // SplitUnsafe modifies the receiver to point to the first n bytes while it | ||||
| // returns a new reference to the remaining bytes. The returned Buffer functions | ||||
| // just like a normal reference acquired using Ref(). | ||||
| // returns a new reference to the remaining bytes. The returned Buffer | ||||
| // functions just like a normal reference acquired using Ref(). | ||||
| func SplitUnsafe(buf Buffer, n int) (left, right Buffer) { | ||||
| 	return buf.split(n) | ||||
| } | ||||
|  | @ -224,20 +231,29 @@ func (e emptyBuffer) Len() int { | |||
| 	return 0 | ||||
| } | ||||
| 
 | ||||
| func (e emptyBuffer) split(n int) (left, right Buffer) { | ||||
| func (e emptyBuffer) split(int) (left, right Buffer) { | ||||
| 	return e, e | ||||
| } | ||||
| 
 | ||||
| func (e emptyBuffer) read(buf []byte) (int, Buffer) { | ||||
| func (e emptyBuffer) read([]byte) (int, Buffer) { | ||||
| 	return 0, e | ||||
| } | ||||
| 
 | ||||
| // SliceBuffer is a Buffer implementation that wraps a byte slice. It provides | ||||
| // methods for reading, splitting, and managing the byte slice. | ||||
| type SliceBuffer []byte | ||||
| 
 | ||||
| // ReadOnlyData returns the byte slice. | ||||
| func (s SliceBuffer) ReadOnlyData() []byte { return s } | ||||
| func (s SliceBuffer) Ref()                 {} | ||||
| func (s SliceBuffer) Free()                {} | ||||
| func (s SliceBuffer) Len() int             { return len(s) } | ||||
| 
 | ||||
| // Ref is a noop implementation of Ref. | ||||
| func (s SliceBuffer) Ref() {} | ||||
| 
 | ||||
| // Free is a noop implementation of Free. | ||||
| func (s SliceBuffer) Free() {} | ||||
| 
 | ||||
| // Len is a noop implementation of Len. | ||||
| func (s SliceBuffer) Len() int { return len(s) } | ||||
| 
 | ||||
| func (s SliceBuffer) split(n int) (left, right Buffer) { | ||||
| 	return s[:n], s[n:] | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue