https://github.com/etcd-io/etcd
Raw File
Tip revision: 13b0e7230445dcb432f6652b6fd7449c86e468d8 authored by Brandon Philips on 08 July 2014, 01:10:41 UTC
CHANGELOG: v0.4.5
Tip revision: 13b0e72
package_stats.go
package server

import (
	"time"
)

// packageStats represent the stats we need for a package.
// It has sending time and the size of the package.
type packageStats struct {
	sendingTime time.Time
	size        int
}

// NewPackageStats creates a pacakgeStats and return the pointer to it.
func NewPackageStats(now time.Time, size int) *packageStats {
	return &packageStats{
		sendingTime: now,
		size:        size,
	}
}

// Time return the sending time of the package.
func (ps *packageStats) Time() time.Time {
	return ps.sendingTime
}
back to top