2018-11-23 16:24:51 +08:00
|
|
|
package operation
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2019-02-19 04:11:52 +08:00
|
|
|
"google.golang.org/grpc"
|
2018-11-23 16:24:51 +08:00
|
|
|
|
|
|
|
"github.com/chrislusf/seaweedfs/weed/pb/master_pb"
|
|
|
|
)
|
|
|
|
|
2019-02-19 04:11:52 +08:00
|
|
|
func Statistics(server string, grpcDialOption grpc.DialOption, req *master_pb.StatisticsRequest) (resp *master_pb.StatisticsResponse, err error) {
|
2018-11-23 16:24:51 +08:00
|
|
|
|
2020-02-26 13:50:12 +08:00
|
|
|
err = WithMasterServerClient(server, grpcDialOption, func(masterClient master_pb.SeaweedClient) error {
|
2019-01-10 16:43:44 +08:00
|
|
|
|
2020-02-26 13:50:12 +08:00
|
|
|
grpcResponse, grpcErr := masterClient.Statistics(context.Background(), req)
|
2018-11-23 16:24:51 +08:00
|
|
|
if grpcErr != nil {
|
|
|
|
return grpcErr
|
|
|
|
}
|
|
|
|
|
|
|
|
resp = grpcResponse
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|