github.com/cs3org/reva/v2@v2.27.7/pkg/metrics/reader/reader.go (about) 1 // Copyright 2018-2021 CERN 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 // 15 // In applying this license, CERN does not waive the privileges and immunities 16 // granted to it by virtue of its status as an Intergovernmental Organization 17 // or submit itself to any jurisdiction. 18 19 package reader 20 21 /* 22 Reader is the interface that defines the metrics to read. 23 Any metrics data driver must implement this interface. 24 Each metric function should return the current/latest available metrics figure relevant to that function. 25 */ 26 27 import "github.com/cs3org/reva/v2/pkg/metrics/config" 28 29 // Reader the Reader interface 30 type Reader interface { 31 32 // Configure configures the reader according to the specified configuration 33 Configure(c *config.Config) error 34 35 // GetNumUsersView returns an OpenCensus stats view which records the 36 // number of users registered in the mesh provider. 37 // Metric name: cs3_org_sciencemesh_site_total_num_users 38 GetNumUsers() int64 39 40 // GetNumGroupsView returns an OpenCensus stats view which records the 41 // number of user groups registered in the mesh provider. 42 // Metric name: cs3_org_sciencemesh_site_total_num_groups 43 GetNumGroups() int64 44 45 // GetAmountStorageView returns an OpenCensus stats view which records the 46 // amount of storage in the system. 47 // Metric name: cs3_org_sciencemesh_site_total_amount_storage 48 GetAmountStorage() int64 49 }