You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by "quantranhong1999 (via GitHub)" <gi...@apache.org> on 2024/10/31 08:32:46 UTC

[PR] [Metrics] Add a few Websocket metrics [james-project]

quantranhong1999 opened a new pull request, #2479:
URL: https://github.com/apache/james-project/pull/2479

   - Opening connections count
   - Requests throughput


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


Re: [PR] [Metrics] Add a few Websocket metrics [james-project]

Posted by "chibenwa (via GitHub)" <gi...@apache.org>.
chibenwa commented on code in PR #2479:
URL: https://github.com/apache/james-project/pull/2479#discussion_r1824107136


##########
server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/routes/WebSocketRoutes.scala:
##########
@@ -79,7 +80,12 @@ class WebSocketRoutes @Inject() (@Named(InjectionKeys.RFC_8621) val authenticato
                                  emailChangeRepository: EmailChangeRepository,
                                  pushSerializer: PushSerializer,
                                  typeStateFactory: TypeStateFactory,
-                                 delegationStore: DelegationStore) extends JMAPRoutes {
+                                 delegationStore: DelegationStore,
+                                 metricFactory: MetricFactory,
+                                 gaugeRegistry: GaugeRegistry) extends JMAPRoutes {
+  private val openingConnectionsMetric: Metric = metricFactory.generate("jmap_websocket_opening_connections")

Review Comment:
   ```suggestion
     private val openingConnectionsMetric: Metric = metricFactory.generate("jmap_websocket_opened_connections")
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


Re: [PR] [Metrics] Add a few Websocket metrics [james-project]

Posted by "Arsnael (via GitHub)" <gi...@apache.org>.
Arsnael merged PR #2479:
URL: https://github.com/apache/james-project/pull/2479


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


Re: [PR] [Metrics] Add a few Websocket metrics [james-project]

Posted by "chibenwa (via GitHub)" <gi...@apache.org>.
chibenwa commented on code in PR #2479:
URL: https://github.com/apache/james-project/pull/2479#discussion_r1824107136


##########
server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/routes/WebSocketRoutes.scala:
##########
@@ -79,7 +80,12 @@ class WebSocketRoutes @Inject() (@Named(InjectionKeys.RFC_8621) val authenticato
                                  emailChangeRepository: EmailChangeRepository,
                                  pushSerializer: PushSerializer,
                                  typeStateFactory: TypeStateFactory,
-                                 delegationStore: DelegationStore) extends JMAPRoutes {
+                                 delegationStore: DelegationStore,
+                                 metricFactory: MetricFactory,
+                                 gaugeRegistry: GaugeRegistry) extends JMAPRoutes {
+  private val openingConnectionsMetric: Metric = metricFactory.generate("jmap_websocket_opening_connections")

Review Comment:
   ```suggestion
     private val openingConnectionsMetric: Metric = metricFactory.generate("jmap_websocket_opened_connections_count")
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


Re: [PR] [Metrics] Add a few Websocket metrics [james-project]

Posted by "quantranhong1999 (via GitHub)" <gi...@apache.org>.
quantranhong1999 commented on code in PR #2479:
URL: https://github.com/apache/james-project/pull/2479#discussion_r1824121468


##########
server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/routes/WebSocketRoutes.scala:
##########
@@ -79,7 +80,12 @@ class WebSocketRoutes @Inject() (@Named(InjectionKeys.RFC_8621) val authenticato
                                  emailChangeRepository: EmailChangeRepository,
                                  pushSerializer: PushSerializer,
                                  typeStateFactory: TypeStateFactory,
-                                 delegationStore: DelegationStore) extends JMAPRoutes {
+                                 delegationStore: DelegationStore,
+                                 metricFactory: MetricFactory,
+                                 gaugeRegistry: GaugeRegistry) extends JMAPRoutes {
+  private val openingConnectionsMetric: Metric = metricFactory.generate("jmap_websocket_opening_connections")

Review Comment:
   Do you mean opened connections of all time, or just opened connections at the moment?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


Re: [PR] [Metrics] Add a few Websocket metrics [james-project]

Posted by "chibenwa (via GitHub)" <gi...@apache.org>.
chibenwa commented on code in PR #2479:
URL: https://github.com/apache/james-project/pull/2479#discussion_r1824108912


##########
server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/routes/WebSocketRoutes.scala:
##########
@@ -113,6 +120,10 @@ class WebSocketRoutes @Inject() (@Named(InjectionKeys.RFC_8621) val authenticato
         frame.content().readBytes(bytes)
         new String(bytes, StandardCharsets.UTF_8)
       })
+      .doOnNext(_ => {
+        requestCountMetric.increment()
+        requestThroughputGauge.setValue(requestCountMetric.meanRate().intValue)

Review Comment:
   Kill that gauge, it won't be performant. And we can do a derivative for that in grafana.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


Re: [PR] [Metrics] Add a few Websocket metrics [james-project]

Posted by "quantranhong1999 (via GitHub)" <gi...@apache.org>.
quantranhong1999 commented on PR #2479:
URL: https://github.com/apache/james-project/pull/2479#issuecomment-2449466007

   Squashed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org