diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/db/PluginDataChannelMessageDAO.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/db/PluginDataChannelMessageDAO.scala index fd15bfab8b..b2c9e7a40f 100644 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/db/PluginDataChannelMessageDAO.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/db/PluginDataChannelMessageDAO.scala @@ -71,6 +71,7 @@ object PluginDataChannelMessageDAO { .filter(_.meetingId === meetingId) .filter(_.pluginName === pluginName) .filter(_.dataChannel === dataChannel) + .filter(_.deletedAt.isEmpty) .map(u => (u.deletedAt)) .update(Some(new java.sql.Timestamp(System.currentTimeMillis()))) ).onComplete { diff --git a/bbb-graphql-middleware/internal/common/ActivitiesOverview.go b/bbb-graphql-middleware/internal/common/ActivitiesOverview.go index 4f867667ea..c58d3cd3c2 100644 --- a/bbb-graphql-middleware/internal/common/ActivitiesOverview.go +++ b/bbb-graphql-middleware/internal/common/ActivitiesOverview.go @@ -15,7 +15,9 @@ type ActivitiesOverviewObj struct { Completed int64 DataReceived int64 DataSizeAvg int64 + DataSizeMax int64 DataCountAvg int64 + DataCountMax int64 } var ActivitiesOverviewEnabled = false @@ -36,7 +38,9 @@ func ActivitiesOverviewStarted(index string) { Completed: 0, DataReceived: 0, DataSizeAvg: 0, + DataSizeMax: 0, DataCountAvg: 0, + DataCountMax: 0, } } @@ -61,21 +65,6 @@ func ActivitiesOverviewDataReceived(index string) { } } -func ActivitiesOverviewDataSize(index string, dataSize int64, dataCount int64) { - if !ActivitiesOverviewEnabled { - return - } - - activitiesOverviewMux.Lock() - defer activitiesOverviewMux.Unlock() - - if updatedValues, exists := activitiesOverview[index]; exists { - updatedValues.DataSizeAvg = ((updatedValues.DataSizeAvg*updatedValues.DataReceived - 1) + dataSize) / updatedValues.DataReceived - updatedValues.DataCountAvg = ((updatedValues.DataCountAvg * (updatedValues.DataReceived - 1)) + dataCount) / updatedValues.DataReceived - activitiesOverview[index] = updatedValues - } -} - func ActivitiesOverviewCompleted(index string) { if !ActivitiesOverviewEnabled { return @@ -89,7 +78,27 @@ func ActivitiesOverviewCompleted(index string) { activitiesOverview[index] = updatedValues } +} +func ActivitiesOverviewDataSize(index string, dataSize int64, dataCount int64) { + if !ActivitiesOverviewEnabled { + return + } + + activitiesOverviewMux.Lock() + defer activitiesOverviewMux.Unlock() + + if updatedValues, exists := activitiesOverview[index]; exists { + updatedValues.DataSizeAvg = ((updatedValues.DataSizeAvg * (updatedValues.DataReceived - 1)) + dataSize) / updatedValues.DataReceived + if dataSize > updatedValues.DataSizeMax { + updatedValues.DataSizeMax = dataSize + } + updatedValues.DataCountAvg = ((updatedValues.DataCountAvg * (updatedValues.DataReceived - 1)) + dataCount) / updatedValues.DataReceived + if dataCount > updatedValues.DataCountMax { + updatedValues.DataCountMax = dataCount + } + activitiesOverview[index] = updatedValues + } } func GetActivitiesOverview() map[string]ActivitiesOverviewObj { @@ -114,8 +123,10 @@ func ActivitiesOverviewLogRoutine() { if strings.HasPrefix(index, "_") || item.Started > hasuraConnections*3 || item.DataReceived > hasuraConnections*5 || - item.DataSizeAvg > 3000 || - item.DataCountAvg > 5 { + item.DataSizeAvg > 4000 || + item.DataSizeMax > 50000 || + item.DataCountAvg > 5 || + (item.DataCountMax > 10 && item.DataCountMax >= hasuraConnections) { topMessages[index] = item } } diff --git a/bbb-graphql-middleware/internal/hascli/client.go b/bbb-graphql-middleware/internal/hascli/client.go index 0ea0474f1a..c9475f966f 100644 --- a/bbb-graphql-middleware/internal/hascli/client.go +++ b/bbb-graphql-middleware/internal/hascli/client.go @@ -31,8 +31,8 @@ func HasuraClient(browserConnection *common.BrowserConnection, cookies []*http.C //Remove subscriptions from ActivitiesOverview here once Hasura-Reader will ignore "complete" msg for them browserConnection.ActiveSubscriptionsMutex.RLock() for _, subscription := range browserConnection.ActiveSubscriptions { - common.ActivitiesOverviewStarted(string(subscription.Type) + "-" + subscription.OperationName) - common.ActivitiesOverviewStarted("_Sum-" + string(subscription.Type)) + common.ActivitiesOverviewCompleted(string(subscription.Type) + "-" + subscription.OperationName) + common.ActivitiesOverviewCompleted("_Sum-" + string(subscription.Type)) } browserConnection.ActiveSubscriptionsMutex.RUnlock() }() diff --git a/bbb-graphql-server/metadata/databases/BigBlueButton/tables/public_v_poll.yaml b/bbb-graphql-server/metadata/databases/BigBlueButton/tables/public_v_poll.yaml index 15d9468584..7f3fd1eea6 100644 --- a/bbb-graphql-server/metadata/databases/BigBlueButton/tables/public_v_poll.yaml +++ b/bbb-graphql-server/metadata/databases/BigBlueButton/tables/public_v_poll.yaml @@ -61,3 +61,4 @@ select_permissions: filter: meetingId: _eq: X-Hasura-MeetingId + allow_aggregations: true diff --git a/bbb-graphql-server/metadata/databases/BigBlueButton/tables/public_v_pres_page.yaml b/bbb-graphql-server/metadata/databases/BigBlueButton/tables/public_v_pres_page.yaml index eec12b630a..ddbf350ab5 100644 --- a/bbb-graphql-server/metadata/databases/BigBlueButton/tables/public_v_pres_page.yaml +++ b/bbb-graphql-server/metadata/databases/BigBlueButton/tables/public_v_pres_page.yaml @@ -42,3 +42,4 @@ select_permissions: filter: meetingId: _eq: X-Hasura-PresenterInMeeting + allow_aggregations: true diff --git a/bigbluebutton-html5/imports/ui/components/connection-status/button/component.jsx b/bigbluebutton-html5/imports/ui/components/connection-status/button/component.jsx index 5d6112d5da..0ef82ec7cf 100644 --- a/bigbluebutton-html5/imports/ui/components/connection-status/button/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/connection-status/button/component.jsx @@ -1,7 +1,7 @@ import React, { PureComponent } from 'react'; import { defineMessages, injectIntl } from 'react-intl'; import Button from '/imports/ui/components/common/button/component'; -import ConnectionStatusModalComponent from '/imports/ui/components/connection-status/modal/component'; +import ConnectionStatusModalComponent from '/imports/ui/components/connection-status/modal/container'; import ConnectionStatusService from '/imports/ui/components/connection-status/service'; import Icon from '/imports/ui/components/connection-status/icon/component'; import Styled from './styles'; @@ -40,17 +40,12 @@ class ConnectionStatusButton extends PureComponent { setModalIsOpen = (isOpen) => this.setState({ isModalOpen: isOpen }); renderModal(isModalOpen) { - const { - connectionData, - } = this.props; - return ( isModalOpen ? : null ) @@ -85,17 +80,11 @@ class ConnectionStatusButton extends PureComponent { } const { - connectionData, + myCurrentStatus, } = this.props; - const ownConnectionData = connectionData.filter((curr) => curr.user.userId === Auth.userID); - - const currentStatus = ownConnectionData && ownConnectionData.length > 0 - ? ownConnectionData[0].currentStatus - : 'normal'; - let color; - switch (currentStatus) { + switch (myCurrentStatus) { case 'warning': color = 'success'; break; @@ -114,7 +103,7 @@ class ConnectionStatusButton extends PureComponent { return (