google.golang.org/grpc@v1.72.2/xds/internal/clients/lrsclient/load_store.go (about) 1 //revive:disable:unused-parameter 2 3 /* 4 * 5 * Copyright 2025 gRPC authors. 6 * 7 * Licensed under the Apache License, Version 2.0 (the "License"); 8 * you may not use this file except in compliance with the License. 9 * You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, software 14 * distributed under the License is distributed on an "AS IS" BASIS, 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 * See the License for the specific language governing permissions and 17 * limitations under the License. 18 * 19 */ 20 21 package lrsclient 22 23 import "context" 24 25 // A LoadStore aggregates loads for multiple clusters and services that are 26 // intended to be reported via LRS. 27 // 28 // LoadStore stores loads reported to a single LRS server. Use multiple stores 29 // for multiple servers. 30 // 31 // It is safe for concurrent use. 32 type LoadStore struct { 33 } 34 35 // Stop stops the LRS stream associated with this LoadStore. 36 // 37 // If this LoadStore is the only one using the underlying LRS stream, the 38 // stream will be closed. If other LoadStores are also using the same stream, 39 // the reference count to the stream is decremented, and the stream remains 40 // open until all LoadStores have called Stop(). 41 // 42 // If this is the last LoadStore for the stream, this method makes a last 43 // attempt to flush any unreported load data to the LRS server. It will either 44 // wait for this attempt to complete, or for the provided context to be done 45 // before canceling the LRS stream. 46 func (ls *LoadStore) Stop(ctx context.Context) error { 47 panic("unimplemented") 48 } 49 50 // ReporterForCluster returns the PerClusterReporter for the given cluster and 51 // service. 52 func (ls *LoadStore) ReporterForCluster(clusterName, serviceName string) PerClusterReporter { 53 panic("unimplemented") 54 } 55 56 // PerClusterReporter records load data pertaining to a single cluster. It 57 // provides methods to record call starts, finishes, server-reported loads, 58 // and dropped calls. 59 type PerClusterReporter struct { 60 } 61 62 // CallStarted records a call started in the LoadStore. 63 func (p *PerClusterReporter) CallStarted(locality string) { 64 panic("unimplemented") 65 } 66 67 // CallFinished records a call finished in the LoadStore. 68 func (p *PerClusterReporter) CallFinished(locality string, err error) { 69 panic("unimplemented") 70 } 71 72 // CallServerLoad records the server load in the LoadStore. 73 func (p *PerClusterReporter) CallServerLoad(locality, name string, val float64) { 74 panic("unimplemented") 75 } 76 77 // CallDropped records a call dropped in the LoadStore. 78 func (p *PerClusterReporter) CallDropped(category string) { 79 panic("unimplemented") 80 }