func (g *Group) SetApplications(namesAndPorts namesandports.NamesAndPorts) (
	newApps, active, inactive []*scotty.Endpoint) {
	return g.setApplications(namesAndPorts)
}
SetApplications tells this instance the names and ports of running
applications. If a previously reported application isn't reported
countToInactive times (see NewGroup) then SetApplications marks that
application inactive. If an inactive application is listed in namesAndPorts,
SetApplications marks it as active. namesandports need not include the
health agent running on port 6910. That application is always active.

SetApplications returns the scotty.Endpoint for newly reported applications,
previously inactive applications marked active, and previously active
applications marked inactive.
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
}
func NewGroup(host *hostid.HostID, countToInactivate int) (
	*Group, *scotty.Endpoint) {
	return newGroup(host, countToInactivate)
}