Home Download Docs Code Community
     1	/*
     2	Copyright 2012 The Perkeep Authors
     3	
     4	Licensed under the Apache License, Version 2.0 (the "License");
     5	you may not use this file except in compliance with the License.
     6	You may obtain a copy of the License at
     7	
     8	     http://www.apache.org/licenses/LICENSE-2.0
     9	
    10	Unless required by applicable law or agreed to in writing, software
    11	distributed under the License is distributed on an "AS IS" BASIS,
    12	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13	See the License for the specific language governing permissions and
    14	limitations under the License.
    15	*/
    16	
    17	package client
    18	
    19	import (
    20		"fmt"
    21	)
    22	
    23	type Stats struct {
    24		// The number of uploads that were requested, but perhaps
    25		// not actually performed if the server already had the items.
    26		UploadRequests ByCountAndBytes
    27	
    28		// The uploads which were actually sent to the blobserver
    29		// due to the server not having the blobs
    30		Uploads ByCountAndBytes
    31	}
    32	
    33	func (s *Stats) String() string {
    34		return "[uploadRequests=" + s.UploadRequests.String() + " uploads=" + s.Uploads.String() + "]"
    35	}
    36	
    37	type ByCountAndBytes struct {
    38		Blobs int
    39		Bytes int64
    40	}
    41	
    42	func (bb *ByCountAndBytes) String() string {
    43		return fmt.Sprintf("[blobs=%d bytes=%d]", bb.Blobs, bb.Bytes)
    44	}
Website layout inspired by memcached.
Content by the authors.