Documentation ¶
Index ¶
- Constants
- Variables
- func AddApp(ctx context.Context, in *edgeproto.App)
- func AddAppInst(ctx context.Context, appInst *edgeproto.AppInst)
- func ApiStatToMetric(ts *types.Timestamp, key *StatKey, stat *ApiStat) *edgeproto.Metric
- func AppExists(orgname string, appname string, appvers string) bool
- func AreStatesUsable(maintenanceState dme.MaintenanceState, cloudletState dme.CloudletState, ...) bool
- func ConstructFindCloudletReplyFromDmeAppInst(ctx context.Context, appinst *DmeAppInst, clientloc *dme.Loc, ...)
- func CustomStatToMetric(ts *types.Timestamp, key CustomStatKey, stat *CustomStat) *edgeproto.Metric
- func DeleteCloudletInfo(ctx context.Context, cloudletKey *edgeproto.CloudletKey)
- func DeviceStatToMetric(ts *types.Timestamp, key DeviceStatKey, stat *DeviceStat) *edgeproto.Metric
- func DistanceBetween(loc1, loc2 dme.Loc) float64
- func GenerateAuthToken(privKeyFile string, appOrg string, appname string, appvers string, ...) (string, error)
- func GenerateCookie(key *CookieKey, ctx context.Context, cookieExpiration *time.Duration) (string, error)
- func GenerateEdgeEventsCookie(key *EdgeEventsCookieKey, ctx context.Context, cookieExpiration time.Duration) (string, error)
- func GetAppInstList(ctx context.Context, ckey *CookieKey, mreq *dme.AppInstListRequest, ...)
- func GetAppOfficialFqdn(ctx context.Context, ckey *CookieKey, mreq *dme.AppOfficialFqdnRequest, ...)
- func GetAuthPublicKey(orgname string, appname string, appvers string) (string, error)
- func GetFqdnList(mreq *dme.FqdnListRequest, clist *dme.FqdnListReply)
- func GetLocationResultForDistance(distance float64) uint32
- func GetLocationTileFromGpsLocation(loc *dme.Loc, locationTileSideLengthKm int) string
- func GetStreamAuthInterceptor() grpc.StreamServerInterceptor
- func InitAppInstClients(timeout time.Duration)
- func InitVault(addr, region string, done chan struct{}) error
- func IsAppInstUsable(appInst *DmeAppInst) bool
- func IsTheSameCluster(key1 *EdgeEventsCookieKey, key2 *EdgeEventsCookieKey) bool
- func LatencyStatToMetric(ts *types.Timestamp, key LatencyStatKey, stat *LatencyStat) *edgeproto.Metric
- func ListAppinstTbl(ctx context.Context)
- func MetricToStat(metric *edgeproto.Metric) (*StatKey, *ApiStat)
- func NewCookieContext(ctx context.Context, ckey *CookieKey) context.Context
- func NewEdgeEventsCookieContext(ctx context.Context, eekey *EdgeEventsCookieKey) context.Context
- func PeerContext(ctx context.Context, ip string, port int, span opentracing.Span) context.Context
- func PruneAppInsts(ctx context.Context, appInsts map[edgeproto.AppInstKey]struct{})
- func PruneApps(ctx context.Context, apps map[edgeproto.AppKey]struct{})
- func PruneCloudlets(ctx context.Context, cloudlets map[edgeproto.CloudletKey]struct{})
- func PruneInstsCloudletState(ctx context.Context, cloudlets map[edgeproto.CloudletKey]struct{})
- func PurgeAppInstClients(ctx context.Context, appInstKey *edgeproto.AppInstKey, ...)
- func RecordDevice(ctx context.Context, req *dme.RegisterClientRequest)
- func RemoveApp(ctx context.Context, in *edgeproto.App)
- func RemoveAppInst(ctx context.Context, appInst *edgeproto.AppInst)
- func SearchAppInsts(ctx context.Context, carrierName string, app *DmeApp, loc *dme.Loc, ...) []*foundAppInst
- func SendCachedClients(ctx context.Context, old *edgeproto.AppInstClientKey, ...)
- func SetInstStateFromCloudlet(ctx context.Context, in *edgeproto.Cloudlet)
- func SetInstStateFromCloudletInfo(ctx context.Context, info *edgeproto.CloudletInfo)
- func SettingsUpdated(ctx context.Context, old *edgeproto.Settings, new *edgeproto.Settings)
- func SetupMatchEngine(eehandler EdgeEventsHandler)
- func StopAppInstClients()
- func StreamEdgeEvent(ctx context.Context, svr dme.MatchEngineApi_StreamEdgeEventServer, ...) (reterr error)
- func UnaryAuthInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (interface{}, error)
- func UpdateClientsBuffer(ctx context.Context, msg *edgeproto.AppInstClient)
- func ValidateLocation(loc *dme.Loc) error
- func VerifyAuthToken(ctx context.Context, token string, pubkey string, devname string, ...) error
- type ApiStat
- type ApiStatCall
- type AutoProvCounts
- type AutoProvPolicy
- type AutoProvPolicyHandler
- func (s *AutoProvPolicyHandler) Delete(ctx context.Context, in *edgeproto.AutoProvPolicy, rev int64)
- func (s *AutoProvPolicyHandler) Flush(ctx context.Context, notifyId int64)
- func (s *AutoProvPolicyHandler) Prune(ctx context.Context, keys map[edgeproto.PolicyKey]struct{})
- func (s *AutoProvPolicyHandler) Update(ctx context.Context, in *edgeproto.AutoProvPolicy, rev int64)
- type AutoProvStats
- func (s *AutoProvStats) Clear(appKey *edgeproto.AppKey, policy string)
- func (s *AutoProvStats) Increment(ctx context.Context, appKey *edgeproto.AppKey, ...)
- func (s *AutoProvStats) Prune(apps map[edgeproto.AppKey]struct{})
- func (s *AutoProvStats) RunNotify()
- func (s *AutoProvStats) Start()
- func (s *AutoProvStats) Stop()
- func (s *AutoProvStats) UpdateSettings(intervalSec float64)
- type AutoProvStatsShard
- type ClientToken
- type ClientsMap
- type CookieKey
- type CustomStat
- type CustomStatInfo
- type CustomStatKey
- type DeviceInfo
- type DeviceStat
- type DeviceStatKey
- type DmeApp
- type DmeAppInst
- type DmeAppInstState
- type DmeAppInsts
- type DmeApps
- type DmeCloudlet
- type DmeStats
- func (s *DmeStats) GetStreamStatsInterceptor() grpc.StreamServerInterceptor
- func (s *DmeStats) RecordApiStatCall(call *ApiStatCall)
- func (s *DmeStats) RunNotify()
- func (s *DmeStats) Start()
- func (s *DmeStats) Stop()
- func (s *DmeStats) UnaryStatsInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (interface{}, error)
- func (s *DmeStats) UpdateSettings(interval time.Duration)
- type EdgeEventMapShard
- type EdgeEventStatCall
- type EdgeEventStats
- type EdgeEventsCookieKey
- type EdgeEventsHandler
- type EmptyEdgeEventsHandler
- func (e *EmptyEdgeEventsHandler) AddClient(ctx context.Context, appInstKey edgeproto.AppInstKey, cookieKey CookieKey, ...)
- func (e *EmptyEdgeEventsHandler) GetVersionProperties(ctx context.Context) map[string]string
- func (e *EmptyEdgeEventsHandler) ProcessLatencySamples(ctx context.Context, appInstKey edgeproto.AppInstKey, cookieKey CookieKey, ...) (*dme.Statistics, error)
- func (e *EmptyEdgeEventsHandler) RemoveAppInst(ctx context.Context, appInstKey edgeproto.AppInstKey)
- func (e *EmptyEdgeEventsHandler) RemoveClient(ctx context.Context, appInstKey edgeproto.AppInstKey, cookieKey CookieKey)
- func (e *EmptyEdgeEventsHandler) RemoveCloudlet(ctx context.Context, cloudletKey edgeproto.CloudletKey)
- func (e *EmptyEdgeEventsHandler) SendAppInstStateEdgeEvent(ctx context.Context, appinstState *DmeAppInstState, ...)
- func (e *EmptyEdgeEventsHandler) SendAvailableAppInst(ctx context.Context, app *DmeApp, newAppInstKey edgeproto.AppInstKey, ...)
- func (e *EmptyEdgeEventsHandler) SendCloudletMaintenanceStateEdgeEvent(ctx context.Context, appinstState *DmeAppInstState, ...)
- func (e *EmptyEdgeEventsHandler) SendCloudletStateEdgeEvent(ctx context.Context, appinstState *DmeAppInstState, ...)
- func (e *EmptyEdgeEventsHandler) SendEdgeEventToClient(ctx context.Context, serverEdgeEvent *dme.ServerEdgeEvent, ...)
- func (e *EmptyEdgeEventsHandler) SendLatencyRequestEdgeEvent(ctx context.Context, appInstKey edgeproto.AppInstKey)
- func (e *EmptyEdgeEventsHandler) UpdateClientCarrier(ctx context.Context, appInstKey edgeproto.AppInstKey, cookieKey CookieKey, ...)
- func (e *EmptyEdgeEventsHandler) UpdateClientLastLocation(ctx context.Context, appInstKey edgeproto.AppInstKey, cookieKey CookieKey, ...)
- type LatencyStat
- type LatencyStatInfo
- type LatencyStatKey
- type LocationResult
- type LocationTileInfo
- type MapShard
- type ServerStreamWrapper
- type StatKey
- type StatKeyContextType
- type StatsStreamWrapper
Constants ¶
const (
RequestAppInstLatency = "request-appinst-latency"
)
Constants for Debug
const VeryCloseDistanceKm = 1
1 km is considered near enough to call 2 locations equivalent
Variables ¶
var ( LocationUnknown uint32 = 0 LocationVerifiedNear uint32 = 1 LocationVerifiedMedium uint32 = 2 LocationVerifiedFar uint32 = 3 LocationMismatchSameCountry uint32 = 4 LocationMismatchOtherCountry uint32 = 5 LocationRoamingCountryMatch uint32 = 6 LocationRoamingCountryMismatch uint32 = 7 )
These are the possible values returned by GDDT in the non-error case. Based on business logic (currently just defaults), we map these to a location range in KM
var AppInstClientKeyCache edgeproto.AppInstClientKeyCache
var ClientSender *notify.AppInstClientSend
var DefaultLocationRangeMap = map[uint32]LocationResult{ LocationUnknown: {-1, dme.VerifyLocationReply_LOC_UNKNOWN}, LocationVerifiedNear: {2, dme.VerifyLocationReply_LOC_VERIFIED}, LocationVerifiedMedium: {10, dme.VerifyLocationReply_LOC_VERIFIED}, LocationVerifiedFar: {100, dme.VerifyLocationReply_LOC_VERIFIED}, LocationMismatchSameCountry: {-1, dme.VerifyLocationReply_LOC_MISMATCH_SAME_COUNTRY}, LocationMismatchOtherCountry: {-1, dme.VerifyLocationReply_LOC_MISMATCH_OTHER_COUNTRY}, LocationRoamingCountryMatch: {-1, dme.VerifyLocationReply_LOC_ROAMING_COUNTRY_MATCH}, LocationRoamingCountryMismatch: {-1, dme.VerifyLocationReply_LOC_ROAMING_COUNTRY_MISMATCH}, }
it has been agreed that mappings between location result integer and distances in kilometers should be flexible. These are the default mappings
var InfiniteDistance float64 = 100000
InfiniteDistance is a value higher than the circumference of the globe, any cloudlet found would have to be closer than this.
var Jwks vault.JWKS
var LatencyTimes = []time.Duration{ 0 * time.Millisecond, 5 * time.Millisecond, 10 * time.Millisecond, 25 * time.Millisecond, 50 * time.Millisecond, 100 * time.Millisecond, }
var MyCloudletKey edgeproto.CloudletKey
MyCloudlet is the information for the cloudlet in which the DME is instantiated. The key for MyCloudlet is provided as a configuration - either command line or from a file.
var OptionFindCloudletRandomizeVeryClose bool = true
var PlatformClientsCache edgeproto.DeviceCache
var RateLimitMgr *ratelimit.RateLimitManager
RateLimitManager
var ScaleID = flag.String("scaleID", "", "ID to distinguish multiple DMEs in the same cloudlet. Defaults to hostname if unspecified.")
var Settings edgeproto.Settings
var StatKeyContextKey = StatKeyContextType("statKey")
Functions ¶
func ApiStatToMetric ¶
func AreStatesUsable ¶
func AreStatesUsable(maintenanceState dme.MaintenanceState, cloudletState dme.CloudletState, appInstHealth dme.HealthCheck) bool
Checks dme proto states for an appinst or cloudlet (Maintenance, Cloudlet, and AppInstHealth states)
func ConstructFindCloudletReplyFromDmeAppInst ¶
func ConstructFindCloudletReplyFromDmeAppInst(ctx context.Context, appinst *DmeAppInst, clientloc *dme.Loc, mreply *dme.FindCloudletReply, edgeEventsCookieExpiration time.Duration)
Helper function that creates a FindCloudletReply from a DmeAppInst struct
func CustomStatToMetric ¶
func CustomStatToMetric(ts *types.Timestamp, key CustomStatKey, stat *CustomStat) *edgeproto.Metric
func DeleteCloudletInfo ¶
func DeleteCloudletInfo(ctx context.Context, cloudletKey *edgeproto.CloudletKey)
func DeviceStatToMetric ¶
func DeviceStatToMetric(ts *types.Timestamp, key DeviceStatKey, stat *DeviceStat) *edgeproto.Metric
func DistanceBetween ¶
Use the ‘haversine’ formula to calculate the great-circle distance between two points
func GenerateAuthToken ¶
func GenerateAuthToken(privKeyFile string, appOrg string, appname string, appvers string, expireTime int64) (string, error)
GenerateAuthToken is used only for test purposes, as the DME never generates auth tokens it only verifies them
func GenerateCookie ¶
func GetAppInstList ¶
func GetAppInstList(ctx context.Context, ckey *CookieKey, mreq *dme.AppInstListRequest, clist *dme.AppInstListReply, edgeEventsCookieExpiration time.Duration)
func GetAppOfficialFqdn ¶
func GetAppOfficialFqdn(ctx context.Context, ckey *CookieKey, mreq *dme.AppOfficialFqdnRequest, repl *dme.AppOfficialFqdnReply)
func GetAuthPublicKey ¶
func GetFqdnList ¶
func GetFqdnList(mreq *dme.FqdnListRequest, clist *dme.FqdnListReply)
func GetLocationResultForDistance ¶
GetLocationResultForDistance - given a distance, converts that into a location result. This function has no knowledge of country, it is not used when we have access to the real Location Verification API Gateway.
func GetStreamAuthInterceptor ¶
func GetStreamAuthInterceptor() grpc.StreamServerInterceptor
func InitAppInstClients ¶
func IsAppInstUsable ¶
func IsAppInstUsable(appInst *DmeAppInst) bool
AppInst state is a superset of the cloudlet state and appInst state Returns if this AppInstance is usable or not
func IsTheSameCluster ¶
func IsTheSameCluster(key1 *EdgeEventsCookieKey, key2 *EdgeEventsCookieKey) bool
func LatencyStatToMetric ¶
func LatencyStatToMetric(ts *types.Timestamp, key LatencyStatKey, stat *LatencyStat) *edgeproto.Metric
func ListAppinstTbl ¶
func NewEdgeEventsCookieContext ¶
func NewEdgeEventsCookieContext(ctx context.Context, eekey *EdgeEventsCookieKey) context.Context
func PeerContext ¶
PeerContext is a helper function to a context with peer info
func PruneAppInsts ¶
func PruneAppInsts(ctx context.Context, appInsts map[edgeproto.AppInstKey]struct{})
pruneApps removes any data that was not sent by the controller.
func PruneCloudlets ¶
func PruneCloudlets(ctx context.Context, cloudlets map[edgeproto.CloudletKey]struct{})
Remove any Cloudlets we track that no longer exist and reset the state for the AppInsts
func PruneInstsCloudletState ¶
func PruneInstsCloudletState(ctx context.Context, cloudlets map[edgeproto.CloudletKey]struct{})
Reset the cloudlet state for the AppInsts for any cloudlets that no longer exists
func PurgeAppInstClients ¶
func PurgeAppInstClients(ctx context.Context, appInstKey *edgeproto.AppInstKey, appKey *edgeproto.AppKey)
If an AppInst is deleted, clean up all the clients from it
func RecordDevice ¶
func RecordDevice(ctx context.Context, req *dme.RegisterClientRequest)
Helper function to keep track of the registered devices
func SearchAppInsts ¶
func SearchAppInsts(ctx context.Context, carrierName string, app *DmeApp, loc *dme.Loc, carrierData map[string]*DmeAppInsts, resultLimit int) []*foundAppInst
given the carrier, update the reply if we find a cloudlet closer than the max distance. Return the distance and whether or not response was updated
func SendCachedClients ¶
func SendCachedClients(ctx context.Context, old *edgeproto.AppInstClientKey, new *edgeproto.AppInstClientKey)
func SetInstStateFromCloudlet ¶
SetInstStateFromCloudlet - Sets the current maintenance state of the appInstances for the cloudlet
func SetInstStateFromCloudletInfo ¶
func SetInstStateFromCloudletInfo(ctx context.Context, info *edgeproto.CloudletInfo)
SetInstStateFromCloudletInfo - Sets the current state of the appInstances for the cloudlet This gets called when a cloudlet goes offline, or comes back online
func SettingsUpdated ¶
func SetupMatchEngine ¶
func SetupMatchEngine(eehandler EdgeEventsHandler)
func StopAppInstClients ¶
func StopAppInstClients()
func StreamEdgeEvent ¶
func UnaryAuthInterceptor ¶
func UnaryAuthInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
func UpdateClientsBuffer ¶
func UpdateClientsBuffer(ctx context.Context, msg *edgeproto.AppInstClient)
Add a new client to the list of clients
func ValidateLocation ¶
Types ¶
type AutoProvCounts ¶
type AutoProvCounts struct {
// contains filtered or unexported fields
}
type AutoProvPolicy ¶
type AutoProvPolicyHandler ¶
type AutoProvPolicyHandler struct{}
func (*AutoProvPolicyHandler) Delete ¶
func (s *AutoProvPolicyHandler) Delete(ctx context.Context, in *edgeproto.AutoProvPolicy, rev int64)
func (*AutoProvPolicyHandler) Flush ¶
func (s *AutoProvPolicyHandler) Flush(ctx context.Context, notifyId int64)
func (*AutoProvPolicyHandler) Prune ¶
func (s *AutoProvPolicyHandler) Prune(ctx context.Context, keys map[edgeproto.PolicyKey]struct{})
func (*AutoProvPolicyHandler) Update ¶
func (s *AutoProvPolicyHandler) Update(ctx context.Context, in *edgeproto.AutoProvPolicy, rev int64)
type AutoProvStats ¶
type AutoProvStats struct {
// contains filtered or unexported fields
}
func InitAutoProvStats ¶
func InitAutoProvStats(intervalSec, offsetSec float64, numShards uint, nodeKey *edgeproto.NodeKey, send func(ctx context.Context, counts *edgeproto.AutoProvCounts) bool) *AutoProvStats
func (*AutoProvStats) Clear ¶
func (s *AutoProvStats) Clear(appKey *edgeproto.AppKey, policy string)
func (*AutoProvStats) Increment ¶
func (s *AutoProvStats) Increment(ctx context.Context, appKey *edgeproto.AppKey, cloudletKey *edgeproto.CloudletKey, policy *AutoProvPolicy)
func (*AutoProvStats) Prune ¶
func (s *AutoProvStats) Prune(apps map[edgeproto.AppKey]struct{})
func (*AutoProvStats) RunNotify ¶
func (s *AutoProvStats) RunNotify()
func (*AutoProvStats) Start ¶
func (s *AutoProvStats) Start()
func (*AutoProvStats) Stop ¶
func (s *AutoProvStats) Stop()
func (*AutoProvStats) UpdateSettings ¶
func (s *AutoProvStats) UpdateSettings(intervalSec float64)
type AutoProvStatsShard ¶
type AutoProvStatsShard struct {
// contains filtered or unexported fields
}
type ClientToken ¶
func GetClientDataFromToken ¶
func GetClientDataFromToken(token string) (*ClientToken, error)
type ClientsMap ¶
func (*ClientsMap) UpdateClientTimeout ¶
func (m *ClientsMap) UpdateClientTimeout(new edgeproto.Duration)
type CookieKey ¶
type CookieKey struct { PeerIP string `json:"peerip,omitempty"` OrgName string `json:"orgname,omitempty"` AppName string `json:"appname,omitempty"` AppVers string `json:"appvers,omitempty"` UniqueIdType string `json:"uniqueidtype,omitempty"` UniqueId string `json:"uniqueid,omitempty"` Kid int `json:"kid,omitempty"` }
type CustomStat ¶
type CustomStat struct { Count uint64 // number of times this custom stat has been updated RollingStatistics *grpcstats.RollingStatistics Mux sync.Mutex Changed bool }
func NewCustomStat ¶
func NewCustomStat() *CustomStat
func (*CustomStat) Update ¶
func (c *CustomStat) Update(info *CustomStatInfo)
type CustomStatInfo ¶
Filled in by DME. Added to EdgeEventStatCall to update stats
type CustomStatKey ¶
type CustomStatKey struct { AppInstKey edgeproto.AppInstKey AppKey edgeproto.AppKey CloudletKey edgeproto.CloudletKey Name string }
Used to find corresponding CustomStat Created using CustomStatInfo
func GetCustomStatKey ¶
func GetCustomStatKey(appInst *edgeproto.AppInst, statName string) CustomStatKey
type DeviceInfo ¶
type DeviceInfo struct { DeviceInfoStatic *dme.DeviceInfoStatic DeviceInfoDynamic *dme.DeviceInfoDynamic }
type DeviceStat ¶
type DeviceStat struct { NumSessions uint64 // number of sessions that send stats Mux sync.Mutex Changed bool }
func NewDeviceStat ¶
func NewDeviceStat() *DeviceStat
func (*DeviceStat) Update ¶
func (d *DeviceStat) Update()
type DeviceStatKey ¶
type DeviceStatKey struct { AppInstKey edgeproto.AppInstKey AppKey edgeproto.AppKey CloudletKey edgeproto.CloudletKey DeviceCarrier string LocationTile string DataNetworkType string DeviceOs string DeviceModel string SignalStrength uint64 }
Used to find corresponding CustomStat Created using CustomStatInfo
func GetDeviceStatKey ¶
func GetDeviceStatKey(appInst *edgeproto.AppInst, deviceInfo *DeviceInfo, loc *dme.Loc, tileLength int) DeviceStatKey
type DmeApp ¶
type DmeApp struct { sync.RWMutex AppKey edgeproto.AppKey Carriers map[string]*DmeAppInsts AuthPublicKey string AndroidPackageName string OfficialFqdn string AutoProvPolicies map[string]*AutoProvPolicy Deployment string DefaultFlavor string QosSessionProfile string QosSessionDuration time.Duration // Non mapped AppPorts from App definition (used for AppOfficialFqdnReply) Ports []dme.AppPort }
type DmeAppInst ¶
type DmeAppInst struct { // URI to connect to app inst in this cloudlet Uri string // Location of the cloudlet site (lat, long?) Location dme.Loc // State of the cloudlet - copy of the DmeCloudlet CloudletState dme.CloudletState MaintenanceState dme.MaintenanceState // Health state of the appInst AppInstHealth dme.HealthCheck TrackedState edgeproto.TrackedState // contains filtered or unexported fields }
AppInst within a cloudlet
func (*DmeAppInst) GetCloudletKey ¶
func (s *DmeAppInst) GetCloudletKey() *edgeproto.CloudletKey
type DmeAppInstState ¶
type DmeAppInstState struct { CloudletState dme.CloudletState MaintenanceState dme.MaintenanceState AppInstHealth dme.HealthCheck }
type DmeAppInsts ¶
type DmeAppInsts struct { Insts map[edgeproto.AppInstKey]*DmeAppInst AllianceInsts map[edgeproto.AppInstKey]*DmeAppInst }
type DmeApps ¶
type DmeApps struct { sync.RWMutex Apps map[edgeproto.AppKey]*DmeApp AppInstApps map[edgeproto.AppInstKey]edgeproto.AppKey // for delete Cloudlets map[edgeproto.CloudletKey]*DmeCloudlet CarriersByAppInst map[edgeproto.AppInstKey]edgeproto.CloudletKey // for delete AutoProvPolicies map[edgeproto.PolicyKey]*AutoProvPolicy FreeReservableClusterInsts edgeproto.FreeReservableClusterInstCache OperatorCodes edgeproto.OperatorCodeCache }
var DmeAppTbl *DmeApps
type DmeCloudlet ¶
type DmeCloudlet struct { // No need for a mutex - protected under DmeApps mutex CloudletKey edgeproto.CloudletKey State dme.CloudletState MaintenanceState dme.MaintenanceState GpsLocation dme.Loc AllianceCarriers map[string]struct{} AppInstKeys map[edgeproto.AppInstKey]*edgeproto.AppKey }
type DmeStats ¶
type DmeStats struct {
// contains filtered or unexported fields
}
var Stats *DmeStats
func NewDmeStats ¶
func (*DmeStats) GetStreamStatsInterceptor ¶
func (s *DmeStats) GetStreamStatsInterceptor() grpc.StreamServerInterceptor
func (*DmeStats) RecordApiStatCall ¶
func (s *DmeStats) RecordApiStatCall(call *ApiStatCall)
func (*DmeStats) RunNotify ¶
func (s *DmeStats) RunNotify()
RunNotify walks the stats periodically, and uploads the current stats to the controller.
func (*DmeStats) UnaryStatsInterceptor ¶
func (s *DmeStats) UnaryStatsInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
func (*DmeStats) UpdateSettings ¶
type EdgeEventMapShard ¶
type EdgeEventMapShard struct {
// contains filtered or unexported fields
}
type EdgeEventStatCall ¶
type EdgeEventStatCall struct { Metric string // Either cloudcommon.LatencyMetric, cloudcommon.DeviceMetric, cloudcommon.CustomMetric LatencyStatKey LatencyStatKey // Key needed if metric is cloudcommon.LatencyMetric LatencyStatInfo *LatencyStatInfo // Latency stat info if metric is cloudcommon.LatencyMetric DeviceStatKey DeviceStatKey // Key needed if metric is cloudcommon.DeviceStatKey CustomStatKey CustomStatKey // Key needed if metric is cloudcommon.CustomMetric CustomStatInfo *CustomStatInfo // Custom stat info if metric is cloudcommon.CustomMetric }
type EdgeEventStats ¶
type EdgeEventStats struct {
// contains filtered or unexported fields
}
var EEStats *EdgeEventStats
func NewEdgeEventStats ¶
func (*EdgeEventStats) RecordEdgeEventStatCall ¶
func (e *EdgeEventStats) RecordEdgeEventStatCall(call *EdgeEventStatCall)
func (*EdgeEventStats) RunNotify ¶
func (e *EdgeEventStats) RunNotify()
func (*EdgeEventStats) Start ¶
func (e *EdgeEventStats) Start()
func (*EdgeEventStats) Stop ¶
func (e *EdgeEventStats) Stop()
func (*EdgeEventStats) UpdateSettings ¶
func (e *EdgeEventStats) UpdateSettings(newinterval time.Duration)
type EdgeEventsCookieKey ¶
type EdgeEventsCookieKey struct { AppInstName string `json:"appinstname,omitempty"` ClusterOrg string `json:"clusterorg,omitempty"` ClusterName string `json:"clustername,omitempty"` CloudletOrg string `json:"cloudletorg,omitempty"` CloudletName string `json:"cloudletname,omitempty"` Location dme.Loc `json:"location,omitempty"` Kid int `json:"kid,omitempty"` }
func CreateEdgeEventsCookieKey ¶
func CreateEdgeEventsCookieKey(appInst *DmeAppInst, loc dme.Loc) *EdgeEventsCookieKey
func EdgeEventsCookieFromContext ¶
func EdgeEventsCookieFromContext(ctx context.Context) (eekey *EdgeEventsCookieKey, ok bool)
func VerifyEdgeEventsCookie ¶
func VerifyEdgeEventsCookie(ctx context.Context, cookie string) (*EdgeEventsCookieKey, error)
type EdgeEventsHandler ¶
type EdgeEventsHandler interface { GetVersionProperties(ctx context.Context) map[string]string AddClient(ctx context.Context, appInstKey edgeproto.AppInstKey, cookieKey CookieKey, lastLoc dme.Loc, carrier string, sendFunc func(event *dme.ServerEdgeEvent)) RemoveClient(ctx context.Context, appInstKey edgeproto.AppInstKey, cookieKey CookieKey) UpdateClientLastLocation(ctx context.Context, appInstKey edgeproto.AppInstKey, cookieKey CookieKey, lastLoc dme.Loc) UpdateClientCarrier(ctx context.Context, appInstKey edgeproto.AppInstKey, cookieKey CookieKey, carrier string) SendAvailableAppInst(ctx context.Context, app *DmeApp, newAppInstKey edgeproto.AppInstKey, newAppInst *DmeAppInst, newAppInstCarrier string) RemoveAppInst(ctx context.Context, appInstKey edgeproto.AppInstKey) SendLatencyRequestEdgeEvent(ctx context.Context, appInstKey edgeproto.AppInstKey) ProcessLatencySamples(ctx context.Context, appInstKey edgeproto.AppInstKey, cookieKey CookieKey, samples []*dme.Sample) (*dme.Statistics, error) SendAppInstStateEdgeEvent(ctx context.Context, appinstState *DmeAppInstState, appInstKey edgeproto.AppInstKey, appKey *edgeproto.AppKey, eventType dme.ServerEdgeEvent_ServerEventType) SendCloudletStateEdgeEvent(ctx context.Context, appinstState *DmeAppInstState, cloudletKey edgeproto.CloudletKey) SendCloudletMaintenanceStateEdgeEvent(ctx context.Context, appinstState *DmeAppInstState, cloudletKey edgeproto.CloudletKey) SendEdgeEventToClient(ctx context.Context, serverEdgeEvent *dme.ServerEdgeEvent, appInstKey edgeproto.AppInstKey, cookieKey CookieKey) }
var EEHandler EdgeEventsHandler
EdgeEventsHandler implementation (loaded from Plugin)
type EmptyEdgeEventsHandler ¶
type EmptyEdgeEventsHandler struct{}
func (*EmptyEdgeEventsHandler) AddClient ¶
func (e *EmptyEdgeEventsHandler) AddClient(ctx context.Context, appInstKey edgeproto.AppInstKey, cookieKey CookieKey, lastLoc dme.Loc, carrier string, sendFunc func(event *dme.ServerEdgeEvent))
func (*EmptyEdgeEventsHandler) GetVersionProperties ¶
func (e *EmptyEdgeEventsHandler) GetVersionProperties(ctx context.Context) map[string]string
func (*EmptyEdgeEventsHandler) ProcessLatencySamples ¶
func (e *EmptyEdgeEventsHandler) ProcessLatencySamples(ctx context.Context, appInstKey edgeproto.AppInstKey, cookieKey CookieKey, samples []*dme.Sample) (*dme.Statistics, error)
func (*EmptyEdgeEventsHandler) RemoveAppInst ¶
func (e *EmptyEdgeEventsHandler) RemoveAppInst(ctx context.Context, appInstKey edgeproto.AppInstKey)
func (*EmptyEdgeEventsHandler) RemoveClient ¶
func (e *EmptyEdgeEventsHandler) RemoveClient(ctx context.Context, appInstKey edgeproto.AppInstKey, cookieKey CookieKey)
func (*EmptyEdgeEventsHandler) RemoveCloudlet ¶
func (e *EmptyEdgeEventsHandler) RemoveCloudlet(ctx context.Context, cloudletKey edgeproto.CloudletKey)
func (*EmptyEdgeEventsHandler) SendAppInstStateEdgeEvent ¶
func (e *EmptyEdgeEventsHandler) SendAppInstStateEdgeEvent(ctx context.Context, appinstState *DmeAppInstState, appInstKey edgeproto.AppInstKey, appKey *edgeproto.AppKey, eventType dme.ServerEdgeEvent_ServerEventType)
func (*EmptyEdgeEventsHandler) SendAvailableAppInst ¶
func (e *EmptyEdgeEventsHandler) SendAvailableAppInst(ctx context.Context, app *DmeApp, newAppInstKey edgeproto.AppInstKey, newAppInst *DmeAppInst, newAppInstCarrier string)
func (*EmptyEdgeEventsHandler) SendCloudletMaintenanceStateEdgeEvent ¶
func (e *EmptyEdgeEventsHandler) SendCloudletMaintenanceStateEdgeEvent(ctx context.Context, appinstState *DmeAppInstState, cloudletKey edgeproto.CloudletKey)
func (*EmptyEdgeEventsHandler) SendCloudletStateEdgeEvent ¶
func (e *EmptyEdgeEventsHandler) SendCloudletStateEdgeEvent(ctx context.Context, appinstState *DmeAppInstState, cloudletKey edgeproto.CloudletKey)
func (*EmptyEdgeEventsHandler) SendEdgeEventToClient ¶
func (e *EmptyEdgeEventsHandler) SendEdgeEventToClient(ctx context.Context, serverEdgeEvent *dme.ServerEdgeEvent, appInstKey edgeproto.AppInstKey, cookieKey CookieKey)
func (*EmptyEdgeEventsHandler) SendLatencyRequestEdgeEvent ¶
func (e *EmptyEdgeEventsHandler) SendLatencyRequestEdgeEvent(ctx context.Context, appInstKey edgeproto.AppInstKey)
func (*EmptyEdgeEventsHandler) UpdateClientCarrier ¶
func (e *EmptyEdgeEventsHandler) UpdateClientCarrier(ctx context.Context, appInstKey edgeproto.AppInstKey, cookieKey CookieKey, carrier string)
func (*EmptyEdgeEventsHandler) UpdateClientLastLocation ¶
func (e *EmptyEdgeEventsHandler) UpdateClientLastLocation(ctx context.Context, appInstKey edgeproto.AppInstKey, cookieKey CookieKey, lastLoc dme.Loc)
type LatencyStat ¶
type LatencyStat struct { LatencyCounts grpcstats.LatencyMetric // buckets for counts LatencyBuckets []time.Duration RollingStatistics *grpcstats.RollingStatistics // General stats: Avg, StdDev, Min, Max Mux sync.Mutex Changed bool }
Wrapper struct that holds values for latency stats
func NewLatencyStat ¶
func NewLatencyStat(latencyBuckets []time.Duration) *LatencyStat
func (*LatencyStat) ResetLatencyStat ¶
func (l *LatencyStat) ResetLatencyStat()
func (*LatencyStat) Update ¶
func (l *LatencyStat) Update(info *LatencyStatInfo)
type LatencyStatInfo ¶
Filled in by DME. Added to EdgeEventStatCall to update stats
type LatencyStatKey ¶
type LatencyStatKey struct { AppInstKey edgeproto.AppInstKey AppKey edgeproto.AppKey CloudletKey edgeproto.CloudletKey DeviceCarrier string LocationTile string DataNetworkType string DeviceOs string DeviceModel string SignalStrength uint64 }
Used to find corresponding LatencyStat Created from LatencyInfo fields
func GetLatencyStatKey ¶
func GetLatencyStatKey(appInst *edgeproto.AppInst, deviceInfo *DeviceInfo, loc *dme.Loc, tileLength int) LatencyStatKey
type LocationResult ¶
type LocationResult struct { DistanceRange float64 MatchEngineLocStatus dme.VerifyLocationReply_GPSLocationStatus }
func GetDistanceAndStatusForLocationResult ¶
func GetDistanceAndStatusForLocationResult(locationResult uint32) LocationResult
GetDistanceAndStatusForLocationResult - Given a value returned by GDDT API GW, map that into a distance and DME return status.
type LocationTileInfo ¶
type ServerStreamWrapper ¶
type ServerStreamWrapper struct { grpc.ServerStream // contains filtered or unexported fields }
A wrapper for the real grpc.ServerStream
func (*ServerStreamWrapper) Context ¶
func (s *ServerStreamWrapper) Context() context.Context
func (*ServerStreamWrapper) RecvMsg ¶
func (s *ServerStreamWrapper) RecvMsg(m interface{}) error
func (*ServerStreamWrapper) SendMsg ¶
func (s *ServerStreamWrapper) SendMsg(m interface{}) error
type StatKey ¶
type StatKey struct { AppKey edgeproto.AppKey CloudletFound edgeproto.CloudletKey Method string }
Stats are collected per App per Cloudlet and per method name (verifylocation, etc).
type StatKeyContextType ¶
type StatKeyContextType string
This is for passing the carrier/cloudlet in the context
type StatsStreamWrapper ¶
type StatsStreamWrapper struct { grpc.ServerStream // contains filtered or unexported fields }
A wrapper for grpc.ServerStream to handle stats
func (*StatsStreamWrapper) Context ¶
func (w *StatsStreamWrapper) Context() context.Context
func (*StatsStreamWrapper) RecvMsg ¶
func (w *StatsStreamWrapper) RecvMsg(m interface{}) error
func (*StatsStreamWrapper) SendMsg ¶
func (w *StatsStreamWrapper) SendMsg(m interface{}) error