diff --git a/models/functions.go b/models/functions.go index ef6bf4e1d..165fd2e88 100644 --- a/models/functions.go +++ b/models/functions.go @@ -89,3 +89,9 @@ type ScheduledFunctionWorker struct { OrderingMatter bool `json:"ordering_matter"` AttachedFunctionID int `json:"attached_function_id"` } + +type FunctionCounterMsg struct { + TenantName string `json:"tenant_name"` + TotalInvocations int64 `json:"total_invocations"` + TotalDuration int64 `json:"total_duration"` +} diff --git a/server/background_tasks.go b/server/background_tasks.go index f76b2df3b..2c5e66b9b 100644 --- a/server/background_tasks.go +++ b/server/background_tasks.go @@ -330,6 +330,11 @@ func (s *Server) StartBackgroundTasks() error { return errors.New("Failed to subscribing for cloud cache updates" + err.Error()) } + err = s.ListenToFunctionsCounterUpdates() + if err != nil { + return errors.New("Failed to subscribing for functions counter updates" + err.Error()) + } + go s.ConsumeSchemaverseDlsMessages() go s.ConsumeUnackedMsgs() go s.ConsumeFunctionsDlsMessages() diff --git a/server/memphis_cloud.go b/server/memphis_cloud.go index 110267802..e5cccf2a0 100644 --- a/server/memphis_cloud.go +++ b/server/memphis_cloud.go @@ -2219,6 +2219,10 @@ func (s *Server) ListenForCloudCacheUpdates() error { return nil } +func (s *Server) ListenToFunctionsCounterUpdates() error { + return nil +} + func (c *client) AccountConnExceeded() { c.sendErrAndErr(ErrTooManyAccountConnections.Error()) }