Skip to content

Commit

Permalink
Merge pull request #1436 from memphisdev/RND-194-report-total-invocat…
Browse files Browse the repository at this point in the history
…ions-total-duration-to-firestore-stigg

from cloud
  • Loading branch information
shay23b authored Nov 21, 2023
2 parents 2dda870 + 8155820 commit 947889c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions models/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
5 changes: 5 additions & 0 deletions server/background_tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 4 additions & 0 deletions server/memphis_cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
Expand Down

0 comments on commit 947889c

Please sign in to comment.