func (h *Service) GetHostPort() string {
	h.startWg.Wait()
	return h.hostPort
}
GetHostPort returns the host port for this service
package common
import (
	"fmt"
	"math/rand"
	"net/http"
	"os"
	"strings"
	"time"
	log "github.com/sirupsen/logrus"
	"github.com/uber-common/bark"
	"github.com/uber/cherami-server/common/configure"
	dconfig "github.com/uber/cherami-server/common/dconfigclient"
	"github.com/uber/cherami-server/common/metrics"
	"github.com/uber/cherami-thrift/.generated/go/controller"
	"github.com/uber/tchannel-go"
	"github.com/uber/tchannel-go/thrift"
)
const roleKey = "serviceName"
func NewService(serviceName string, uuid string, cfg configure.CommonServiceConfig, resolver UUIDResolver, hostHWInfoReader HostHardwareInfoReader, reporter metrics.Reporter, dClient dconfig.Client, authManager AuthManager) *Service {
	sVice := &Service{
		sName:                  serviceName,
		cfg:                    cfg,
		resolver:               resolver,
		hostHWInfoReader:       hostHWInfoReader,
		hostUUID:               uuid,
		bLimitsEnabled:         true,  
		mReporter:              reporter,
		runtimeMetricsReporter: metrics.NewRuntimeMetricsReporter(reporter, time.Minute, cfg.GetLogger()),
		dClient:                dClient,
		authManager:            authManager,
	}
	if hostName, e := os.Hostname(); e != nil {
		log.Fatal("Error getting hostname")
	} else {
		sVice.hostName = hostName
	}
	sVice.startWg.Add(1)
	return sVice
}
func (h *Service) UpdateAdvertisedName(deploymentName string) {
	if h.sName == FrontendServiceName {
		if IsDevelopmentEnvironment(deploymentName) {
			h.sName = FrontendServiceName
		} else {
			parts := strings.Split(deploymentName, "_")
			if len(parts) != 2 {
				log.Fatal("Unexpected deployment name")
			}
			tenancy := strings.ToLower(parts[0])
			if tenancy == TenancyProd {
				h.sName = FrontendServiceName
			} else {
				h.sName = fmt.Sprintf("%v_%v", FrontendServiceName, tenancy)
			}
		}
	}
}
func (h *Service) GetTChannel() *tchannel.Channel {
	h.startWg.Wait()
	return h.ch
}
func (h *Service) GetConfig() configure.CommonServiceConfig {
	return h.cfg
}
func (h *Service) GetRingpopMonitor() RingpopMonitor {
	h.startWg.Wait()
	return h.rpm
}
func (h *Service) GetClientFactory() ClientFactory {
	h.startWg.Wait()
	return h.cFactory
}
func (h *Service) SetClientFactory(cf ClientFactory) {
	h.cFactory = cf
}
func (h *Service) GetWSConnector() WSConnector {
	h.startWg.Wait()
	return h.wsConnector
}
func (h *Service) GetLoadReporterDaemonFactory() LoadReporterDaemonFactory {
	h.startWg.Wait()
	return h.rFactory
}