github.com/kubewharf/katalyst-core@v0.5.3/pkg/config/metric/collector.go (about)

     1  /*
     2  Copyright 2022 The Katalyst Authors.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  package metric
    18  
    19  import (
    20  	"time"
    21  
    22  	"k8s.io/apimachinery/pkg/labels"
    23  )
    24  
    25  type CollectorConfiguration struct {
    26  	// PodSelector and NodeSelector are used to only match with those resources that real-time pipeline needed
    27  	PodSelector  labels.Selector
    28  	NodeSelector labels.Selector
    29  	SyncInterval time.Duration
    30  
    31  	// ShardNum is used to indicate which shard splits current collector will be responsible for
    32  	// todo: currently, we don't support to ShardNum to be set > 1
    33  	ShardNum int
    34  
    35  	// CollectorName is used to switch from different collector implementations.
    36  	CollectorName string
    37  
    38  	// CredentialPath is the path where the credential files should be in. Which and how many files should be in it
    39  	// depends on the authentication method. For now, we only support basic auth,so there should be two files with name
    40  	// username and password.
    41  	CredentialPath string
    42  }
    43  
    44  func NewCollectorConfiguration() *CollectorConfiguration {
    45  	return &CollectorConfiguration{}
    46  }