aboutsummaryrefslogtreecommitdiff
path: root/weed/operation/stats.go
blob: 277b0e835c1af28d0b04cc24e6a62f7fa038cf95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package operation

import (
	"context"

	"github.com/chrislusf/seaweedfs/weed/pb/master_pb"
)

func Statistics(server string, req *master_pb.StatisticsRequest) (resp *master_pb.StatisticsResponse, err error) {

	err = withMasterServerClient(server, func(masterClient master_pb.SeaweedClient) error {
		grpcResponse, grpcErr := masterClient.Statistics(context.Background(), req)
		if grpcErr != nil {
			return grpcErr
		}

		resp = grpcResponse

		return nil

	})

	return
}