You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
573 B

  1. package operation
  2. import (
  3. "context"
  4. "time"
  5. "github.com/chrislusf/seaweedfs/weed/pb/master_pb"
  6. )
  7. func Statistics(server string, req *master_pb.StatisticsRequest) (resp *master_pb.StatisticsResponse, err error) {
  8. err = withMasterServerClient(server, func(masterClient master_pb.SeaweedClient) error {
  9. ctx, cancel := context.WithTimeout(context.Background(), time.Duration(5*time.Second))
  10. defer cancel()
  11. grpcResponse, grpcErr := masterClient.Statistics(ctx, req)
  12. if grpcErr != nil {
  13. return grpcErr
  14. }
  15. resp = grpcResponse
  16. return nil
  17. })
  18. return
  19. }