Documentation ¶
Index ¶
- Constants
- Variables
- func ErrInvalidArgument(message string) error
- func GetObjectStorageFlow(promURL, bucket, instance string, startTime, endTime time.Time) (int64, error)
- func GetObjectStorageSize(client *minio.Client, bucket string) (int64, int64)
- func GetUserObjectStorageFlow(client *minio.Client, promURL, username, instance string, ...) (int64, error)
- func GetUserObjectStorageSize(client *minio.Client, username string) (int64, int64, error)
- func ListAllObjectStorageBucket(client *minio.Client) ([]string, error)
- func ListUserObjectStorageBucket(client *minio.Client, username string) ([]string, error)
- func QueryPrometheus(host, bucketName, instance string, startTime, endTime time.Time) (int64, error)
- type ErrorResponse
- type Interface
- type MetricData
- type Metrics
- type MetricsClient
Constants ¶
View Source
const (
EnvPromQueryObsTimeoutSecEnv = "PROM_QUERY_OBS_TIMEOUT_SEC"
)
Variables ¶
View Source
var DefaultTransport = func(secure bool) http.RoundTripper { tr := &http.Transport{ Proxy: http.ProxyFromEnvironment, DialContext: (&net.Dialer{ Timeout: 5 * time.Second, KeepAlive: 15 * time.Second, FallbackDelay: 100 * time.Millisecond, }).DialContext, MaxIdleConns: 1024, MaxIdleConnsPerHost: 1024, ResponseHeaderTimeout: 60 * time.Second, IdleConnTimeout: 60 * time.Second, TLSHandshakeTimeout: 10 * time.Second, ExpectContinueTimeout: 1 * time.Second, DisableCompression: true, } if secure { tr.TLSClientConfig = &tls.Config{ MinVersion: tls.VersionTLS12, } } return tr }
DefaultTransport - this default transport is similar to http.DefaultTransport but with additional param DisableCompression is set to true to avoid decompressing content with 'gzip' encoding.
Functions ¶
func ErrInvalidArgument ¶
ErrInvalidArgument - Invalid argument response.
func GetObjectStorageFlow ¶
func GetObjectStorageSize ¶
Types ¶
type ErrorResponse ¶
type ErrorResponse struct { XMLName xml.Name `xml:"Error" json:"-"` Code string Message string BucketName string Key string RequestID string `xml:"RequestId"` HostID string `xml:"HostId"` // Region where the bucket is located. This header is returned // only in HEAD bucket and ListObjects response. Region string }
ErrorResponse - Is the typed error returned by all API operations.
func (ErrorResponse) Error ¶
func (e ErrorResponse) Error() string
Error - Returns HTTP error string
type MetricData ¶
type Metrics ¶
type Metrics map[string]MetricData
func QueryUserUsage ¶
func QueryUserUsage(client *MetricsClient) (Metrics, error)
func QueryUserUsageAndTraffic ¶
func QueryUserUsageAndTraffic(client *MetricsClient) (Metrics, error)
type MetricsClient ¶
type MetricsClient struct {
// contains filtered or unexported fields
}
MetricsClient implements MinIO metrics operations
func NewMetricsClient ¶
func NewMetricsClient(endpoint string, accessKeyID, secretAccessKey string, secure bool) (*MetricsClient, error)
NewMetricsClient - instantiate minio metrics client honoring Prometheus format
func (*MetricsClient) BucketUsageAndTrafficBytesMetrics ¶
func (client *MetricsClient) BucketUsageAndTrafficBytesMetrics(ctx context.Context) ([]*prom2json.Family, error)
BucketUsageAndTrafficBytesMetrics - returns Bucket Usage And Traffic Metrics in Prometheus format
func (*MetricsClient) BucketUsageTotalBytesMetrics ¶
func (client *MetricsClient) BucketUsageTotalBytesMetrics(ctx context.Context) ([]*prom2json.Family, error)
BucketUsageTotalBytesMetrics - returns Bucket Usage Total Metrics in Prometheus format
Click to show internal directories.
Click to hide internal directories.