func NewGroup(host *hostid.HostID, countToInactivate int) (
	*Group, *scotty.Endpoint) {
	return newGroup(host, countToInactivate)
}
NewGroup returns a new group instance. host identifies the machine;
countToInactive is the number of times an application must be reported
missing before it is marked inactive. Each new group always contains
the health agent running on port 6910. In addition to the newly created
instance, NewGroup returns the scotty.Endpoint for the health agent.
package application
import (
	"github.com/Symantec/scotty"
	"github.com/Symantec/scotty/hostid"
	"github.com/Symantec/scotty/namesandports"
	"time"
)
const (
	HealthAgentName = "health agent"
	HealthAgentPort = 6910
)
type EndpointStats struct {
	LastReadTime time.Time
	PollTime time.Duration
	LastError     error
	LastErrorTime time.Time
	InitialMetricCount uint64
	Down bool
	ChangedMetricsSum   uint64
	ChangedMetricsCount uint64
	Status scotty.Status
}
func (e *EndpointStats) Staleness() time.Duration {
	if e.LastReadTime.IsZero() {
		return 0
	}
	return time.Now().Sub(e.LastReadTime)
}
func (e *EndpointStats) AverageChangedMetrics() float64 {
	if e.ChangedMetricsCount == 0 {
		return 0.0
	}
	return float64(e.ChangedMetricsSum) / float64(e.ChangedMetricsCount)
}
func (e *EndpointStats) LastErrorTimeStr() string {
	return e.LastErrorTime.Format("2006-01-02T15:04:05")
}
type Application struct {
	EP *scotty.Endpoint
	Port uint
	IsTLS bool
	EndpointStats
	Active bool
}
type Group struct {
	host              *hostid.HostID
	apps              map[string]*applicationDataType
	countToInactivate int
}