stats.go 550 B

1234567891011121314151617181920212223242526
  1. package operation
  2. import (
  3. "context"
  4. "google.golang.org/grpc"
  5. "github.com/chrislusf/seaweedfs/weed/pb/master_pb"
  6. )
  7. func Statistics(server string, grpcDialOption grpc.DialOption, req *master_pb.StatisticsRequest) (resp *master_pb.StatisticsResponse, err error) {
  8. err = WithMasterServerClient(server, grpcDialOption, func(masterClient master_pb.SeaweedClient) error {
  9. grpcResponse, grpcErr := masterClient.Statistics(context.Background(), req)
  10. if grpcErr != nil {
  11. return grpcErr
  12. }
  13. resp = grpcResponse
  14. return nil
  15. })
  16. return
  17. }